Trying to get type and name at compile time
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue May 24 08:09:43 PDT 2016
On Tuesday, 24 May 2016 at 15:01:33 UTC, Edwin van Leeuwen wrote:
> // I expected AliasSeq!(double,"x")???
> pragma(msg,test); // tuple((double), "x")
What Phobos calls AliasSeq is called tuple inside the compiler.
They are the same thing, just different names.
> static assert(is(test == AliasSeq!(double,"x")));
AliasSeq is not comparable as a type. You can test the individual
pieces of it (`is(test[0] == double) && test[1] == "x"`) or wrap
it in a struct or something.
More information about the Digitalmars-d-learn
mailing list