41 return static_cast<T*
>(_allocator->allocate(n *
sizeof(T),
alignof(T)));
45 _allocator->deallocate(ptr, n *
sizeof(T),
alignof(T));
53 return a._allocator->
is_equal(*b._allocator);
Virtual interface class for memory allocation and deallocation.
bool is_equal(Allocator const &other) const noexcept
Return true if memory allocated by this Allocator instance can be deallocated by the other Allocator ...
Allocator * get_allocator() const
StlAllocator(Allocator *alloc)
friend bool operator!=(StlAllocator const &a, StlAllocator const &b)
friend bool operator==(StlAllocator const &a, StlAllocator const &b)
void deallocate(T *ptr, std::size_t n)
StlAllocator(StlAllocator< U > const &other)
T * allocate(std::size_t n)
Allocator * GetDefaultAllocator()
Get an instance of the DefaultAllocator class.