operator yields the number of bytes
occupied by a non-potentially-overlapping object of the type
of its operand.
The operand is either an expression,
which is an unevaluated operand ([expr.prop]
), or a parenthesized
operator shall not be applied to an expression that
has function or incomplete type,
to the parenthesized name of such
types, or to a glvalue that designates a bit-field.
The result of sizeof
applied to any of the narrow character types is 1.
The result of
applied to any other fundamental
In particular, sizeof(bool)
, and sizeof(wchar_t)
— end note
When applied to a reference type, the result is the size
of the referenced type.
When applied to a class, the result is the number of bytes in an object
of that class including any padding required for placing objects of that
type in an array.
The result of applying sizeof
potentially-overlapping subobject is
the size of the type, not the size of the subobject.
When applied to an array, the result is the total number of bytes in the
This implies that the size of an array of n
times the size of an element.