Partial application with a C++ lambda?
EDIT: I use curry below, but have been informed this is instead partial application. I've been trying to figure out how one would write a curry function in C++, and i actually figured it out! #include <stdio.h> #include <functional> template< class Ret, class Arg1, class ...Args > auto curry( Ret f(Arg1,Args...), Arg1 arg ) -> std::function< Ret(Args...) > { return [=]( Args ...args ) { return f( arg, args... ); }; } And i wrote a version for lambdas, too. template< class Ret, class Arg1, class ...Args > auto curry( const std::function<Ret(Arg1,Args...)>& f, Arg1 arg ) -> std::function< Ret