|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-10 17:02:31
This looks like a sub-component of something John Potter and I have toyed
with, on-and-off, for quite some time. This class could use an
indirect_iterator from the iterator adaptors library. If you're willing to
make it a little more challenging, you could think of a generalized adaptor
which stores pointers to elements, but gives an interface as though the
elements themselves were stored. This would at least be useful for deque
also.
-Dave
----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, July 10, 2001 2:23 PM
Subject: [boost] challenge: stable_vector
>
> Here's a simple challenge that would save lots of people many headaches.
>
> Create a stable vector class. Here's a short description/motivation.
>
> 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.
> Unlike std::vector, the elements of the vector would not be in contiguous
> memory. Also stable_vector would use more space than a std::vector and
> element access would be slower.
>
> Cheers,
> Jeremy Siek
>
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
>
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk