Interesting work on packing tuple layout

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Jun 15 13:50:07 UTC 2020


On Monday, 15 June 2020 at 13:34:18 UTC, Max Samukha wrote:
> On Sunday, 14 June 2020 at 23:30:03 UTC, Andrei Alexandrescu 
> wrote:
>> It's really easy if members in the layout are given internal 
>> names that include information about the original index.
>
> You can construct a list of member aliases in the original 
> order and then 'alias this' that:

typeof(t[0]) works fine, but reading or assigning to such a field 
will not work. For example:

void main() {
     Tuple!(byte, int, short) t;
     writeln(t[0]);
}

> test.d(57,23): Error: need `this` for `__value_field_2` of type 
> `byte`



More information about the Digitalmars-d-announce mailing list