pool: add accessor for base address

This commit is contained in:
Danny Robson 2018-07-04 14:04:16 +10:00
parent 935a3b950f
commit 3370c6764e

View File

@ -160,7 +160,15 @@ namespace util {
// Indexing
size_t index (const T*) const;
/// returns the base address of the allocation.
///
// guaranteed to point to the first _possible_ allocated value;
// however it may not be _live_ at any given moment. provided to
// facilitate indexing.
T* base (void) { return reinterpret_cast<T*> (m_head); }
T const* base (void) const { return reinterpret_cast<T const*> (m_head); }
T& operator[] (size_t idx) &;