~/talk

Pragmatic Type Erasure: Solving OOP Problems w/ Elegant Design Pattern

Talkat CppCon 2014 · on Tuesday, 2014-09-09· at 16:45· Pascal· [rust]
links:none on file
slides:none on file

Claims that proper type erasure solves lifetime, ownership and multiple-interface OOP problems without losing performance and compares hand-rolled implementations to boost type erasure with measured timings. Demonstrates small buffer optimization, copy‑on‑write and ref_wrapper tricks to avoid heap churn, shows where heap allocations remain, and delivers a code generator using libclang that emits erased types from real headers. Source, slides and runnable examples appear on the conference GitHub and the implementations validate the performance and usability claims.

AI-written summary · about

  1. 0:00OUTLINE
  2. 0:27THE IMPORTANCE OF VALUES
  3. 1:48EQUATIONAL REASONING
  4. 2:56WHY POLYMORPHISM?
  5. 5:50(PROBLEMS WITH) INHERITANCE AS RUNTIME POLYMORPHISM
  6. 10:48A QUICK CASE STUDY: WIDGETS AND LAYOUTS
  7. 12:09(PROBLEMS WITH) TEMPLATES AS COMPILE- TIME POLYMORPHISM
  8. 17:10MAKING MAGIC HAPPEN
  9. 29:16USE A COPY-ON-WRITE WRAPPER Instead of always copying our type erased objects.only copy them when they are mutated
  10. 31:26INTEGRATE COPY-ON-WRITE INTO ERASED TYPES Remove one set of allocations on construction by applying copy on write directly to the handle member.
  11. 31:43APPLY THE SMALL BUFFER OPTIMIZATION
  12. 37:26CAVEATS
  13. 40:46Archetype input
  14. 41:50Erased type output
~/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.