Boost logo

Boost :

Subject: Re: [boost] request for interest: stable vector
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-09-19 08:53:17


Giovanni Piero Deretta skrev:
> On Wed, Sep 17, 2008 at 2:01 PM, Herve Bronnimann
> <hervebronnimann_at_[hidden]> wrote:
>> Joaquin: it just occurred to me (from the thought that your stable vector
>> could also be implemented as a wrapper on top of a vector of share ptrs
>> where the vector iteratir stores an index and reference to vector; it's not
>> as good impl as yours but also provides stable iters and refs) that you can
>> provide an additional fctn release() to "export" your object from vector,
>> with interface similar to erase and returning a shared ptr owning the node
>> and pointing to the object within.
>
> Or better, on top of ptr_vector. Export would return an auto_ptr.

I'm not certain this is possible if you also want iterator stability in
addition to reference stability for middle insertions. But I guess it is
a good question if iterator stability is important enough to have.

-Thorsten


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