title: Calling variadic argument function from template class
body: <p>I have a template class with a variadic template member function that I am not able to call from outside the class.  This a simplified example of what I am trying to do:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct foo{
      foo(){}
  
      template&lt;int... I&gt;
      int run(){
          return sizeof...(I); // or whatever
      }
  };
  
  template&lt;int... I&gt;
  int run_int(){
      return foo&lt;int&gt;().run&lt;I...&gt;();  // OK
  }
  
  template&lt;typename T, int... I&gt;
  int run_T(){
      return foo&lt;T&gt;().run&lt;I...&gt;(); // error
  }
  </code></pre>
  
  <p>When foo is specialized, I can call its template member function run() with no problems.  But if I try to call it from a function or structure that does not specialize foo, gcc(4.7) issues an error saying "parameter packs not expanded with ‘...’ ".  I tried the same thing with clang (3.1) but got a similar error ( " error: expression contains unexpanded parameter pack 'I' " ).</p>
  
  <p>Can anyone help me understand why the last function fails to compile?  For now I can get around it by making "int...I" a non-type parameter of foo itself, and then call it like this from outside:</p>
  
  <pre><code> foo&lt;T, I...&gt;().run()
  </code></pre>
  
  <p>but I am still puzzled as to why it does not compile the other way.  </p>