Compare TypeTuple element with another type

Tudor Berariu via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 03:25:37 PDT 2014


Is it possible to compare at compile time an element from a 
TypeTuple with another type?

This code fails:

     alias T = Tuple!(int, bool);
     static assert(is(T[0] == int));


     Error: static assert  (is(Tuple!(int, bool)[0] == int)) is 
false


Tudor


More information about the Digitalmars-d mailing list