Variadic template function overloading
<p>I have a class with a variadic template member function (foo) like below. The idea is to skip all doubles in the parameter and allocate an object with user provided arguments.</p>

<pre><code>    template &lt;class T&gt;
    class Var {
    public:

       template &lt;typename U, typename ...Args&gt;
       int foo(int index, Args... args)
       {
           T* p = new U(args...);
           // save in an array at index 'index'
       }

       template &lt;typename U, typename ...Args&gt;
       int foo (double index, Args... args)
       {
           // do something with index and skip it
           return foo&lt;U&gt;(args...);
       }
    };

    class A {
    public:
      A (int i, const char *p)
      {

      }
    };

    int main ()
    {
       Var&lt;A&gt; var;

       var.foo&lt;A&gt;(1.0, 2, 3, "Okay");
    }
</code></pre>

<p>Now this works, there are 2 problem.</p>

<ul>
<li><p>Enforce how many doubles to skip.Eg: skip 2 doubles and then the next    argument should be an int. If it is not then throw error.</p></li>
<li><p>While at it, use 'int' in place of 'double'. So we will skip 2 ints. The next index will be a 'index' to an array.</p></li>
</ul>

<p>Basically I want to pass the no. of ints to skip as class template parameter.</p>

<pre><code>template &lt;class T, int SKIP&gt;
class Var {
</code></pre>

<p>And use SKIP to determine how many ints to skip.</p>

<p>Is it possible to do something like that?</p>