14 #ifndef STXXL_COMMON_NEW_ALLOC_HEADER
15 #define STXXL_COMMON_NEW_ALLOC_HEADER
26 template <
typename Type,
typename Rebind>
29 template <
typename Type>
34 template <
typename Type,
typename Rebind>
36 typedef std::allocator<Rebind>
other;
54 template <
class Rebind>
71 template <
class Rebind>
75 template <
class Rebind>
76 operator std::allocator<Rebind>()
78 static std::allocator<Rebind> helper_allocator;
79 return helper_allocator;
91 return static_cast<Type*
>(Type::operator
new (num *
sizeof(Type)));
100 ::new ((
void*)p)Type(value);
103 #ifdef __GXX_EXPERIMENTAL_CXX0X__
104 template <
typename ... Args>
105 void construct(pointer p, Args&& ... args)
107 ::new ((
void*)p)Type(std::forward<Args>(args) ...);
121 Type::operator
delete (p);
126 template <
class Type1,
class Type2>
133 template <
class Type1,
class Type2>
142 #endif // !STXXL_COMMON_NEW_ALLOC_HEADER
new_alloc(const new_alloc< Rebind > &)
new_alloc(const new_alloc &)
const Type & const_reference
size_type max_size() const
void construct(pointer p, const Type &value)
pointer address(reference value) const
new_alloc_rebind< Type, Rebind >::other other
const_pointer address(const_reference value) const
bool operator!=(const uint_pair &b) const
inequality checking operator
std::allocator< Rebind > other
const Type * const_pointer
#define STXXL_BEGIN_NAMESPACE
std::ptrdiff_t difference_type
static uint_pair max()
return an uint_pair instance containing the largest value possible
pointer allocate(size_type num, const void *=0)
void deallocate(pointer p, size_type)
bool operator==(const uint_pair &b) const
equality checking operator
#define STXXL_END_NAMESPACE