33#ifndef DART_COMMON_STLALLOCATOR_HPP_
34#define DART_COMMON_STLALLOCATOR_HPP_
48 using Base = std::allocator<T>;
49 using value_type =
typename std::allocator_traits<Base>::value_type;
50 using size_type =
typename std::allocator_traits<Base>::size_type;
51 using pointer =
typename std::allocator_traits<Base>::pointer;
52 using const_pointer =
typename std::allocator_traits<Base>::const_pointer;
94 void print(std::ostream& os = std::cout,
int indent = 0) const;
98 friend std::ostream& operator<<(
102 template <typename U>
109#include "dart/common/detail/StlAllocator-impl.hpp"
Base class for std::allocator compatible allocators.
Definition MemoryAllocator.hpp:46
static MemoryAllocator & GetDefault()
Returns the default memory allocator.
Definition MemoryAllocator.cpp:41
Wrapper class for MemoryAllocator to be compatible with std::allocator.
Definition StlAllocator.hpp:45
void print(std::ostream &os=std::cout, int indent=0) const
Prints state of the memory allocator.
Definition StlAllocator-impl.hpp:91
std::allocator< T > Base
Definition StlAllocator.hpp:48
friend class StlAllocator
Definition StlAllocator.hpp:103
typename std::allocator_traits< Base >::size_type size_type
Definition StlAllocator.hpp:50
typename std::allocator_traits< Base >::pointer pointer
Definition StlAllocator.hpp:51
void deallocate(pointer pointer, size_type n)
Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier c...
Definition StlAllocator-impl.hpp:84
typename std::allocator_traits< Base >::value_type value_type
Definition StlAllocator.hpp:49
MemoryAllocator & mBaseAllocator
Definition StlAllocator.hpp:104
pointer allocate(size_type n, const void *hint=0)
Allocates n * sizeof(T) bytes of uninitialized storage.
Definition StlAllocator-impl.hpp:65
typename std::allocator_traits< Base >::const_pointer const_pointer
Definition StlAllocator.hpp:52
Definition StlAllocator.hpp:56