Functional Composable Operations with Unix-Style Pipes in C++
summary
Prototype implements a C++11 generic pipe operator that composes any T with a Callable, shows a real Kafka init chain using libRdKafka and unique_ptr for RAII, adds std::optional unwrapping overloads for C++17, and uses C++20 Concepts to avoid ranges so std::ranges code and the new operator coexist. It also emulates monadic and_then/transform behavior like the proposed C++23 APIs. Overload-resolution surprises force concept tweaks; the implementation works but incurs added compile-time cost and a global-operator collision risk.
AI-written summary · about
chapters (17)
- 0:00Start
- 3:34Functional Composable Operations
- 7:20Ranges
- 11:13Initialization
- 15:42Type Conversion with Templates
- 16:30Member Functions
- 19:45Kafka Config
- 20:54Move the Operator to a Generic Namespace
- 21:24Calling Function Templates
- 22:13Chain Functions Taking Multiple Arguments
- 22:49Operator Mismatch
- 24:02Std Bind
- 32:04Std Optional
- 41:48Invokable
- 45:39Std Optional Monadic Operations
- 56:26Transform
- 59:57Conclusion
related talks
55mMonadic Operations in C++23
42mAwaiting for the ranges: C++17
01h 01mApplicative: The Forgotten C++ Functional Pattern
53mProduct Types for C++2x
01h 09mFunctional Programming in C++
01h 05mC++11 in the Wild: Techniques from a Real Codebase
01h 02mC++20 - My Favorite Code Examples
54mHow to rangify your code
