~/talk

C++ Class Template Argument Deduction - History, Uses, & Enabling it for Classes

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

C++17 CTAD explains why the language now fills class template arguments for you, how the compiler generates implicit vs explicit deduction guides, and when to write guides yourself (iterator_traits and allocator_traits examples, std::vector demos). It shows tools and practices: run compile‑fail tests, use static_assert same_type to check results, and constrain guides with Concepts or SFINAE. It reports that CTAD reduces boilerplate, that implicit guides are compiler‑generated and not editable, and that C++20 adds alias/aggregate/inherited‑ctor CTAD.

AI-written summary · about

  1. 0:00Intro
  2. 0:26About Me
  3. 2:10What is Class Template Argument Deduction
  4. 4:37Class Template Argument Definition
  5. 4:57Default Class Template Argument
  6. 5:12Template Argument Deduction
  7. 6:47Template Argument Deduction History
  8. 7:19Class Template Argument Deduction
  9. 9:06Why are you doing this
  10. 9:32What does CTAD do
  11. 9:50CTAD fills in the template arguments
  12. 11:15CTAD makes make functions less necessary
  13. 12:40How does it work
  14. 13:10Deduction
  15. 15:16Deduction Guide Example
  16. 16:21How does this work
  17. 17:43Its hard to understand
  18. 18:23Definition of Vector
  19. 18:45Constructors to Vector
  20. 26:56Iterators
  21. 27:43Template Parameters
  22. 29:09Allocators
  23. 29:42Values
  24. 29:57Default Values
  25. 30:57Compiler Time
  26. 32:01Writing Deduction Guides for Classes
  27. 35:52Compile Fail Tests
  28. 36:10Add Deduction Guides
  29. 36:25Existential Questions
  30. 39:33assertSameType
  31. 40:00assertSameType Example
  32. 41:38SharedPointer Example
  33. 43:15Can You Edit Deduction Guides
  34. 45:25Shared Pointer
  35. 46:40Implicit Deduction Guides
  36. 47:11Alias Template Deduction Guides
  37. 48:09Aggregate Template Deduction Guides
  38. 48:40Inheritance of Deduction Guides
  39. 49:23Summary
  40. 50:53Misdeduction
  41. 52:05Unreasonable Strings
  42. 52:49Cons
  43. 53:05Ambiguity
  44. 54:36Questions
~/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.