|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-07-10 13:23:31
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
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk