3 ms·
Additionally, the "r" and "l" may lead one to incorrectly guess that rvalues and lvalues are related to their position in an expression. But alas, they aren't;
by koito17 11mo ago
Additionally, the "r" and "l" may lead one to incorrectly guess that rvalues and lvalues are related to their position in an expression. But alas, they aren't; there are lvalues that cannot appear in the left-hand side of an expression.
- mzajc 11mo agoAre you referring to consts? Besides those, I can't really think of a counterexample.
- tonyarkles 11mo agohttps://en.cppreference.com/w/cpp/language/value_category.html https://en.cppreference.com/w/cpp/language/value_category.ht... There’s some weird examples here involving functions, function pointers, template parameters, and a few other things.
- nutjob2 11mo ago> cannot appear in the left-hand side of an expression Do you mean assignment?