How exactly does Tuple work?

Paul Backus snarwin at gmail.com
Sat Nov 7 18:31:18 UTC 2020


On Saturday, 7 November 2020 at 18:02:26 UTC, Jan Hönig wrote:
> I have a simple question.
> How exactly does Tuple work?
>
> In detail, I am interested in expand and opSlice.

A Tuple is a struct whose members are generated by type sequence 
instantiation:

https://dlang.org/articles/ctarguments.html#type-seq-instantiation

Indexing and slicing are implemented with `alias expand this`, 
which causes `t[i]` to be lowered to `t.expand[i]`.


More information about the Digitalmars-d-learn mailing list