|
Boost : |
From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2003-10-10 06:56:45
Pavol Droba <droba_at_[hidden]> wrote in
news:20031010111823.GO2433_at_[hidden]:
> You are not quite right.
>
> Container concept (Std.23.1) does not define an interface to manage
> the collection elements. It merely defines a ways how to access these
> elements.
> There are other refinements of the Container Concept, like Sequence
> (Std.23.2) and Associative Container (Std.23.3), that also define ways
> how to add/remove elements.
> So given the Container Concept, array has almost all the properties
> needed (except for consruction and destruction) to treat it as a
> container.
"almost all" means we "almost model" the concept <g>
Double checking, you are right that it is constructors that give the
problem. Specifically (for my example) the post-condition on default
constructor that size() == 0, something that can *never* be true for a
valid array (or wrapper)
Either way, if array is a model of the concept embodied in
container_traits, then this is a different concept than in the standard.
Without CVS access I cannot get a proper look at the topic of this thread
to see if this is a more widely useful concept though (as I suspect <G>)
I'm also not clear what it means for something to 'almost' model a concept.
I don't handle fuzzy logic well! Is this a normal use of concepts/models?
Naively I would expect to see another (simpler) concept introduced that
standard-container refines, but this could be my muddling
concept/refinement with class/inheritence.
AlisdairM
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk