Curry a C++ lambda?
===

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(Args...) >
    {
        return [=]( Args ...args ) { return f( arg, args... ); };
    }
    
The tests:

    int f( int x, int y )
    {
        return x + y;
    }
    
    int main()
    {
        auto f5 = curry( f, 5 );
        auto g2 = curry( std::function<int(int,int)>([](int x, int y){ return x*y; }), 2 );
        printf("%d\n",f5(3));
        printf("%d\n",g2(3));
    }

Yuck! The line initializing g2 is so large that i might as well have curried it manually.

    auto g2 = [](int y){ return 2*y; };

Much shorter. But since the intent is to have a really generic and convenient curry function, could i either (1) write a better function or (2) somehow my lambda to implicitly construct an std::function? I fear the current version violates the rule of least surprise when f is not a free function. Especially annoying is how no make_function or similar-type function that i know of seems to exist. Really, my ideal solution would just be a call to std::bind, but i'm not sure how to use it with variadic templates.

PS: No boost, please.