http://digitalmars.com/d/2.0/attribute.html#align

"align by itself sets it to the default, which matches the default member alignment of the companion C compiler."
OK!

"align(Integer): Integer specifies the alignment which matches the behavior of the companion C compiler when non-default alignments are used"
I don't really understand that sentence.

"struct S
{   align(4) byte a;    // placed at offset 0
    align(4) byte b;    // placed at offset 1
}"

So those align(4)s are completely useless since the default alignment is chosen anyways?



"align (1) struct S
{   byte a;     // placed at offset 0
    byte[3] filler1;
    byte b;     // placed at offset 4
    byte[3] filler2;
}"

This is just as I would expect but this leaves no chance to specify alignment for individual members, does it?

Reply via email to