$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Russell Hind (rh_gmane_at_[hidden])
Date: 2005-04-23 02:08:35
Bo Peng wrote:
>>Can you, instead of storing objects in your vector, allocate the objects on
>>the heap and store pointers (or shared pointers) to them? In this case you
>>would not have to worry about the vector moving it's elements around -- it
>>would be just moving pointers.
>
>
> This may be a good solution. The only problem is that find(...) will
> be looking for identical pointers instead of identical objects. Easy
> to fix though.
>
if nothing is even going to change in the container, do you know the
number of items at compile time? If so, you could perhaps use boost::array.
Cheers
Russell