~/talk

Overengineering max(a, b) Mixed Comparison Functions, Common References & Rust Lifetime Annotations

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [software-architecture]
links:none on file
slides:none on file

Implements a fully generic max/min/clamp that handles mixed-type comparisons, fixes unsafe int/unsigned behavior with a TC_common_type that rejects unsafe conversions, and avoids dangling rvalue references by introducing a TC_temporary marker plus macros for forwarding, invoke and lifetime counting. Uses heavy template metaprogramming and Boost preprocessor macros, composes projections safely, and preserves zero-cost calls in common cases. Prototype is used in production libraries and the slides and code are on GitHub.

AI-written summary · about

  1. 0:00Overengineering max(a,b)
  2. 1:09Generic max function
  3. 3:17Strict weak order
  4. 7:32Mixed comparisons
  5. 11:46Integer comparison pitfalls
  6. 15:59Reference handling
  7. 26:12Clamp and projection safety
  8. 34:20Generic composition
  9. 52:10Lifetime annotations
  10. 1:04:09Language design critique
  11. 1:08:01Conclusion
~/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.