pool: add accessor for base address
This commit is contained in:
parent
935a3b950f
commit
3370c6764e
10
pool.hpp
10
pool.hpp
@ -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) &;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user