How can I create a C++ constructor that accepts a variable number of int's
<p>Is it possible to constrain the type of arguments in a variadic constructor?</p>

<p>I want to be able to express</p>

<pre><code>X x1(1,3,4);
X x2(3,4,5);

// syntax error: identifier 'Args'
class X {
template&lt;int ... Args&gt; X(Args...)
{
}
};
// this works but allows other types than int
class Y {
template&lt;typename ... Args&gt; Y(Args...)
{
}
};
</code></pre>

<p><strong>edit to clarify intent:</strong></p>

<p>What I want to achieve is to store data passed into a constructor (constants known at compile time) into a static array.</p>

<p>so there are some other</p>

<pre><code>template&lt;int ...values&gt;
struct Z
{
    static int data[sizeof...(values)];
};

template&lt;int ... values&gt;
int Z&lt;values...&gt;::data[sizeof...(values)] = {values...};
</code></pre>

<p>and in the constructor of X I would like to use Z like this:</p>

<pre><code>class X {
    template&lt;int ... Args&gt; X(Args...)
    {
        Z&lt;Args...&gt;::data // do stuff with data
    }
};
</code></pre>

<p>Is that possible, our do I have to use integer_sequence?</p>