Tuple DIP
Timon Gehr
timon.gehr at gmx.ch
Sat Jan 13 18:22:37 UTC 2018
On 13.01.2018 19:07, Timothee Cour wrote:
> https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md#proposal-4-unpacking-assignments
> ```
> (a, b) = t;
> // shouldn't it be:
> auto (a, b) = t;
> ```
> ?
>
No, but there was a mistake in the code that explains the confusion.
It should be:
(int, string) t = (1, "2");
int a;
string b;
(a, b) = t; // note: a and b exist already, now a==1, b=="2"
I have fixed it now. Proposal 4 is about allowing tuple literals of
lvalues as the left hand side of an assignment.
More information about the Digitalmars-d
mailing list