diff --git a/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h b/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h index 103f885ac..e8ec6949d 100644 --- a/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h @@ -72,6 +72,14 @@ public: MemoryBlock& operator= (MemoryBlock&& other) noexcept; #endif + // Standard container interface + typedef char* iterator; + typedef char const* const_iterator; + inline iterator begin () noexcept { return static_cast (getData ()); } + inline iterator end () noexcept { return addBytesToPointer (begin (), size); } + inline const_iterator cbegin () const noexcept { return static_cast (getData ()); } + inline const_iterator cend () const noexcept { return addBytesToPointer (cbegin (), size); } + //============================================================================== /** Compares two memory blocks. @@ -104,7 +112,6 @@ public: template char& operator[] (const Type offset) const noexcept { return data [offset]; } - //============================================================================== /** Returns the block's current allocated size, in bytes. */ size_t getSize() const noexcept { return size; }