Hacker News new | past | comments | ask | show | jobs | submit login

oh okay, understood. frankly I don't have an airtight understanding of the c++ standards and I would have considered your expression to be a dereference operation on an lvalue, but not an lvalue itself. ty for the explanation!



I'm sure there are some complex exceptions, but as a starter, you can think of lvalues as "anything you can assign to" (the l basically stands for left, as in, "can appear on the left of an assignment"). So, if you have something like `foo(val) = 10`, then `foo(val)` is an lvalue.


One of the complications is that if you take an l-value and const-qualify it, it is still an l-value (but not a modifiable l-value.)

https://www.geeksforgeeks.org/lvalue-and-rvalue-in-c-languag...


They are not mutually exclusive. When a pointer has been set to point to an lvalue, dereferencing it yields that lvalue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: