This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

29
cppdraft/conv/rval.md Normal file
View File

@@ -0,0 +1,29 @@
[conv.rval]
# 7 Expressions [[expr]](./#expr)
## 7.3 Standard conversions [[conv]](conv#rval)
### 7.3.5 Temporary materialization conversion [conv.rval]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L734)
A prvalue of type T can be converted to an xvalue of type T[.](#1.sentence-1)
This conversion initializes a temporary object ([[class.temporary]](class.temporary "6.8.7Temporary objects")) 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[.](#1.sentence-2)
T shall be a complete type[.](#1.sentence-3)
[*Note [1](#note-1)*:
If T is a class type (or array thereof),
it must have an accessible and non-deleted destructor;
see [[class.dtor]](class.dtor "11.4.7Destructors")[.](#1.sentence-4)
— *end note*]
[*Example [1](#example-1)*: struct X { int n; };int k = X().n; // OK, X() prvalue is converted to xvalue — *end example*]