Anonymous structure

Adrian Matoga via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 19 00:10:29 PDT 2016


On Monday, 18 April 2016 at 15:59:11 UTC, Steven Schveighoffer 
wrote:
> I wonder if it makes a difference for layout. So for example:
>
> struct T
> {
>    struct
>    {
>       int x;
>       ubyte y;
>    }
>    ubyte z;
> }
>
> If there is padding inserted between y and z.

There isn't. T.init.z.offsetof - T.init.y.offsetof == 1.




More information about the Digitalmars-d-learn mailing list