The standard defines when two types are layout-compatible. But, I don\'t see anywhere in the standard what the consequences are when two types are layout-compat
The standard does define one specific case where layout compatibility matters: in union
s. If two members are layout-compatible, and one of them is the active union
member, then you may access that object through pointers/references to any layout-compatible member of that union
. This is a consequence of the "common initial sequence" rule.