Any Solution to Unpack a Vector to Function Arguments in C++?
<p>I am actually thinking of something similar to the '*' operator in python like this:</p>

<pre><code>args = [1,2,4]
f(*args)
</code></pre>

<p>Is there a similar solution in C++?</p>

<p>What I can come up with is as follows:</p>

<pre><code>template &lt;size_t num_args, typename FuncType&gt;
struct unpack_caller;

template &lt;typename FuncType&gt;
struct unpack_caller&lt;3&gt;
{
    void operator () (FuncType &amp;f, std::vector&lt;int&gt; &amp;args){
        f(args[0], args[1], args[3])
    }
};
</code></pre>

<p>Above I assume only <code>int</code> argument type.</p>

<p>The problem is that I feel it is a hassle to write all the specializations of unpack_caller for different value of <code>num_args</code>.</p>

<p>Any good solution to this? Thanks.</p>
