~/talk

Back to Basics: Move Semantics (part 2 of 2)

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

Explains that forwarding references (T&& in a deducing context) become lvalue references for lvalue args and rvalue references for rvalues via reference collapsing, so use std::forward vs std::move to conditionally cast; unguarded std::move from a forwarding parameter is a bug. Shows make_unique and overload pitfalls where a template forwarding constructor wins unexpectedly, demonstrates ambiguous overload resolution with six reference overloads, warns that moving a named return disables RVO, and advises avoid overloading on forwarding references and remove reference qualifiers for type traits.

AI-written summary · about

  1. 0:00Introduction to move semantics
  2. 7:22What are forwarding references
  3. 13:12Perfect forwarding with std::forward
  4. 21:16Overloading pitfalls with forwarding
  5. 30:20Common forwarding mistakes
  6. 40:13Return value optimization
  7. 47:35Anti-patterns and core guidelines
  8. 51:18Q&A session
~/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.