Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-03-16 12:30:02


"Mathias Gaunard" <mathias.gaunard_at_[hidden]> wrote in message
news:eteg9r$hks$1_at_sea.gmane.org...
> 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.

I would like to second that. Clearly stated problem domain is a primary goal
if introduction, especially for the puposes on review.

> 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.

Why? And how much? I need specific numbers.

> So basically, if you have std::list<T*>, and you can modify T, then it
> is more efficient to use std::ilist<T>.

Why? how std::list<T*> prevent you to modify the pointed value and/or how
does it affect performance?

> 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.

IOW this library promotes unsafe programming right?

Gennadiy


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