prvalue

Download c++ eBook

Example

A prvalue (pure-rvalue) expression is an expression which lacks identity, whose evaluation is typically used to initialize an object, and which can be implicitly 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 has 1, true, 0.5f, or 'a'
  • A lambda expression

The built-in addressof operator (&) cannot be applied on these expressions.

Stats

Contributors: 6
2016-08-20
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook