alignment of struct

TJB broughtj at gmail.com
Fri Mar 14 10:18:53 PDT 2014


On Friday, 14 March 2014 at 00:07:12 UTC, bearophile wrote:
> Justin Whear:
>
>> It did change a few versions ago (not sure exactly when).  Try 
>> adding
>> `align(1):` inside the structs before the members.
>
> Yes it's a recent change, the align() on outside is the 
> alignment of the whole struct, and the align inside is the 
> alignment of the single field relative to the start of the 
> struct or the precedent field.
>
> align(1) struct Foo {
>     align(1) double x;
> }
>
> Bye,
> bearophile

Thanks!  That was it.

TJB


More information about the Digitalmars-d-learn mailing list