On Tuesday, 4 February 2014 at 09:39:48 UTC, evilrat wrote:
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
oops sorry, it's for another people.
what are you trying to achieve? when passing types as template
args it is still types, so again typeof should give you type for
variables(in such cases there is typeof), otherwise type is type.
also, afaik it is not possible to store types in tuple, but i
think you can store variables in tuple and retrieve their types
at runtime