~/talk

Back to Basics: Understanding Value Categories

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
name:Ben Saks
links:none on file
slides:none on file

Explains why lvalues, prvalues and xvalues matter for code generation and errors, shows that class prvalues need storage while scalar prvalues often don’t, and proves when the compiler creates temporaries (the temporary materialization conversion). Demonstrates pitfalls with ++ and overloaded operators, why references require addressable objects, and how move semantics work (use std::move to produce an xvalue). Notes that return statements commonly convert named objects to xvalues and that swap benefits from explicit moves.

AI-written summary · about

  1. 0:00Intro
  2. 0:27Value Categories
  3. 1:15Lvalues and Rvalues Have Evolved
  4. 5:23Data Storage for Rvalues
  5. 7:43Literals
  6. 9:48What About the Result?
  7. 11:38Data Storage for Expressions
  8. 13:12Rvalues of Class Type
  9. 16:09Non-Modifiable Lvalues
  10. 18:48Reference Types
  11. 20:41References and Overloaded Operators
  12. 25:37"Reference to Const" Parameters
  13. 27:18Why Use "Reference to Const"?
  14. 27:51References and Temporaries
  15. 32:41Two kinds of Rvalues
  16. 35:10Mimicking Built-In Operators
  17. 40:49Move Operations
  18. 43:58Rvalue References as Lvalues
  19. 45:50Lvalues as Xvalues
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.