This is probably trivial or impossible Code Introspection...
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Sep 19 22:30:37 PDT 2015
On Sun, Sep 20, 2015 at 05:21:03AM +0000, WhatMeWorry via Digitalmars-d-learn wrote:
[...]
> Thanks. But now I have an even more fundamental problem. I keep
> getting a FieldNameTuple is not defined. But I've clearly got the
> import statement. I even copied the example from Phobos verbatim:
>
> import std.traits;
>
> struct S { int x; float y; }
> static assert(FieldNameTuple!S == TypeTuple!("x", "y"));
You need to use is(...) when comparing types:
static assert(is(FieldNameTuple!S == TypeTuple!("x", "y")));
HTH,
--T
More information about the Digitalmars-d-learn
mailing list