Can now use alias for collapsing multiple fields in nested structs

Lance Bachmeier no at spam.net
Sat Dec 28 21:55:48 UTC 2024


On Saturday, 28 December 2024 at 19:21:43 UTC, Walter Bright 
wrote:

> struct S {
>     int x;
>     T t;
>     alias ti = t.i;
> }
>
> void main() {
>     T t = T(1, 2);
>     S s;
>     assert(s.ti == 2);
> }
> ```

Thanks. I've wanted to do this for a long time.



More information about the Digitalmars-d mailing list