14 #ifndef FOXXLL_COMMON_NEW_ALLOC_HEADER 15 #define FOXXLL_COMMON_NEW_ALLOC_HEADER 25 template <
typename Type,
typename Rebind>
28 template <
typename Type>
33 template <
typename Type,
typename Rebind>
35 using other = std::allocator<Rebind>;
53 template <
class Rebind>
70 template <
class Rebind>
74 template <
class Rebind>
75 operator std::allocator<Rebind>()
77 static std::allocator<Rebind> helper_allocator;
78 return helper_allocator;
90 return static_cast<Type*
>(Type::operator
new (num *
sizeof(
Type)));
99 ::new (static_cast<void*>(p))
Type(value);
102 template <
typename... Args>
105 ::new (static_cast<void*>(p))
Type(std::forward<Args>(args) ...);
118 Type::operator
delete (p);
123 template <
class Type1,
class Type2>
130 template <
class Type1,
class Type2>
139 #endif // !FOXXLL_COMMON_NEW_ALLOC_HEADER
static uint_pair max()
return an uint_pair instance containing the largest value possible
bool operator!=(const new_alloc< Type1 > &, const new_alloc< Type2 > &) noexcept
const Type * const_pointer
pointer allocate(size_type num, const void *=0)
typename new_alloc_rebind< Type, Rebind >::other other
void construct(pointer p, const Type &value)
size_type max_size() const noexcept
void deallocate(pointer p, size_type)
new_alloc(const new_alloc< Rebind > &) noexcept
std::allocator< Rebind > other
const Type & const_reference
void construct(pointer p, Args &&... args)
pointer address(reference value) const
std::ptrdiff_t difference_type
bool operator==(const new_alloc< Type1 > &, const new_alloc< Type2 > &) noexcept
const_pointer address(const_reference value) const
new_alloc(const new_alloc &) noexcept