17 template <
class T,
class TMemInterface >
class stl_allocator :
public TMemInterface
22 typedef value_type *pointer;
23 typedef const value_type *const_pointer;
24 typedef value_type &reference;
25 typedef const value_type &const_reference;
26 typedef size_t size_type;
27 typedef ptrdiff_t difference_type;
35 template <
typename U,
class TMemInterface >
struct rebind 65 inline pointer
address(reference r) {
return &r; }
71 inline const_pointer
address(const_reference r) {
return &r; }
79 inline pointer
allocate(size_type _cnt,
typename std::allocator< void >::const_pointer = 0)
81 pointer new_memory =
reinterpret_cast<pointer
>(
operator new(_cnt *
sizeof(T)));
90 inline void deallocate(pointer _p, size_type _n) {
operator delete(_p, _n *
sizeof(T)); }
96 inline size_type
max_size()
const {
return std::numeric_limits< size_type >::max() /
sizeof(T); }
stl_allocator(stl_allocator const &)
Initializes a new instance of the stl_allocator class.
Definition: allocator.h:53
bool operator==(stl_allocator const &) const
Operator==s the specified .
Definition: allocator.h:103
Class stl_allocator.
Definition: allocator.h:16
Struct rebind
Definition: allocator.h:35
size_type max_size() const
Maximums the size.
Definition: allocator.h:96
Definition: allocator.h:17
stl_allocator()
Initializes a new instance of the stl_allocator class.
Definition: allocator.h:44
pointer allocate(size_type _cnt, typename std::allocator< void >::const_pointer=0)
Allocates the specified count.
Definition: allocator.h:79
const_pointer address(const_reference r)
Addresses the specified r.
Definition: allocator.h:71
stl_allocator(stl_allocator< U, TMemInterface > const &)
Initializes a new instance of the stl_allocator class.
Definition: allocator.h:58
pointer address(reference r)
Addresses the specified r.
Definition: allocator.h:65
void deallocate(pointer _p, size_type _n)
Deallocates the specified p.
Definition: allocator.h:90
bool operator!=(stl_allocator const &_a)
Operator!=s the specified a.
Definition: allocator.h:110
~stl_allocator()
Finalizes an instance of the stl_allocator class.
Definition: allocator.h:48