Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2005-05-02 05:06:00

Thorsten Ottosen wrote:
> I see now that you always store the elements in a vector before you create a
> list of pointers; so that answers my question about where the
> stuff is stored.

In normal use they wouldn't have to be stored in a vector.

> Then I need to ask, what the big difference would be between your classes and
> using boost.multi-index container?
> Coulnd't the same functionality be found there already? If not, wouldn't it be
> easy to add the functionality there
> with a new style of indices.

You might find this article useful:

Or if you've got Dr. Dobbs access:

might be better, although it's more than a little hyberbolic.

Anyway, for a motivating example, consider a class that wishes to keep
track of the smart pointers pointing at it. The pointers could act as
nodes on an intrusive list. When a pointer's value is changed, it just
removes itself from its current pointee's list and adds itself to its
new pointee. Using standard containers might be too expensive here
because or the required memory allocations. Then, at any time, all the
pointers that point to the class can be found.


Boost list run by bdawes at, gregod at, cpdaniel at, john at