De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable
summary
C++ currently pays for exceptions and RTTI even when unused; proposal makes error reporting static by default, dynamic by opt-in via a new throws annotation that lets the compiler implement value-based exceptions with no heap allocation and no RTTI, preserving throw/catch semantics and automatic propagation. Library/allocator tweaks let allocators choose fail-fast vs throw so many functions become noexcept, cutting roughly 90% of exceptions seen today. For casts, a five-instruction downcast range check (CFI-style) gives fast, safe downcasts with ~1–1.5% binary impact in trials.
AI-written summary · about
chapters (12)
- 0:00Introduction and welcome
- 1:36Context for exceptions and RTTI
- 9:47Exception handling problems
- 20:07Zero overhead exception proposal
- 31:15Static exception handling details
- 44:42Reducing exceptions via contracts
- 50:53Memory allocation failure handling
- 1:09:57RTTI problems and solutions
- 1:17:11Static reflection for RTTI
- 1:25:37Efficient downcast proposal
- 1:27:48Future of C++ simplification
- 1:33:08Q&A
related talks
01h 04mKEYNOTE: De-fragmenting C++: Making exceptions more affordable and usable
53mThe Dawn Of A New Error
44mThe Dawn of a New Error
13mIs there life without RTTI or how to write your own dynamic_cast
01h 23mC++ Exceptions
01h 03m“What Could Possibly Go Wrong?: A Tale of Expectations and Exceptions”
22mLink-Time Optimization of Dynamic Casts in C++ Programs
01h 13mType safe C++ – LOL! :-)
