~/talk

Constructing Generic Algorithms: Principles and Practice

Talkat CppCon 2020 · 2020-09-14..09-18· [software-architecture]
slides:none on file

Starts from a raw recursive divide‑and‑conquer: pick mid, partition in place around the expected value, recurse on the half with the gap, and show the cost sums to linear time (≈2n). Tail recursion becomes a loop; pointer arithmetic is replaced by std::distance and std::next so the algorithm accepts a forward iterator and preserves random‑access speed. Type requirements surface: values vs difference types (durations work; time_point needs a fine‑space diff), tests for empty/even/odd, and a return choice named min_absent. Ranges add composable views but not new fundamentals.

AI-written summary · about

  1. 0:00Introduction
  2. 0:56Algorithm importance
  3. 2:34Case study problem
  4. 4:46Initial approaches
  5. 8:04Divide and conquer
  6. 11:24Iterative algorithm
  7. 14:14Testing and refactoring
  8. 19:20Generic design principles
  9. 23:47Refining for iterators
  10. 27:20Standard library limitations
  11. 30:43Strength reduction
  12. 33:33Const-correctness
  13. 37:25Naming and documentation
  14. 39:03Type requirements
  15. 41:51Affinitive space types
  16. 44:32Ranges and composition
  17. 46:20Alternative formulations
  18. 48:20Epilogue
~/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.