
Tom Brinkman wrote:
I use STL now like its second nature. As the Intrusive library proposes to be an alternative to STL for some situations, I am intrigued. I have no background with intrusive containers so I'm not shur why I would use one.
Here is what I understand: They're a more time and space efficient alternative for node-based containers of pointers when you have the possibility of modifying the type to make it into a node. So basically, if you have std::list<T*>, and you can modify T, then it is more efficient to use std::ilist<T>. Note however, that the container doesn't "own" its contents and is not therefore responsible for destroying them. An intrusive container allocates and frees nothing, it just alters the nodes you provide it with to build the data structure. It's up to the user to allocate and free the nodes, which are actually the object themselves.