Files
2025-10-25 03:02:53 +03:00

1.0 KiB

[conv.rval]

7 Expressions [expr]

7.3 Standard conversions [conv]

7.3.5 Temporary materialization conversion [conv.rval]

1

#

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; // OK, X() prvalue is converted to xvalue — end example]