title: Specialize templated function for templated class
body: <p>In C++, I am trying to specialize a templated function for a object that is templated itself.</p>
  
  <p>Here is a basic example:
  test.h:</p>
  
  <pre><code>template &lt;class T&gt;
  class myC {
      T x;
  };
  
  template &lt;class U&gt;
  void f(U y) {
  }
  
  template &lt;&gt;
  template &lt;class T&gt;
  void f&lt;myC&lt;T&gt; &gt;(myC&lt;T&gt; y) {
  }
  </code></pre>
  
  <p>test.cpp</p>
  
  <pre><code>#include "test.h"
  int main() {
      myC&lt;double&gt; m;
      f(m);
  }
  </code></pre>
  
  <p>GCC 4.6.1 gives me the following error message:</p>
  
  <pre><code>In file included from test.cpp:1:0:
  test.h:13:25: error: too many template parameter lists in declaration of ‘void f(myC&lt;T&gt;)’
  test.h:13:6: error: template-id ‘f&lt;myC&lt;T&gt; &gt;’ for ‘void f(myC&lt;T&gt;)’ does not match any template declaration
  test.h:13:25: note: saw 2 ‘template&lt;&gt;’, need 1 for specializing a member function template
  </code></pre>
  
  <p>Is this at all possible? Or is there another way to accomplish the same goal?</p>