Why doesn’t C++ make the structure tighter?
Class and struct members are required by the standard to be stored in memory in the same order in which they are declared. So in your example, it wouldn’t be possible for d to appear before b. Also, most architectures prefer that multi-byte types are aligned on 4- or 8-byte boundaries. So all the compiler … Read more