A possible enhancement related to is()

bearophile bearophileHUGS at lycos.com
Tue Jan 28 18:29:59 PST 2014


In std.typecons there is this template, that tells if a given 
type is any tuple, this means if it's the instantiation of a 
Tuple with any argument type:


template isTuple(T)
{
     static if (is(Unqual!T Unused : Tuple!Specs, Specs...))
     {
         enum isTuple = true;
     }
     else
     {
         enum isTuple = false;
     }
}


Do you think it's worth a D enhancement request to be able to 
write that code like this?

enum isTuple(T) = is(Unqual!T Unused : Tuple!Specs, Specs...);

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list