title: Struct template where the number of constructor arguments is a template parameter
body: <p>I am creating a templated vector struct (the math construct, not the STL container) where the type of data and number of elements are parameterized; i.e. Vector <code>&lt;int,3&gt;</code> stores three integers. I'd like to write a constructor that takes the parameterized-number-of-elements arguments and initializes the underlying array with them. I think I need to use a variadic template. This is my attempt:</p>
  
  <pre><code>template&lt;typename T, unsigned int n&gt;
  struct Vector
  {
    T data[n];
  
    explicit Vector(const T&amp; fillVal)
    {
      std::fill(data, data+n, fillVal);
    }
  
    explicit Vector(T... args)
      : data(args...)
    {}
  };
  </code></pre>
  
  <p>The compiler gives me the error that "'T': does not contain a parameter pack". How can I fix this to achieve my desired behavior? Also, do I need to test the type and number of arguments, and if so, how?</p>