~/talk

“Avoiding Disasters with Strongly Typed C++”

Talkat CppCon 2018 · 2018-09-23..09-28· [software-architecture]
links:none on file
slides:none on file

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

  1. 0:00Intro
  2. 0:55When do we want bugs to be found
  3. 5:23Add constructor
  4. 6:12Put into template
  5. 6:57Performance 1
  6. 11:02Lets make an int!
  7. 12:17Using my_int
  8. 12:57Get the underlying value
  9. 13:26Combining types
  10. 14:27Implementing in type_safe
  11. 15:04Our own skill
  12. 16:37Use the skill
  13. 23:31How does chrono work?
  14. 24:18std::ratio
  15. 25:13Our own length
  16. 26:38Add operations
  17. 27:07Different underlying types
  18. 28:30Different ratios
  19. 29:49Use of length
  20. 30:45Dimensions
  21. 32:15Use of dimension aware length
  22. 32:51Physical quantities
  23. 33:51Example multiplication
  24. 35:11Other units
  25. 35:54Voltage, current, power
  26. 37:46Conclusions
~/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.