Composable C++: Principles and Patterns
summary
Claims that matter: returning bool or int unlocks composition, and choosing return types (optional, collections) prevents awkward special cases. Examples show real success: a logger returning bool composes filters, fans and no-op sinks; a fallback allocator pattern composes allocators; Craig Reynolds’ steering behaviors sum force vectors for emergent flocking. At compile time concepts and type-lists enforce interfaces; separating traversal from computation with a transform-reduce over rose tree yields reusable hierarchical algorithms. These patterns are implemented and effective.
AI-written summary · about
chapters (26)
- 0:00Start
- 1:42What Do We Mean by Composable
- 3:05The Answer to What Is Composability
- 3:21Thesis
- 5:36Fundamentals
- 8:43Chain of Responsibility Pattern
- 14:46Steering Behaviors
- 15:54Separation Alignment and Cohesion
- 22:48Composable Functions
- 23:44Object Level Composability
- 26:07The Passthrough
- 27:01An Allocator Interface
- 33:00Poster Child for Composable Patterns
- 34:56Raw Conditions
- 37:02Are Concepts a Way To Achieve Type Safe Composability or Are They Orthogonal Concepts
- 38:16Object Orientation
- 38:28Well-Behaved Functions
- 39:27Compile Time Interlude
- 39:43Type List Manipulation
- 43:43Composite Pattern
- 44:07Object-Oriented Pattern
- 45:55Visitor Pattern
- 48:23Rose Tree
- 51:43Iterators
- 56:25Separating the When from the What and the Where
- 57:23Principled Approach to Composability
related talks
59mBuilding an Intuition for Composition
30mCompose All the Things
59mThe Power of Function Composition
26mThe Power Of Small Abstractions
23mComposability is to Software as Compounding Interest is to Finance
52mCompose Yourself! Different Kinds of Composables
01h 01mThe Power of Composition
28mCompose at Scale: Stop Unnecessary Recomposition
