~/talk

C++ Function Templates: How Do They Really Work?

Talkat CppCon 2018 · 2018-09-23..09-28· [compilers-and-language-design]
links:none on file
slides:none on file

Claim: function templates are blueprints not functions, compilers synthesize signatures and instantiate definitions only as needed from calls. Crucial surprising rule: explicit specializations do not participate in overload resolution — they reuse names and are considered only after overload resolution picks a candidate. Practical advice: avoid explicit function-template specializations; prefer ordinary overloads or a helper class-template with operator() indirection. Notes on direction: library work moves toward customization-point objects and core proposals explore abbreviated template syntax (auto + requires) for C++20.

AI-written summary · about

  1. 0:00Introduction and thanks
  2. 1:29What is a function template?
  3. 10:30Function templates vs specializations
  4. 20:10Template argument deduction
  5. 27:12Partial ordering of templates
  6. 39:47Explicit specializations pitfalls
  7. 43:37Future of function templates
  8. 53:52Resources and next steps
  9. 54:34Q&A session
~/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.