On Friday, 1 August 2014 at 10:25:39 UTC, Tudor Berariu wrote:
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

Tuple is not a type tuple, it's a runtime tuple. TypeTuple is located in std.typetuple. Use that and your code will work.

Reply via email to