DIP32: Uniform tuple syntax

bearophile bearophileHUGS at lycos.com
Fri Mar 29 06:03:19 PDT 2013


Adam D. Ruppe:

> auto a = {"foo":12, "bar":"twelve"};
>
> int a_foo = a.foo;
> string a_bar = a[1];
>
>
> The std.typecons Tuple!() can do this kind of thing too.

I think Tuple!() has them mostly because there is no handy syntax 
to unpack them.

Tuples with field names are records.

Bye,
bearophile


More information about the Digitalmars-d mailing list