Reading nested calls inside out — multiply(div(minus(10, 2), 4), 2) — is painful. A pipeline reads left to right, in the order things actually happen. The whole trick is one overloaded operator and tiny objects that carry an operation and its argument.
Make this expression work: 10 | minus(2) | div(4) | multiply(2) == 4. Each helper returns a small operation object; operator| applies it to the number on the left. This is the same pattern as ranges pipelines in C++20.
The operation object needs two things: which operation and the right-hand argument. The left argument arrives later — in operator|.
A captureless lambda converts to a plain function pointer — handy for storing "which operation" without std::function.
Hit Submit (or ⌘/Ctrl + ↵) — test results will show up here.