27 #ifdef LPP_USE_ALLOCATOR
34 template <
typename TYPE>
38 typedef size_t size_type;
39 typedef ptrdiff_t difference_type;
40 typedef TYPE* pointer;
41 typedef const TYPE* const_pointer;
42 typedef TYPE& reference;
43 typedef const TYPE& const_reference;
44 typedef TYPE value_type;
54 pointer allocate(size_type n,
const void* = 0)
56 return (TYPE*)
AllocMemory((
size_t)(n *
sizeof(TYPE)));
59 void deallocate(
void* p, size_type)
65 pointer address(reference x)
const
70 const_pointer address(const_reference x)
const
80 void construct(pointer p,
const TYPE& val)
82 new ((TYPE*)p) TYPE(val);
85 void destroy(pointer p)
90 size_type max_size()
const
98 typedef LuceneAllocator<U> other;
107 template <
typename TYPE>
108 inline bool operator== (
const LuceneAllocator<TYPE>&,
const LuceneAllocator<TYPE>&)
113 template <
typename TYPE>
114 inline bool operator!= (
const LuceneAllocator<TYPE>&,
const LuceneAllocator<TYPE>&)
123 typedef void* pointer;
124 typedef const void* const_pointer;
125 typedef void value_type;
138 typedef LuceneAllocator<U> other;
150 #ifndef LPP_USE_ALLOCATOR
151 #define LuceneAllocator std::allocator