Template Class Arena
Defined in File Arena.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T, class A = std::allocator<T>>
class Arena an arena of objects of type T in blocks of n
Public Functions
-
explicit Arena(std::size_t n = std::size_t(1) << 12, const A &alloc = A())
an empty arena whose blocks hold n objects
- Pre:
n >= 1
-
~Arena()
destroys all the objects and frees the blocks
-
template<class ...Args>
T *make(Args&&... args) a new object built from the arguments, whose address never changes
-
std::size_t size(void) const
the number of objects made
-
std::size_t bytes(void) const
the memory of the blocks, in bytes
-
inline const_iterator begin(void) const
-
inline const_iterator end(void) const
-
inline const_iterator cbegin(void) const
-
inline const_iterator cend(void) const
-
template<bool Const>
class Iterator the iterator, on objects const if Const
Public Types
-
using iterator_category = std::random_access_iterator_tag
-
using difference_type = std::ptrdiff_t
Public Functions
-
Iterator(void) = default
-
inline Iterator(Blocks B, std::size_t n, std::size_t i)
-
inline reference operator[](difference_type k) const
-
inline Iterator &operator+=(difference_type k)
-
inline Iterator &operator-=(difference_type k)
Friends
-
inline friend Iterator operator+(Iterator a, difference_type k)
-
inline friend Iterator operator+(difference_type k, Iterator a)
-
inline friend Iterator operator-(Iterator a, difference_type k)
-
inline friend difference_type operator-(const Iterator &a, const Iterator &b)
-
using iterator_category = std::random_access_iterator_tag
-
explicit Arena(std::size_t n = std::size_t(1) << 12, const A &alloc = A())