3 * - By John Hodge (thePowersGang)
8 #ifndef _LIBCXX_ALLOCATOR_
9 #define _LIBCXX_ALLOCATOR_
15 template <class T> class allocator
21 typedef const T* const_pointer;
22 typedef const T& const_reference;
23 typedef size_t size_type;
24 typedef ptrdiff_t difference_type;
29 typedef allocator<Type> other;
34 allocator(const allocator& alloc __attribute__((unused))) throw() {
37 allocator(const allocator<U>& alloc) throw() {
39 ~allocator() throw() {
42 pointer address(reference x) const {
45 const_pointer address(const_reference x) const {
48 pointer allocate(size_type n, const void* hint=0) {
50 return static_cast<pointer>( ::operator new (n * sizeof(value_type)) );
52 void deallocate(pointer p, size_type n) {
56 size_type max_size() {
57 return ((size_type)-1) / sizeof(value_type);
59 void construct( pointer p, const_reference val ) {
60 ::new ((void*)p) value_type (val);
63 //template<class U, class... Args>
64 //void construct( U* p, Args&&... args ) {
65 // ::new ((void*)p) U (forward<Args>(args));
67 void destroy(pointer p) {