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?
Also where to learn more about tuples in D. Info in TDPL is sketchy.
Regards
- Puneet
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);
}