~/talk

Is there life without RTTI or how to write your own dynamic_cast

Talkat Hydra 2022 · 2022-06-02..06-26· [c-and-cpp]
links:none on file
slides:none on file

Shows a drop-in replacement for dynamic_cast that removes RTTI by putting a runtime tag into the base object and using either embed numeric tag in base or a macro to generate mappings and a third classof-style static check approach similar to Clang. Tests on an AST with randomized vectors of derived nodes show the custom casts run dramatically faster (dynamic_cast measured ~37× slower here). Works for single inheritance and saves binary/runtime cost but needs per-class boilerplate and fails for virtual inheritance or complex multiple-inheritance layouts.

AI-written summary · about

  1. 0:00Introduction
  2. 2:04Standard dynamic_cast problems
  3. 4:54Alternative with metadata
  4. 7:45Type-casting logic encapsulation
  5. 10:15Approach comparison and benchmarks
  6. 12:22Test results and conclusions
~/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.