title: C++ syntax for explicit specialization of a template function in a template class?
body: <p>I have code which works in VC9 (Microsoft Visual C++ 2008 SP1) but not in GCC 4.2 (on Mac):</p>
  
  <pre><code>struct tag {};
  
  template&lt; typename T &gt;
  struct C
  {   
      template&lt; typename Tag &gt;
      void f( T );                 // declaration only
  
      template&lt;&gt;
      inline void f&lt; tag &gt;( T ) {} // ERROR: explicit specialization in
  };                               // non-namespace scope 'structC&lt;T&gt;'
  </code></pre>
  
  <p>I understand that GCC would like me to move my explicit specialization outside the class but I can't figure out the syntax.  Any ideas?</p>
  
  <pre><code>// the following is not correct syntax, what is?
  template&lt; typename T &gt;
  template&lt;&gt;
  inline void C&lt; T &gt;::f&lt; tag &gt;( T ) {}
  </code></pre>