C++0x Concepts - Dead?

Christian Kamm kamm-incasoftware at removethis.de
Wed Jul 15 23:26:45 PDT 2009


> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
>> Yes. Constraints determine the list of candidate template declarations,
>> but do not participate in the partial ordering of candidates to determine
>> the 'best' match.

Nick Sabalausky wrote:
> Pardon my ignorance, but...umm...what?

Example:

class C {}

void foo(T)() if(is(T : Object)) {}
void foo(T)() if(is(T : C)) {}

void bar(T : Object)() {}
void bar(T : C)() {}

void main() {
  foo!(C)(); // error: ambiguous, (both are candidate, no ordering)
  bar!(C)(); // ok, (both are candidate, second bar more specialized)
}



More information about the Digitalmars-d-announce mailing list