Boost logo

Boost :

Subject: Re: [boost] request for interest: stable vector
From: joaquin_at_[hidden]
Date: 2008-09-17 08:55:58


Herve Bronnimann escribió:
> 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.

Yes, this seems doable, but what use cases are you envisioning?

> Importing would work also in my design but not in yours,
> unless you import a pair of ptr, object (but that exposes your impl in
> the interface, not good)...

AFAICS in your design it would also expose the implementation, since you
can't import
a shared_ptr<T> as is, you'd have to provide something like a
shared_ptr<stable_vector_node<T> >.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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