Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-01-30 11:05:49


On 1/30/02 7:45 AM, "Synge Todo" <wistaria_at_[hidden]> wrote:

> This class might be used almost everywhere instead of std::vector,
> except that its capacity is fixed to a (small) integer specified by
> the second template parameter, and it throws an exception when its
> size exceeds its capacity.

The main question I'd ask is: Is this enough better than creating a vector
and reserving the desired capacity to justify creating an entire separate
class template?

> As for the name, I simply named this class as `array2', but presumably
> it's not a good name. 'resizable_array', `variable_array', or
> `fixed_capacity_vector' might be better. One possibility should be to
> combine the current boost::array class template and my new one into
> one class template, and to specialize depending on the third template
> parameter:

I like the name fixed_capacity_vector. I don't think it makes sense to
combine this with the array class template.

    -- Darin


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