[conv.rval] (original) (raw)

7 Expressions [expr]

7.3 Standard conversions [conv]

7.3.5 Temporary materialization conversion [conv.rval]

A prvalue of type T can be converted to an xvalue of type T.

This conversion initializes a temporary object ([class.temporary]) of type T from the prvalue by evaluating the prvalue with the temporary object as its result object, and produces an xvalue denoting the temporary object.

T shall be a complete type.

[Note 1:

If T is a class type (or array thereof), it must have an accessible and non-deleted destructor; see [class.dtor].

— _end note_]

[Example 1: struct X { int n; };int k = X().n; — _end example_]