Boost logo

Glas :

Re: [glas] introducing the storage concept, a first interface specification

From: Patrick Kowalzick (patrick.kowalzick_at_[hidden])
Date: 2005-01-25 09:00:22

Hi Toon,

>> Ok. But this means there is a static size information needed. Is a
>> static size_type size() {}
>> like defined in boost.array enough? The implementation in ublas is
>> slightly different, but IMO not "clean".
> For doing this kind of thing we need an 'associate type' 'N' like in the
> mtl-2 array concept which specifies the static size and that is 0 if the
> array has a dynamic size.
> See

this is similar to the constants defined in "ublas::bounded_vector" and
"ublas::bounded_matrix". I think they are named "max_size", "max_size1" and
"max_size2". But the solution in MTL looks nicer indicating as well if the
array has a static size or not.

Shouldn't there be a N and a max_N?
if (N == 0) the size is flexible
if (max_N == 0) the maximum size is flexible

But, must it be guranteed that a vector can be resized to max_N or
max_size() without errors?