Appendix B
Value Categories
Expressions are a cornerstone of the C++ language, providing the primary mechanism by which it can express computations. Every expression has a type, which describes the static type of the value that its computation produces. The expression 7
has type int
, as does the expression 5 + 2
, and the expression x
if x
is a variable of type int
. Each expression also has a value category, which describes something about how the value was formed and affects how the expression behaves.
B.1 Traditional Lvalues and Rvalues
Historically, there were only two value categories: lvalues and rvalues. Lvalues are expressions that refer to actual values stored in memory or in a machine register, such as the expression x
where x
is the ...
Get C++ Templates: The Complete Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.