Projections
summary
A quick demo shows that C++ ranges::sort with a projection fixes a real bug: a typo in a predicate produced wrong ordering, switching to a projection that selects the sort key immediately yields the correct order. The talk claims projections let algorithms accept member accessors directly, so operations like sort by field become simpler and you can replace find_if with a direct find-by-key. Demo code compiles and the projection-based fixes work.
AI-written summary · about
related talks
57mRange Algorithms, Views and Actions: A Comprehensive Guide
58mMore C++ Ranges Please
01h 04mBetter Code: Data Structures
01h 34mAn Overview of Standard Ranges
05mC++ Sorting Pitfalls, UB & Type Conversion Explained
01h 02mC++20 Ranges in Practice
54mThrowing Tools at C++ Ranges
01h 06mC++20 Ranges in Practice
