Get struct template types

evilrat evilrat666 at gmail.com
Tue Feb 4 01:39:47 PST 2014


On Tuesday, 4 February 2014 at 09:30:22 UTC, ed wrote:
> Hi,
>
> given a struct like so:
>
> struct S(alias N, T) {...}
>
> is there a way to get the template parameters of S? Something 
> like:
>
> S.typetuple[0] == N,
> S.typetuple[1] == T
>
> I've had a look at std.typecons and std.typetuple but I don't 
> see what I'm missing something and cannot see a way to do the 
> above.
>
> Thanks,
> ed

typeof(N).stringof will return type of N as string
for details read http://dlang.org/expression.html


More information about the Digitalmars-d-learn mailing list