Daily bit(e) of C++ | Standard layout types
Daily bit(e) of C++ #390, Standard layout types in C++.
Standard layout class (struct, union) types offer three important benefits:
offsetof only works for standard layout types
pointer to a standard layout type and its first member are pointer-interconvertible
if a standard layout union contains standard layout structs, the common initial sequence can be accessed even through non-active members