prvalue
suggest changeA prvalue (pure rvalue) expression is an expression which lacks identity and whose evaluation is typically used to initialize an object. Since C++17 that initialization is direct: the prvalue is not a temporary that is then moved from. These include, but are not limited to:
- Expressions that represent temporary objects, such as
std::string("123"). - A function call expression that does not return a reference
- A literal (except a string literal - those are lvalues), such as
1,true,0.5f, or'a' - A lambda expression
The built-in addressof operator (&) cannot be applied on these expressions.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents