Can now use alias for collapsing multiple fields in nested structs

Derek Fawcus dfawcus+dlang at employees.org
Sun Dec 29 01:23:17 UTC 2024


On Saturday, 28 December 2024 at 19:21:43 UTC, Walter Bright 
wrote:
> It's commonplace in C and C++ to use something like:
>
> ```
> #define ti t.i
>
> s.ti
> ```
> as a shortcut for cutting through layers of struct declarations.

It was... That particular preprocessor game largely became 
unnecessary once we gained C11 anonymous structs and unions.  
Which is a good thing, as it can occasionally induce some nasty 
effects.

I've not had to use it in newly designed things since then. I've 
only had to use it when interacting with old code.

DF


More information about the Digitalmars-d mailing list