3 * - By John Hodge (thePowersGang)
8 #ifndef _LIBCXX_ALLOCATOR_
9 #define _LIBCXX_ALLOCATOR_
16 template <class T> class allocator
22 typedef const T* const_pointer;
23 typedef const T& const_reference;
24 typedef size_t size_type;
25 typedef ptrdiff_t difference_type;
30 typedef allocator<Type> other;
35 allocator(const allocator& alloc __attribute__((unused))) throw() {
38 allocator(const allocator<U>& alloc) throw() {
40 ~allocator() throw() {
43 pointer address(reference x) const {
46 const_pointer address(const_reference x) const {
49 pointer allocate(size_type n, const void* hint=0) {
51 return static_cast<pointer>( ::operator new (n * sizeof(value_type)) );
53 void deallocate(pointer p, size_type n) {
57 size_type max_size() {
58 return ((size_type)-1) / sizeof(value_type);
60 void construct( pointer p, const_reference val ) {
61 new ((void*)p) value_type (val);
64 //template<class U, class... Args>
65 //void construct( U* p, Args&&... args ) {
66 // ::new ((void*)p) U (forward<Args>(args));
68 void destroy(pointer p) {