[class.temporary]
Код: Выделить всё
The materialization of a temporary object is generally delayed as long as possible in order to avoid creating unnecessary temporary objects. [Note: Temporary objects are materialized:
(2.1) — when binding a reference to a prvalue (9.4.3, 7.6.1.3, 7.6.1.6, 7.6.1.8, 7.6.1.10, 7.6.3),
(2.2) — when performing member access on a class prvalue (7.6.1.4, 7.6.4),
(2.3) — when performing an array-to-pointer conversion or subscripting on an array prvalue (7.3.2, 7.6.1.1),
(2.4) — when initializing an object of type std::initializer_list from a braced-init-list (9.4.4),
(2.5) — for certain unevaluated operands (7.6.1.7, 7.6.2.4),
(2.6) — when a prvalue that has type other than cv void appears as a discarded-value expression (7.2).
Код: Выделить всё
If the operand is a prvalue, the temporary materialization conversion (7.3.4) is applied.
Код: Выделить всё
sizeof(Foo{})
Подробнее здесь: https://stackoverflow.com/questions/783 ... izeof-oper