3 ms·
As the article points out, the original meaning of the "l" in "lvalue" indeed was "left". However, in C and C++ there are lvalues that cannot appear as the left
by Sharlin 15y ago
As the article points out, the original meaning of the "l" in "lvalue" indeed was "left". However, in C and C++ there are lvalues that cannot appear as the left-hand-side of assignment (const variables, arrays, functions) and rvalues that can (in C++ you can say, for example, C() = C(); for some class C because the assignment operator is just a member function, and member functions can be called for rvalues.)
What more accurately grasps the definition of lvalues and rvalues in C and C++ standards is that the former have an individual identity (concretely, they are permitted as the operand of the address-of operator &) and the latter don't. (Except don't get me started on the fact that in C++ one can overload operator&...)