title: How can I append template arguments repeatedly to a type?
body: <p>I want to create a metafunction, <code>Append</code> that takes a templated type and adds <code>N</code> number of arguments of type <code>T</code> to the template, for example, if I call <code>Append&lt;2, int, std::tuple&lt;&gt;&gt;</code> I want to get <code>std::tuple&lt;int, int&gt;</code>.</p>
  
  <p>Here is what I've tried:</p>
  
  <pre><code>#include &lt;tuple&gt;                                                                
  
  template &lt;int N, typename T, template &lt;class&gt; class Seq, typename... Args&gt;      
  struct Append;                                                                  
  
  template &lt;int N, typename T, template &lt;class&gt; class Seq, typename... Args&gt;      
  struct Append&lt;N, T, Seq&lt;Args...&gt;&gt;                                               
  {                                                                               
      using type = Append&lt;N-1, T, Seq&lt;Args..., T&gt;&gt;::type;                         
  };                                                                              
  
  template &lt;typename T, template&lt;class&gt; class Seq, typename... Args&gt;              
  struct Append&lt;0, T, Seq&lt;Args...&gt;&gt;                                               
  {                                                                               
      using type = Seq&lt;Args...&gt;;                                                  
  };                                                                              
  
  // create a big tuple with N number of "int" types in it                           
  using T = Append&lt;2, int, std::tuple&lt;&gt;&gt;::type;                                      
  
  int main()                                                                         
  {                                                                                  
      return 0;                                                                      
  }               
  </code></pre>
  
  <p>However, when I try to compile this I get:</p>
  
  <blockquote>
    <p>error: type/value mismatch at argument 3 in template parameter list
    for ‘template class Seq, class ...
    Args> struct Append’</p>
  </blockquote>
  
  <p>What am I missing?</p>