beautypg.com

HP Integrity NonStop H-Series User Manual

Page 200

background image

typedef implementation_defined value_type;
};

Each of the pointer types in this interface must have a conversion to void*. It must be possible to
use the resulting void* as a this value in a constructor or destructor and in conversions to
::types::pointer (for appropriate B) for use by B::deallocate().

Here is a description of the member functions that a Standard C++ Library allocator must
provide:

my_allocator();
my_allocator(const my_allocator&);
~my_allocator();

Constructors and destructor.

template
types::pointer address(types::reference r) const;

Returns the address of r as a pointer type. This function and the following function are
used to convert references to pointers.

template
types::const_pointer address(types::const_reference r)
const;

Returns the address of r as a const_pointer type.

template
types::pointer allocate(size_type n);

Allocate storage for n values of T.

template
types::pointer allocate(size_type n, U u);

Allocate storage for n values of T, using the value of u as an implementation-defined hint
for determining the best storage placement.

template
void
deallocate(types::pointer);

Deallocate storage obtained by a call to allocate.

size_type
max_size();

Return the largest possible storage available through a call to allocate.

template
void
construct(types::pointer p, U u);

Construct an object of type T at the location of p, using the value of u in the call to the

This manual is related to the following products: