Go to the documentation of this file.
11 #ifndef TLX_ALLOCATOR_BASE_HEADER
12 #define TLX_ALLOCATOR_BASE_HEADER
16 #include <type_traits>
20 template <
typename Type>
23 static constexpr
bool debug =
true;
41 return std::addressof(x);
46 return std::addressof(x);
51 return size_t(-1) /
sizeof(Type);
56 ::new (
static_cast<void*
>(p))Type(value);
62 #pragma warning(disable:4100)
73 template <
typename SubType,
typename... Args>
74 void construct(SubType* p, Args&& ... args) {
75 ::new (
static_cast<void*
>(p))SubType(std::forward<Args>(args) ...);
79 template <
typename SubType>
80 void destroy(SubType* p)
const noexcept {
87 #endif // !TLX_ALLOCATOR_BASE_HEADER
size_type max_size() const noexcept
Maximum size possible to allocate.
void destroy(pointer p) const noexcept
Destroys in-place the object pointed by p.
static constexpr bool debug
void construct(pointer p, const_reference value)
Constructs an element object on the location pointed by p.
pointer address(reference x) const noexcept
Returns the address of x.
std::true_type is_always_equal
C++11 type flag.
std::true_type propagate_on_container_move_assignment
C++11 type flag.
const Type * const_pointer
std::ptrdiff_t difference_type
const Type & const_reference