C++ value categories
In C++, all expressions have two properies: a type and a value category. Value categories are a little complicated to understand and have gone through a few changes with time.
lvalue and rvalue
Lvalue stands for locator value
. An lvalue is something that occupies a memory location. But… doesn’t everything occupy a memory location? Not necessarily. Let’s look at a simple expression:
1
int number = 7;