HP Integrity NonStop H-Series User Manual

Page 200

Advertising
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<void>::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 <class T>
types<T>::pointer address(types<T>::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 <class T>
types<T>::const_pointer address(types<T>::const_reference r)
const;

Returns the address of r as a const_pointer type.

template <class T>
types<T>::pointer allocate(size_type n);

Allocate storage for n values of T.

template <class T, class U>
types<T>::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 <class T>
void
deallocate(types<T>::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 <class T, class U>
void
construct(types<T>::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

Advertising
This manual is related to the following products: