I know the size of an empty class is defined by the standard to be non-zero. It is usually 1 byte on most implementations.
But, does the C++ standard specify the minimum possible size of an object? Is it logical to assume that as per standard the size of an empty class object will be atleast 1 byte.
I know the size of an empty class is defined by the standard to
Share
The minimum size of an object is zero (§1.8/5). However, complete objects must always have non-zero size, and that size must be at least one.
Base class subobjects of empty types can have zero size thanks to what is known as EBCO, the empty base class optimization.