Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-12-08 06:08:02


"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote in message
news:cp5mrk$h0p$1_at_sea.gmane.org...
|
| "Thorsten Ottosen" wrote:
|
| > I have sometimes spoken with people here
| > that had an interest in allocators that could
| > be reset within containers. For example, some
| > have wanted a
| >
| > allocator& container::get_allocator();
| > member function.
| >
| The point may be that only container itself
| is enough to change allocator state, no
| pointers or external variables that need to
| be passed down into functions or made global.

yes, that can't be made to work for existing containers in the standard,
right?

|
| > One way to solve that problem could be a class like this:
| >
| > template< class Allocator >
| > class external_allocator
| > {
| > public:
| > // forward to Allocator* member
| > };
| >
| With a special allocator, how can one access
| its specific interface via 'external_allocator'?

either a get_internal() member function, like

get_allocator().get_internal()

or by direct forwarding to the "internal" one in the case of the smart
containers.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk