pool: add pointer to index query

This commit is contained in:
Danny Robson 2018-07-04 14:04:29 +10:00
parent 3370c6764e
commit f1c70beee1

View File

@ -160,6 +160,11 @@ namespace util {
// Indexing
size_t index (T const *ptr) const
{
CHECK_LIMIT (ptr, base (), base () + m_capacity);
return ptr - base ();
}
/// returns the base address of the allocation.