~/talk

Using Modern C++ to Eliminate Virtual Functions

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

Claims that as of C++20 no statically linked program needs virtual functions, and replaces runtime polymorphism with C++20 Concepts and CTAD. Implements alternatives: constrained templates, a tuple of vectors for multi-type storage, and std::variant for runtime choices, plus a same_as-fold to check allowed types. Builds a device-manager example that removes virtual base pointers and works but costs larger TUs, bigger binaries and compile time, some runtime costs for variant, ordering caveats, and shows a reported 2–4× microbenchmark speedup in favorable cases.

AI-written summary · about

  1. 0:00Introduction
  2. 4:04Binding interfaces
  3. 7:03Usage
  4. 9:01Polymorphic Types
  5. 10:45Virtual Implementation
  6. 11:11NonVirtual Implementation
  7. 23:01Storing Multiple Types
  8. 23:27Properties
  9. 24:25Vectors
  10. 27:21Implementations
  11. 29:10Review
  12. 29:57Downsides
  13. 32:28Bold Claim
  14. 33:08Devirtualization
  15. 38:08Comments
  16. 43:33Practice Task
~/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.