title: template member function of template class called from template function
body: <p>This doesn't compile:</p>
  <pre><code>template&lt;class X&gt; struct A {
     template&lt;int I&gt; void f() {}
  };
  
  template&lt;class T&gt; void g()
  {
     A&lt;T&gt; a;
     a.f&lt;3&gt;();  // Compilation fails here (Line 18)
  }
  
  int main(int argc, char *argv[])
  {
     g&lt;int&gt;();  // Line 23
  }
  </code></pre>
  <p>The compiler (gcc) says:</p>
  <blockquote>
  <p>hhh.cpp: In function 'void g()':</p>
  <p>hhh.cpp:18: error: expected primary-expression before ')' token</p>
  <p>hhh.cpp: In function 'void g() [with T = int]':</p>
  <p>hhh.cpp:23:   instantiated from here</p>
  <p>hhh.cpp:18: error: invalid use of member (did you forget the '&amp;' ?)</p>
  </blockquote>
  <p>Can anyone explain why this is?  Is there a way to get it to work?</p>