How to handle nested structs when converting C headers?

bearophile bearophileHUGS at lycos.com
Wed Dec 11 15:49:03 PST 2013


Adam D. Ruppe:

> Well, you can if it is anonymous.
>
> struct Foo {
>     union {
>         struct { ubyte a; ubyte b; }
>         ubyte[2] arr;
>     }
> }
>
> That works in D, and it makes foo.a == arr[0] and foo.b == 
> arr[1];

Right :-) I like D structs.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list