
On Friday 29 April 2005 23:27, Olaf Krzikalla wrote:
But why not using a reference type and storing this in the usual non-instrusive containers?
Performance reasons. Look at Overview, section 'Properties of intrusive containers' and then go to Usage, section 'When to use?'. It not only mentions your idea, but should answers your question too. In fact, the development of these containers was the result of falling in a deep performance hole while developing some mathematical algorithms (e.g. a fast triangulation algorithm, which needs 3 sequences over the vertices). Another example is the open source polygon clipping algorithm GPC. A C++ version of GPC could draw huge advantages from Boost.Intrusive.
Yep, now I understood. The whole thing is about laying out objects in memory in an efficient way. Sorry for always talking in critic, but I would love to suggest to think about memory allocators. Pool allocators can be utilised greatly to achieve memory layout for ideal cache heating. I missed that point in the efficiency discussion of intrusive containers versus non-intrusive containers. There's no need for any runtime allocation logic at all for non-intrusive containers, but intrusive containers may compete with non-intrusive one when applying pool allocators. Oh, and thank you answering my questions. These non-instrusive containers provide me some good ideas for my own work. Best regards, Frank.