union.sizeof

zabruk70 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 25 23:54:53 PDT 2017


On Sunday, 26 March 2017 at 06:45:13 UTC, ketmar wrote:
> yes. you have a typo in second `writefln`: S1 instead of S2. ;-)

thank you.
another question, related to my first post:

why size of S2.b1 and S2.b2 still 3, not 4?

am i right: then align applied to members, compiler not change 
size of members, just make padding, so CONTAINER size changes?

if so (because size of S2.b1 and S2.b2 still is 3 in my code),
then adding align(1) outside of union must not change zise of 
union, but size of some comainer more upper level.


More information about the Digitalmars-d-learn mailing list