Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-07-11 08:24:57


On Wed, 11 Jul 2001, Peter Schmitteckert wrote:
> > stable_vector is a vector whose's elements do not change memory locations
> > when the vector resizes (or otherwise changed by an insert, etc.). The
> > motivation for this is that many people get burned by the instability of
> > std::vector and they can't use std::list instead because they need the
> > constant time random access. The implementation of stable_vector would
> > store pointers to each object instead of storing objects in an array.
>
> Why not storing the elements in a list, while having a vector of iterators
> (or simple pointers) pointing to the list entries, providing an interface
> to the list members instead of the iterator/pointer.
>
> Have I missed something ? Is there a hidden problem ?

The list will cost more storage. What advantage does storing the elements
in a list have?

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate, IU B'ton email: jsiek_at_[hidden]
 Summer Manager, AT&T Research phone: (973) 360-8185
----------------------------------------------------------------------


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