Boost logo

Boost :

Subject: Re: [boost] Provisional Boost.Generic and Boost.Auto_Function (concepts without concepts)
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2010-12-14 07:41:17

On Tue, Dec 14, 2010 at 7:11 AM, Matt Calabrese <rivorus_at_[hidden]> wrote:

> Anyway, I've said more than I wanted to right now. I didn't expect this
> thread to be bumped -- I was hoping to post a new thread about all of this
> once everything was polished and up in the sandbox.

Actually, since this thread has started going again, I've hit some
complicated issues regarding concept maps that I'd hope someone could help
out with. In particular, there is one very troubling situation I've
encountered. Imagine three concept types: a "base" concept, a "left" concept
which is a refinement of "base", and a "right" concept, which is also a
refinement of "base". A programmer creates a type called "foo" and wishes to
make a concept map for "left" and also a concept map for "right". Because
"left" is a refinement of "base", making a concept map for "left" implicitly
makes a concept map for "base". Similarly, since "right" is a refinement of
"base", the same thing happens. So the issue is, if someone now writes a
function that requires a "base", which concept map is to be used? Should
this be a compile-time error? If so, how could this possibly be safely
resolved (does anyone know how this was handled in concept proposals)?

Assuming it should be a compile-time error, would it be enough to just
require a third concept map to be written, explicitly for base, or perhaps a
way to specify explicitly that "right" should be used? If so, what happens
when a function takes a "left" and that function references the parts of the
concept map that are used to satisfy the requirements of "base"? I'd imagine
that it would use the "left" concept map, but that means that a different
concept map for "base" would be used depending on whether the function took
a "base" or a "left" or a "right", which seems to be very wrong. Am I
expressing this problem correctly? Does anyone see an obvious resolution
that I've missed?

-Matt Calabrese

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