Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-10-09 11:49:45


AMDG

Simonson, Lucanus J <lucanus.j.simonson <at> intel.com> writes:

> If you have a legacy prism type CPrism and it is conceptually a
> rectangle with the additional z axis data you can pass it into an API I
> have defined that expected a rectangle:
> apiExpectingRectangle(RectangleConcept<CPrism>::mimic(myCPrism));
> Or you can pass it into an API expecting a prism:
> apiExpectingPrism (RectangularPrismConcept<CPrism>::mimic(myCPrism));
> Or you can pass it into an API that is overloaded to expect either a
> rectangle or a prism:
> apiExpectingRectangleOrPrism(RectangleConcept<CPrism>::mimic(myCPrism));
> apiExpectingRectangleOrPrism(RectangularPrismConcept<CPrism>::mimic(myCP
> rism));
> and get different behaviors out of that api depending on which type you
> told it to model the data as.

This doesn't allow for concept refinement. For example if
I have a point concept and a runtime-indexable concept
I can't create a runtime-indexable point concept
just by combining the two.

In Christ,
Steven Watanabe


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