Partial application in C++ Here is my code:

#include &lt;iostream&gt;
#include &lt;type_traits&gt;
#include &lt;functional&gt;
#include &lt;tuple&gt;

namespace meta {

template &lt;bool B, bool... Bs&gt;
struct all_true {
   enum : bool { value = B &amp;&amp; all_true&lt;Bs...&gt;::value }; 
};

template &lt;bool B&gt;
struct all_true&lt;B&gt; {
    enum : bool { value = B };
};

template &lt;typename Fn, typename... Args&gt;
struct is_partial_t_nothrow_ctor {
    enum : bool {
        a = std::is_nothrow_constructible&lt;Fn, Fn&amp;&amp;&gt;::value,
        b = all_true&lt;std::is_nothrow_constructible&lt;Args, Args&amp;&amp;&gt;::value...&gt;::value,
        value = a &amp;&amp; b
    };
};

}

template &lt;typename Fn, typename... Args&gt;
class partial_t {
private:
    Fn fn_;
    std::tuple&lt;Args...&gt; args_;

    template &lt;std::size_t... Is, typename... ExArgs&gt;
    decltype(auto) op_parens_impl(std::index_sequence&lt;Is...&gt;, ExArgs&amp;&amp;... ex_args) {
        fn_(std::forward&lt;Args&gt;(std::get&lt;Is&gt;(args_))...,
            std::forward&lt;ExArgs&gt;(ex_args)...);
    }

    template &lt;typename... ExArgs&gt;
    decltype(auto) op_parens_impl(ExArgs&amp;&amp;... ex_args) {
        return op_parens_impl(
            std::index_sequence_for&lt;Args...&gt;(), std::forward&lt;ExArgs&gt;(ex_args)...);
    }

public:
    partial_t(Fn&amp;&amp; fn, Args&amp;&amp;... args)
        noexcept(meta::is_partial_t_nothrow_ctor&lt;Fn, Args...&gt;::value)
        : fn_(std::forward&lt;Fn&gt;(fn)), args_(std::forward_as_tuple(args...))
    {}

    template &lt;typename... ExArgs&gt;
    decltype(auto) operator()(ExArgs&amp;&amp;... ex_args)
        // noexcept(?)
    {
        return op_parens_impl(std::forward&lt;ExArgs&gt;(ex_args)...);
    }
};

template &lt;typename Fn, typename... Args&gt;
auto partial(Fn&amp;&amp; fn, Args&amp;&amp;... args)
    noexcept(meta::is_partial_t_nothrow_ctor&lt;Fn, Args...&gt;::value)
{
    return partial_t&lt;Fn, Args...&gt;(std::forward&lt;Fn&gt;(fn), std::forward&lt;Args&gt;(args)...);
}


Test code:

void test(int x, int y, int z) {
    std::cout &lt;&lt; "my first number is " &lt;&lt; x &lt;&lt; std::endl;
    std::cout &lt;&lt; "my second number is " &lt;&lt; y &lt;&lt; std::endl;
    std::cout &lt;&lt; "my favorite number is " &lt;&lt; z &lt;&lt; std::endl;
}

int main() {
    auto f = partial(test, 5, 3);
    f(7);
}


which outputs:

my first number is 5
my second number is 3
my favorite number is 7


The function partial takes a function object as its first parameter and then a number of arguments. It returns a function object which binds these arguments to the input function as its first parameters, then the rest of the arguments are provided later when this partial function is invoked.
Looks like you are trying to re-invent std::bind.

#include &lt;functional&gt;
#include &lt;iostream&gt;


void test(int x, int y, int z) {
    std::cout &lt;&lt; "my first number is " &lt;&lt; x &lt;&lt; std::endl;
    std::cout &lt;&lt; "my second number is " &lt;&lt; y &lt;&lt; std::endl;
    std::cout &lt;&lt; "my favorite number is " &lt;&lt; z &lt;&lt; std::endl;
}

int main() {
    // Add placeholders for non bound values.
    using namespace std::placeholders;

    // Note the last argument is a place holder.
    auto f = std::bind(test, 5, 3, _1);

    // Now you can call and pass a placeholder argument.
    f(7);
}


As a side note: This is the kind of reason why underscore is reserved for the implementation to allow for little shortcuts like this without having to re-invent the language.

Rather than using recursive templates. I would have used an iterative aproach. With constexpr you can do quite a lot that is evaluated at compile time.

struct all_true
{
    template&lt;typename... T&gt;
    static bool constexpr isTrue(T... b)
    {   
        bool result = true;
        for(auto const&amp; a: {b...})
        {   
            result = result &amp;&amp; a;
        }   
        return result;
    }   
};

// Then your code looks like this:
b = all_true::isTrue(std::is_nothrow_constructible&lt;Args, Args&amp;&amp;&gt;::value...),