Back to Basics: (Range) Algorithms in C++
Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 09:00· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard·
summary
Shows concrete before/after code: replace ad hoc loops with library calls like min_element, partition/stable_partition/rotate and accumulate versus reduce with execution::par. Demonstrates C++20 ranges, points out pitfalls (accumulate’s deduced init type, UB when passing wrong iterators), uses cpprreference and Godbolt with clang16 to compare assembly and proves no performance loss; mentions the library has 200+ algorithms and walks through working examples on a Vector of Persons so the changes actually compile and run.
AI-written summary · about
chapters (17)
- 0:00Welcome to track
- 0:46C++ algorithms intro
- 3:11Simpsons cast intro
- 6:26Manual loops problems
- 9:15Youngest with min_element
- 13:31C++20 ranges min_element
- 17:20Bart partitions children
- 20:51Refactor with partition
- 23:21C++20 ranges partition
- 26:49Stable partition ordering
- 29:21Summing ages with accumulate
- 34:23Loops vs algorithms perf
- 37:12Accumulate power complexity
- 41:51Parallelize with reduce
- 44:23Raw loops vs algorithms
- 47:18Learning resources
- 50:55Final takeaways and Q&A








