I have a standard-layout union that has a whole bunch of types in it:
union Big {
Hdr h;
A a;
B b;
C c;
D d;
E e;
F f;
};
I can find no wording in n4296 (draft C++14 standard) which would make this legal. What is more, I cannot even find any wording that given:
union Big2 {
Hdr h;
A a;
B b;
C c;
D d;
E e;
F f;
};
we can reinterpret_cast
a reference to Big
into a reference to Big2
and then use the reference. (Note that Big
and Big2
are layout-compatible.)