D's greatest mistakes

Simen kjaeraas simen.kjaras at gmail.com
Mon Nov 29 14:40:30 PST 2010


Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:

> Why not do the same for templates? Something like this:
>
> void foo(A, B, C)(A a, B b, C c)
> constraint
> {
>     isDynamicArray(a);
>     isIterable(a);
>
> }

Consider:

void foo( A )( A a )
constraint {
   isBar!A;
}


void foo( B )( B a )
constraint {
   isQux!B;
}

Which error message should I show?

-- 
Simen


More information about the Digitalmars-d mailing list