--- Comment #3 from Simen Kjaeraas <> 2010-11-08 07:00:15 
PST ---
I'm not sure what it is that confuses you. D allows constraints to be placed on
template parameters not only by means of template constraints, but also
isExpression-like patterns in the parameter list:

class A {}
class B : A {}

template isAnA( T : A ) {
    enum isAnA = true;

static assert( isAnA!B );

This also works for more complex type constraints:

template extractTupleArgs( T == Tuple!U, U... ) {
    alias U extractTupleArgs;

static assert( is( extractTupleArgs!( Tuple!int ) == int ) );

It does however not work for complex type constraints where the template is not

template dissectTemplate( T == U!V, V... ) {
    alias U tmpl;
    alias V args;

And it is this last case I want covered.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to