Trying to get type and name at compile time
Edwin van Leeuwen via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue May 24 12:48:33 PDT 2016
On Tuesday, 24 May 2016 at 18:44:45 UTC, ag0aep6g wrote:
>
> Seems to be a problem in ApplyLeft:
>
> ----
> import std.meta: AliasSeq, ApplyLeft;
> alias addType(T, string name) = AliasSeq!(T, name);
> alias addTypeInt = ApplyLeft!(addType, int);
> alias FullyInstantiated = addTypeInt!"foo";
> ----
>
> Fails with: "std/meta.d(1114): Error: cannot interpret int at
> compile time".
>
> I've filed an issue:
> https://issues.dlang.org/show_bug.cgi?id=16070
>
Thanks! I've worked around it for now with some recursion :)
> Using `is(...)` with an AliasSeq of only types is ok. But you
> can't use it when there's a non-type in the sequence.
That makes sense.
Thanks for the help, Edwin
More information about the Digitalmars-d-learn
mailing list