~/talk

Embracing CTAD

Talkat CppCon 2023 · on Wednesday, 2023-10-04· at 15:15· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard· [rust]
links:none on file
slides:none on file

Class template argument deduction gives concrete rules: compilers synthesize deduction guides from constructors and from a few special cases so template parameters are inferred for object initialization, aggregates and C++20 non-type parameters, and user-written deduction guides handle iterator/value extraction. Important gotchas include copy deduction guide forcing same-specialization results, no forwarding references (T&& in constructors does not behave like universal refs), and CAD turning off as soon as any template parameter is specified so implicit deduction guides can be disabled intentionally.

AI-written summary · about

  1. 0:00Introduction
  2. 2:15What is CTAD
  3. 4:24CTAD versus function deduction
  4. 6:32When CTAD works and when it doesn't
  5. 9:21CTAD benefits examples
  6. 11:50CTAD in C++17 and C++20
  7. 15:05How deduction guides are made
  8. 17:10Writing custom guides
  9. 20:27Copy deduction guide
  10. 23:14CTAD versus normal deduction
  11. 25:42Why partial CTAD fails
  12. 27:33CTAD pitfalls
  13. 31:33CTAD surprises and design
  14. 33:18Advice for users and vendors
  15. 35:04Q&A: Partial CTAD and disambiguation
  16. 36:49Q&A: Deduction guides for alias templates
  17. 37:55Q&A: Fixing user guides
  18. 39:02Q&A: Forwarding references in CTAD
  19. 40:07Q&A: Guide syntax design
  20. 41:10Q&A: Forwarding reference experiment
  21. 42:11Q&A: Non-type template parameters
  22. 42:55Q&A: Guide scope limits
  23. 43:37Q&A: Using tags for CTAD
  24. 44:19Q&A: Disambiguating containers
  25. 45:02Closing remarks
~/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.