~/talk

Symmetry in Code - Should We Care?

Talkat Meeting C++ 2024 · 2024-11-14..11-16· [frontend-architecture]
slides:none on file

Claims that matter: C++ equality rewriting changes (see P2468R2) actually suppress rewriting when an operator!= suppresses rewriting, which explains a concrete bug demoed: an implicit char conversion causes a pointer comparison instead of value equality. Experimenting by commenting out operator!= makes comparisons behave as expected; adding explicit* surfaces a compiler diagnostic that reveals the rewriting rule. Practical takeaway: audit and avoid accidental implicit conversions and unintended operator overloads, or remove/declare them explicitly so equality semantics are deliberate.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Symmetry in nature
  3. 3:59Symmetry in math
  4. 8:15Symmetry in code
  5. 10:26Code complexity
  6. 14:46Guard patterns
  7. 17:35Left-leaning code
  8. 19:01Arithmetic for performance
  9. 22:17Equality operations
  10. 22:59C++ strict weak ordering
  11. 25:04Defining equality
  12. 31:07Operator overloading pitfalls
  13. 36:30Symmetry in types
  14. 42:51Q&A
  15. 59:17Summary
~/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.