Re: Need help understanding Tuple

2012-12-18 Thread John Chapman
On Tuesday, 18 December 2012 at 11:06:12 UTC, d coder wrote: Greetings Somebody please help me understand why we need the Tuple template in the following code. Does not __traits(getAttributes, foo.a) return a tuple? So what is the Tuple template doing here? Converting a tuple to a tuple? Al

Re: Need help understanding Tuple

2012-12-18 Thread bearophile
d coder: template Tuple(T...) { alias T Tuple; } enum Bar; class Foo { @Bar int a; } void main() { Foo foo = new Foo; alias Tuple!(__traits(getAttributes, foo.a)) tp; pragma(msg, tp); } As first step, don't use that Tuple, use std.typetuple.TypeTuple instead. It's the same, but us