~/talk

Universal/Forwarding References

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [typescript]
slides:none on file

Concrete rules and gotchas about T&&, auto&& and std::forward determine whether code moves, copies or fails to compile: template-parameter rvalue references become universal (forwarding) references with special deduction and reference-collapsing rules; using them plus forwarding yields perfect forwarding while preserving value category; range-based for and C++20 views require universal references to avoid adding const; decltype(auto) and lifetime-extension details show when returns must be by value or reference.

AI-written summary · about

  1. 0:00Universal forwarding references intro
  2. 2:08Lifetime extension of temporaries
  3. 4:13Auto & ampersand with universals
  4. 7:24History of C++ value categories
  5. 13:46Lvalues xvalues prvalues explained
  6. 18:05Rvalue references and move semantics
  7. 25:52Perfect forwarding in templates
  8. 30:05Universal vs forwarding debate
  9. 34:09Universal reference rules
  10. 38:52Auto && as universal reference
  11. 42:14Range-based loops and universals
  12. 45:08Specifying types for universals
  13. 47:18Generic rvalue references
  14. 50:09Returning values with auto decltype
  15. 53:21Views and const correctness
  16. 55:51Universals as default type
  17. 57:17Teaching universal references
  18. 58:40Q&A
~/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.