Reduce: From functional programming to C++17 Fold expressions
summary
C++17 introduces fold expressions that let variadic packs reduce in place, enabling compile‑time sums and logical quantifiers; the presenter shows a working compile‑time sum and an on_each printer, and builds boost reduce (expression‑template folds) to fold arbitrary callables, do function composition and carry, and produce an iterator/scan via lazy evaluation. Implementation notes: limited built‑in operator set, identity elements for empties, careful move/ref preservation, non‑constexpr lambdas block full compile‑time use, and the code is a home project not a commercial product.
AI-written summary · about
chapters (5)
related talks
01h 09mFunctional Programming in C++
50mThinking Functionally in C++
59mCombining C++17 Features
01h 10mThe Three Little Dots and the Big Bad Lambdas
58mThe Imperatives Must Go! [Functional Programming in Modern C++]
01h 01mApplicative: The Forgotten C++ Functional Pattern
55mMonadic Operations in C++23
59mCombining C++17 Features
