Consider the following declarations of a pair of related structs. The descendant class adds no member variables, and the only member function is a constructor that does noth
BEWARE! While this is almost certainly true in your compiler, this is not guaranteed by the standard to work.
At least add if (sizeof(Derived) != sizeof(Base)) logAndAbort("size mismatch between Derived and Base"); check.
In case you were wondering, the compilers for which this is safe are one to one in which the size doesn't change. There was something left behind in the standard that allows derived classes to be non-contiguous with base classes. In all cases where this happens, the size must grow (for obvious reasons).