“Avoiding Disasters with Strongly Typed C++”
summary
C++ typedefs only alias types; using tiny wrapper structs and templates produces NamedType and type_safe style strong types that the compiler enforces. Examples show identical optimized assembly to plain ints, tag-based CRTP patterns, and custom “mixed” operators for price×amount and position−position→offset. A chrono-inspired length/ratio system uses std::ratio to add differing units and dimensions, and the talk surveys boost::units. Claim: strong types catch mix-up bugs with no runtime cost; caveat: mixing debug/release or differing ABIs can break.
AI-written summary · about
chapters (26)
- 0:00Intro
- 0:55When do we want bugs to be found
- 5:23Add constructor
- 6:12Put into template
- 6:57Performance 1
- 11:02Lets make an int!
- 12:17Using my_int
- 12:57Get the underlying value
- 13:26Combining types
- 14:27Implementing in type_safe
- 15:04Our own skill
- 16:37Use the skill
- 23:31How does chrono work?
- 24:18std::ratio
- 25:13Our own length
- 26:38Add operations
- 27:07Different underlying types
- 28:30Different ratios
- 29:49Use of length
- 30:45Dimensions
- 32:15Use of dimension aware length
- 32:51Physical quantities
- 33:51Example multiplication
- 35:11Other units
- 35:54Voltage, current, power
- 37:46Conclusions








