Structured binding declaration (like in C++)

Ali Çehreli acehreli at yahoo.com
Thu Oct 14 13:39:13 UTC 2021


On 10/13/21 1:02 PM, Vindex wrote:
> Is there a decomposition for tuples and other data structures?
> 
> For example,
> ```
> auto t = tuple(1, "2");
> auto (x, y) = t; // or auto (x, y) = t.expand;
> ```

No, D does not have this (yet?).

I thought there was a special case for tuples with foreach but I can't 
remember it now. (?)

Ali


More information about the Digitalmars-d-learn mailing list