Boost logo

Glas :

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

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2005-01-20 08:42:06

Patrick Kowalzick wrote:

>>>> I think we should respect the dimensions (or size) of the vectors
>>>> and therefore I think operands first need to be properly dimensioned
>>>> before using them in an operation. Thus adding 2 vectors requires
>>>> that both vectors have the same dimension and thus respecting the
>>>> laws of vector fiels.
>>> I meant a different thing. If a vector could not be resized _and_ the
>>> size is known at compile time (possible for stack based), there is an
>>> information (concept?) needed, to enable compile-time error checking.
>> I don't think it needs a concept. The error checking you are referring
>> to can be done by using a BOOST_STATIC_ASSERT.
> 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.