Boost logo

Boost :

From: Michael B. Edwin Rickert (panda_at_[hidden])
Date: 2005-05-28 04:19:21

AlisdairM wrote:

>Michael B. Edwin Rickert wrote:
>>I hope I've got the right list here (first time poster), my apologies
>>if I don't :-).
>>boost::array fails a ContainerConcept check in 1.32 due to it's lack
>>of a const_pointer typedef:
>Note that boost::array is not a (standard) conforming container anyway!
>Array, by design, has a fixed number of elements. The container
>concept requires the ability to add and remove elements.
I wasn't aware of this, although I was aware of some of the other
reasons it's not a standard conforming container from the documentation
(although in retrospect, "size() is allways constant" did seem odd).

>Likewise, the pointer and const_pointer requirements are part of
>allocator support. As boost::array does not support allocators, it
>should not need these elements and any tests requiring them is flawed.
True, I suppose I should implement my own concepts for this (e.g.
IterateableConcept and HasASizeConcept for my instances). That said, one
of the goals of Boost.Array to emulate (as close as possible without
violating some of the other goals) a standard container... Then again,
if one relies on such a ContainerConcept check and then proceeds to use
an allocator with the type, I suppose adding this could ruin some
perfectly good checks if one tried to pass a boost::array - although one
could argue that's a missing feature in Boost's ContainerConcept...

Oh well, I got to practice using some tools I have not used before, so
no time wasted :-).


Boost list run by bdawes at, gregod at, cpdaniel at, john at