Let’s look how to implement this in C++14. First, lets start by implementing a pipe_closure class to handle a function with just one parameter: template<class F> struct pipe_closure : F { template<class... Xs> pipe_closure(Xs&&... xs) : F(std::forward<Xs>(xs)...) {} }; template<class T, class F> decltype(auto) operator|(T&& x, const pipe_closure<F>& p) { return p(std::forward<T>(x)); }