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>
75 ::new (static_cast<void*>(p))SubType(std::forward<Args>(args) ...);
79 template <
typename SubType>
87 #endif // !TLX_ALLOCATOR_BASE_HEADER const_pointer address(const_reference x) const noexcept
Returns the address of x.
void destroy(pointer p) const noexcept
Destroys in-place the object pointed by p.
const char * const_pointer
const char & const_reference
std::true_type propagate_on_container_move_assignment
C++11 type flag.
void construct(pointer p, const_reference value)
Constructs an element object on the location pointed by p.
std::true_type is_always_equal
C++11 type flag.
std::ptrdiff_t difference_type
size_type max_size() const noexcept
Maximum size possible to allocate.
void destroy(SubType *p) const noexcept
Destroys in-place the object pointed by p.
void construct(SubType *p, Args &&... args)
Constructs an element object on the location pointed by p.
static constexpr bool debug
pointer address(reference x) const noexcept
Returns the address of x.