title: Partial template specialization outside class definition
body: <p>I can use partial template specialization inside class declaration</p>
  
  <pre><code>template&lt;class T1, class T2&gt;
  struct A
  {
      void foo() { cout &lt;&lt; "general"; }
  };
  
  template&lt;class T1&gt;
  struct A&lt;T1, int&gt;
  {
      void foo() { cout &lt;&lt; "partial specialization"; }
  };
  </code></pre>
  
  <p>But when I'm trying to do it outside class declaration</p>
  
  <pre><code>template&lt;class T1, class T2&gt;
  struct A
  {
      void foo();
  };
  
  
  template&lt;class T1, class T2&gt;
  void A&lt;T1, T2&gt;::foo() { cout &lt;&lt; "general"; }
  
  template&lt;class T1&gt;
  void A&lt;T1, int&gt;::foo() { cout &lt;&lt; "partial specialization"; }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>invalid use of incomplete type «struct A &lt; T1, int >»</p>
  </blockquote>
  
  <p>It's not a problem to use the first approach when you want to redefine all members, but what if you want redefine only one method without code duplication for all others?</p>
  
  <p>So, <strong>is it possible to use partial template specialization outside class definition?</strong></p>