From d094fc2f52886c847752495d11eaaf30b1e4eb15 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 8 Feb 2017 15:28:07 +0000 Subject: [PATCH] Added begin/end iterators to MemoryBlock --- modules/juce_core/memory/juce_MemoryBlock.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_core/memory/juce_MemoryBlock.h b/modules/juce_core/memory/juce_MemoryBlock.h index e2563937e6..86d149fd39 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.h +++ b/modules/juce_core/memory/juce_MemoryBlock.h @@ -103,6 +103,11 @@ public: template char& operator[] (const Type offset) const noexcept { return data [offset]; } + /** Returns an iterator for the data. */ + char* begin() const noexcept { return data; } + + /** Returns an end-iterator for the data. */ + char* end() const noexcept { return begin() + getSize(); } //============================================================================== /** Returns the block's current allocated size, in bytes. */