3 * - By John Hodge (thePowersGang)
8 #ifndef _LIBCXX_ALLOCATOR_
9 #define _LIBCXX_ALLOCATOR_
11 #include "_libcxx_helpers.h"
19 template <class T> class allocator
25 typedef const T* const_pointer;
26 typedef const T& const_reference;
27 typedef size_t size_type;
28 typedef ptrdiff_t difference_type;
33 typedef allocator<Type> other;
38 allocator(const allocator& alloc __attribute__((unused))) throw() {
41 allocator(const allocator<U>& alloc) throw() {
43 ~allocator() throw() {
46 pointer address(reference x) const {
49 const_pointer address(const_reference x) const {
52 pointer allocate(size_type n, const void* hint=0) {
54 return static_cast<pointer>( ::operator new (n * sizeof(value_type)) );
56 void deallocate(pointer p, size_type n) {
60 size_type max_size() {
61 return ((size_type)-1) / sizeof(value_type);
63 void construct( pointer p, const_reference val ) {
64 new ((void*)p) value_type (val);
68 template<class U, class... Args>
69 void construct( U* p, Args&&... args ) {
70 ::new ((void*)p) U (::std::forward<Args>(args)...);
73 void destroy(pointer p) {