P
Pete Becker
That is not the reason: just as with char, there is no reason to
require the alignment of an empty class to be a specific multiple of
anything but one.
My guess is that the requirement is there to allow compilers to always
have objects of class-type have a "convenient" size. I must admit,
that I can't see the reason for that but then I'm not a compiler
writer. All compilers I know have size of 1 for empty classes and
structs.
It's not a compiler convenience. If a class has 0 size, then elements
of an array of that type all have the same address. That breaks the
fundamental rule that distinct objects of the same type have different
addresses.