I came across the initial sequence concept. Serching through the Standard for initial sequence
phrase gives only 3 results and they don't give a definition.
Section N3797::9.5/1 [class.union]
:
If a standard-layout union contains several standard-layout structs that share a common initial sequence (9.2), and if an object of this standard-layout union type contains one of the standard-layout structs, it is permitted to inspect the common initial sequence of any of standard-layout struct members;
I wish to look at an example which is demostrated that quote.
I believe it's talking about this kind of thing:
It's saying that it's OK to access either
U.S.a
orU.T.x
and that they will be equivalent. Ditto forU.S.b
andU.T.y
of course. But accessingU.T.f
after settingU.S.c
would be undefined behaviour.