Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-03-17 05:22:45


Timmo Stange wrote:
> Tobias Schwinger wrote:
>
>> Anyway, I still don't understand why we can't have intrusive containers
>> without intrusive syntax. E.g:
>>
>> struct slist_node // <-- part of container implementation
>> {
>> T element; // note: held by value
>> slist_node * next;
>> };
>>
>> Then there's only one allocation per 'slist_node'.
>
> 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?

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

Regards,
Tobias


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