
Optimizing Member Alignment
A class’s size can change simply by playing with the order of its members’ declaration. For example: struct A{ bool a; int b; bool c;}; // sizeof (A) == 12 On my machine, sizeof (A) equals 12. This result might seem surprising because the total size of A’s members is