~/talk

Breaking Dependencies: Type Erasure - The Implementation Details

Talkat NDC TechTown 2022 · 2022-08-29..09-01· [c-and-cpp, software-architecture]
slides:none on file

Shows two concrete ~20 line implementations for owning and non‑owning wrappers that use a templated constructor plus a nested base/model hierarchy, placement new into a fixed buffer, and a virtual clone/move for copying. Demonstrates a Small Buffer Optimization that avoids allocations and yields about a 10% speedup in the presenter’s bench (25k ops over ~2.5k random shapes), and an alternative manual virtual dispatch via function pointers that performs differently on GCC versus Clang. Practical code choices for copy/move semantics and storage policies are given.

AI-written summary · about

  1. 0:00Type erasure introduction
  2. 1:55Type erasure vs inheritance
  3. 7:18External polymorphism basics
  4. 14:43Value wrapper encapsulation
  5. 18:15Copy operations and clone
  6. 27:10Performance with small buffer
  7. 31:06No dynamic allocations
  8. 38:56Buffer size via templates
  9. 41:45Storage policy challenges
  10. 43:51Lightweight virtual dispatch
  11. 51:18Type erasure summary
  12. 52:03Q&A
~/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.