~/talk

Evolving a Nice Trick

Talkat CppCon 2021 · on Friday, 2021-10-29· at 12:00· online· [rust]
links:none on file
slides:none on file

A concrete evolution: a generic "close enough" comparator is implemented from C++98 to C++20, starting with tag dispatching and hand‑rolled type traits that compile on ancient toolchains, moving through std::type_traits and enable_if, adding a constexpr abs and compile‑time tests, then using variable templates and generic lambdas, and ending with if consteval and concepts plus common_type so mixed float/integral cases work. The claim is tangible (one function becomes a constrained, debuggable overload), the tools are real, static_asserts prove it at compile time, and the implementation is small, efficient and testable.

AI-written summary · about

  1. 0:00Introduction
  2. 2:27The problem
  3. 5:15The goal
  4. 10:25Nonintrusive solutions
  5. 13:17Functions
  6. 14:30Traits
  7. 19:03Comparison
  8. 21:05Changes
  9. 27:52Algorithms
  10. 31:42Generics
  11. 35:32Values
  12. 39:17Recap
  13. 40:41Simon Says 20
  14. 41:54Concepts
  15. 51:16Questions
~/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.