
17 Mar
2007
17 Mar
'07
9:22 a.m.
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