~/talk

“Operator Overloading: History, Principles and Practice”

Talkat CppCon 2018 · 2018-09-23..09-28· [compilers-and-language-design]
slides:none on file

History and concrete rules for operator overloading, with C++17 fold expressions and the new C++20 three-way (spaceship) comparison, showing where it generates comparisons and where it currently hurts performance (string equality vs lexicographical_compare_3way). Covers chrono time_point/duration as an affine space example, operator/ for path concatenation, Boost SML’s multi-operator DSL, and a case-insensitive string implemented via lexicographical_compare_3way. Advises preferring free functions, keeping associativity and completeness, avoiding &&/|| overloads, and supplying specialized == when needed for performance.

AI-written summary · about

  1. 0:00Introduction
  2. 0:58Operators in C
  3. 2:22Why use operators
  4. 4:02Convention change
  5. 5:11Mathematical notation
  6. 6:37More Effective C
  7. 9:30Motivation
  8. 10:03Equality
  9. 10:39Associativity
  10. 11:06Law of the excluded middle
  11. 11:39Nicetohaves
  12. 12:52Distributive Law
  13. 15:09Fine Spaces
  14. 15:50Chrono
  15. 16:51Why overload conventionally
  16. 17:27Leverage outside users
  17. 18:07Fold expressions
  18. 20:56WriteFold
  19. 22:05Spaceship
  20. 22:57Comparison Categories
  21. 27:26Strong Ordering
  22. 28:30Partial Ordering
  23. 29:01Last Years SCM Challenge
  24. 36:00The problem with this approach
  25. 40:23Where are we
  26. 41:56DSLs
  27. 43:22Chrono Dates Example
  28. 44:58One Operator DSL
  29. 45:43Multi Operator DSL
  30. 51:20Futures
  31. 55:42Operator Functions
~/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.