~/talk

Virtual templated methods

Talkat Core C++ 2023 · 2023-06-05..06-07· [compilers-and-language-design]
links:none on file
slides:none on file

Claim: C++ cannot have no virtual templates that mix template and virtual dispatch, so alternative patterns are required. Options shown: require types to inherit a type-erased base object (fast, one extra virtual call); write a templated front-end that serialize[s] to std::string or std::stringstream and forward to a virtual method; generate per-type derived wrappers that forward many virtual calls; or use a runtime reflection map of function pointers (works in production but adds boilerplate, lookup cost and copy/move hazards). All examples live on Godbolt.

AI-written summary · about

  1. 0:00Introduction and disclaimers
  2. 1:46Use case for virtual templates
  3. 4:44Option one inheritance based
  4. 8:58Option two templated reduction
  5. 13:24Option three combined approach
  6. 16:19Option four reflection
  7. 25:39Conclusion and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.