~/talk

Back to Basics: Generic Programming in C++

Talkat CppCon 2024 · on Wednesday, 2024-09-18· at 09:00· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard· [rust]
links:none on file
slides:none on file

Explains concrete C++ template rules: templates belong in headers, substitution vs instantiation behaves differently, member functions of class templates are instantiated only when used, and SFINAE means substitution failure is not an error so overload sets can drop candidates. Covers type, non‑type, and template template parameters, C++20 Concepts/requires and enable_if patterns, partial/full specialization gotchas (safe_sizeof example), and practical guidelines: prefer constrained templates, make function template parameters deducible, avoid specializing function templates, and keep overloads and APIs simple.

AI-written summary · about

  1. 0:00Generic programming intro
  2. 1:12What generic programming means
  3. 5:06C++ templates as GP
  4. 6:55Templates in header files
  5. 9:45Template parameter types
  6. 16:26Substitution and instantiation
  7. 23:17Template argument matching
  8. 29:39Calling function templates
  9. 31:03Constraining template args
  10. 34:15Writing class templates
  11. 35:59Specializing templates
  12. 41:41Workarounds for unspecializable
  13. 42:43C++ declaration syntax
  14. 47:21Deducing template args
  15. 49:30Avoiding overload sets
  16. 52:02Choosing function template args
  17. 53:28Specializing function templates
  18. 55:15Summary and advice
~/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.