Struct members align in DMD 2.060

Maxim Fomin maxim at maxim-fomin.ru
Sun Oct 7 06:03:59 PDT 2012


On Sunday, 7 October 2012 at 12:42:17 UTC, novice2 wrote:
>> and contain additional 2 trailing bytes
>
> But, imho, this is "unproperly" to include something outside 
> struct in its size.

Strictly speaking, nothing special is included, just empty bytes 
for optimization purposes. This behavior is similar to C/C++ 
where structures can have internal and trailing padding.


More information about the Digitalmars-d-learn mailing list