~/talk

Back to Basics: C++ Move Semantics

Talkat CppCon 2022 · 2022-09-11..09-16· [rust]
slides:none on file

Explains concrete rules and worked examples: why mark noexcept move ctors, how to write efficient move constructor and move assignment using std::exchange/unique_ptr so no allocation occurs, how vector reallocation can force copies unless moves are noexcept, when std::move destroys caller-owned state vs when to use std::forward in templates, what a moved‑from object can legally hold, and how ref‑qualifiers let rvalue overloads avoid extra copies — includes code patterns that demonstrate each outcome.

AI-written summary · about

  1. 0:00Start
  2. 11:37Temporary Object
  3. 18:37L and R Value References
  4. 22:36Mental Model
  5. 25:02Copy Operations
  6. 26:27The Move Operations
  7. 27:55Swapping Pointers
  8. 28:55Move from Object
  9. 30:39Types of Move Semantics
  10. 31:16Non-Destructive Move
  11. 38:29Allocation Strategy
  12. 47:28Make Functions
  13. 55:44Ref Qualifiers
  14. 56:22Append
  15. 58:39Introducing Ref Qualifiers
~/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.