Boost logo

Boost :

From: Timmo Stange (ts_at_[hidden])
Date: 2007-03-17 08:43:56

Tobias Schwinger wrote:

>> What's the difference between that and the standard (non-intrusive)
>> containers?
> The same as intrusive containers: Allocation in one shot and having both
> the actual data and the accounting information in one block of memory.
> I might be missing something. Am I?

I am not sure. Perhaps I'm the one missing something in your idea, but
what you suggested is how list nodes may already look like in a
standard library implementation. They use "single-shot allocation"
when T is copy-constructible. If it is not, one needs to use list<T*>
and allocate Ts separately. I do not see how that can be avoided when
the node type is hidden in the implementation.

> Granted, allocators will need some special care this way, but a better
> interface would be worth it.

Hm, do you mean allocator<T>::rebind<slist_node<T>>? It is already
there for exactly that purpose (rebinding from T to a container
node type).


Timmo Stange

Boost list run by bdawes at, gregod at, cpdaniel at, john at