Type safe C++ – LOL! :-)
summary
Argues that wrapping primitives as distinct types both prevents bugs and can improve clarity and performance, showing a tiny safe_type template (with CRTP) used at work to turn ints and strings into distinct RequestID/ReceiverID types and stop about 20 bugs, plus a serialization pattern for 24‑bit slot counts. Covers two open libraries (Jonathan Miller’s and Fluent’s strong-type utilities), warns about inheriting mutating string APIs, demonstrates an affine space model (positions vs displacements), and measures no overhead — sometimes fewer instructions.
AI-written summary · about
chapters (9)
- 0:00Introduction to type safety
- 5:28War stories from C++ code
- 17:34Building a simple strong type library
- 29:50Liskov substitution principle trap
- 39:15Exploring strong type libraries on GitHub
- 48:52Affine spaces in C++ types
- 1:03:19Performance impact of strong types
- 1:06:35Summary and key takeaways
- 1:09:07Q&A session








