Functional C++ for Fun & Profit
summary
Shows concrete techniques for writing expression-oriented, mostly-immutable C++ using C++11/17 features: replace statements with ternary or immediately-invoked lambdas, use a Builder phase to produce immutable domain objects, implement a string/string_builder pair (with string_view-like alternatives) to regain safe reference-counted sharing, and build persistent structures — a red‑black persistent set with ~10% insert overhead and a persistent HAMT that reduces depth from ~24 to ~5 for 15M items and approaches hash‑map speed; also supplies a value_or helper and pipe-style optional composition.
AI-written summary · about
chapters (12)
- 0:00Introduction to functional C++
- 2:13Defining functional programming
- 5:32From statements to expressions
- 8:31Achieving expression orientation
- 12:21Functional approach to loops
- 16:52The builder pattern
- 22:53Fast and safe string handling
- 28:18Persistent data structures
- 33:52Red-black trees and persistence
- 44:57Hash array mapped trees
- 51:00Monads and functional composition
- 1:01:25Summary and conclusion








