Boost logo

Boost :

From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2007-03-16 12:23:40


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.


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