Are there any guarantees for unions that contain a wrapped type and the type itself?
问题 Can I put a T and a wrapped T in an union and inspect them as I like? union Example { T value; struct Wrapped { T wrapped; } wrapper; }; // for simplicity T = int Example ex; ex.value = 12; cout << ex.wrapper.wrapped; // ? The C++11 standards only guarantee save inspection of the common initial sequence, but value isn't a struct . I guess the answer is no , since wrapped types aren't even guaranteed to be memory compatible to their unwrapped counterpart and accessing inactive members is only