lvalue

suggest change

An lvalue expression is an expression which has identity, but cannot be implicitly moved from. Among these are expressions that consist of a variable name, function name, expressions that are built-in dereference operator uses and expressions that refer to lvalue references.

The typical lvalue is simply a name, but lvalues can come in other flavors as well:

struct X { ... };

X x;         // x is an lvalue
X* px = &x;  // px is an lvalue
*px = X{};   // *px is also an lvalue, X{} is a prvalue

X* foo_ptr();  // foo_ptr() is a prvalue
X& foo_ref();  // foo_ref() is an lvalue

Additionally, while most literals (e.g. 4, 'x', etc.) are prvalues, string literals are lvalues.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Value categories:
* rvalue
* xvalue
* lvalue

Table Of Contents
8 Arrays
11 Loops
39 Streams
51 Unions
56 Lambdas
58 Value categories
60 SFINAE
62 RAII
67 Sorting
84 RTTI
87 Scopes
104 Profiling
107 Recursion
117 Iteration
125 Alignment
134 Semaphore
136 Debugging
139 Mutexes
142 decltype