Need help understanding Tuple
bearophile
bearophileHUGS at lycos.com
Tue Dec 18 04:43:14 PST 2012
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 using the standardized name helps
readability.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list