~/talk

Programming for Warm Days: Avoiding Dangerous Conversions

Talkat CppNorth 2022 · 2022-07-18..07-20· [c-and-cpp]
links:none on file
slides:none on file

Live codes a small C++ library that replaces raw doubles with a templated strong type for units, using temperature traits and a single neutral unit so conversions route through Celsius. Implements constexpr temperature_cast, user‑defined literals (_C/_F/_K), conversion constructors and a concepts‑based close‑enough comparator. Default values use freezing points per unit, performance aims to match macros via inlining, and the demo compiles and runs after fixing overload ambiguities — conversions and comparisons work as intended.

AI-written summary · about

  1. 0:00Introduction and context
  2. 4:26The problem with raw types
  3. 7:07Designing the traits system
  4. 10:32Implementing the conversion
  5. 16:13Building the temperature class
  6. 21:55Conversion constructor
  7. 28:21User-defined literals
  8. 34:42Implementing comparisons
  9. 42:11Handling numeric precision
  10. 49:20Finalizing the class
  11. 52:04Safety and concluding remarks
~/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.