~/talk

Back to Basics: Templates (part 1 of 2)

Talkat CppCon 2020 · 2020-09-14..09-18· [c-and-cpp]
slides:none on file

Covers concrete template patterns: function, class and method templates; shows a constexpr size(T (&)[N]) that preserves array size with std::array example preserving size and demonstrates specialization for double to compare floats. Uses C++ Insights to show instantiations and alias templates like char_array = std::array<char,N>. Argues that replacing size parameters with std::span to avoid code bloat prevents many instantiations, and shows type_traits plus constexpr if and concepts to select compile-time paths and produce clearer errors.

AI-written summary · about

  1. 0:00Introduction
  2. 0:25Welcome and conference
  3. 1:12Speaker background
  4. 2:16Generic programming
  5. 4:56Template fundamentals
  6. 7:34Types of templates
  7. 8:46Template parameters
  8. 10:39Function template example
  9. 13:27Min function template
  10. 15:04Compiler insights
  11. 17:36Template specialization
  12. 20:55Class templates
  13. 25:40Template instantiation
  14. 31:34Class template deduction
  15. 36:42Method templates
  16. 41:01Template inheritance
  17. 46:09Alias templates
  18. 48:47Efficient template usage
  19. 52:13C++20 span
  20. 55:52Template guidelines
  21. 58:44Type traits
  22. 1:00:15Concepts in C++20
  23. 1:00:45Compile-time evaluation
  24. 1:04:24Closing 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.