title: C++ Partial-specialization of class in source not header
body: <p>Foo.h</p>
  
  <pre><code>template&lt;typename A, typename B&gt;
  class Foo{
  public:
    Foo();
    /*..*/
  };
  </code></pre>
  
  <p>Foo.cpp</p>
  
  <pre><code>template&lt;typename A, typename B&gt;
  Foo&lt;A, B&gt;::Foo(){/*...*/}
  
  template&lt;typename A&gt;
  Foo&lt;A, Beta&gt;::Foo(){/* some specialized construction */} //&lt;- this doesn't work.
  
  template&lt;&gt;
  Foo&lt;Alpha, Beta&gt;::Foo(){/*...*/} // &lt;-will work, but I want partial specialization.
  </code></pre>
  
  <p>When I compile, the partially specialized constructor throws an error </p>
  
  <blockquote>
    <p>nested name specifier 'Foo::' for declaration does not refer into a class, class template or class template partial specialization</p>
  </blockquote>
  
  <p>I imagine I need to declare this partially-specialized class somewhere, but I don't want to have to keep re-declaring the same class ... ie I don't want to have to put the following in the header file:</p>
  
  <pre><code>template&lt;typename A&gt;
  class Foo_Beta : public Foo&lt;A, Beta&gt;{
  public:
    Foo_Beta();
  }
  
  //in cpp
  template&lt;typename A&gt;
  Foo_Beta&lt;A&gt;() : Foo&lt;A, Beta&gt;() {/**specialized constructor stuff**/}
  </code></pre>
  
  <p>Because then I can't construct <em>Foo()</em> that uses the Foo_Beta constructor.</p>
  
  <p>I've tried </p>
  
  <pre><code>template&lt;typename A&gt;
  class Foo&lt;A,Beta&gt; : public Foo&lt;A, Beta&gt;{
  public:
    Foo();
  }
  </code></pre>
  
  <p>but that doesn't compile either. </p>
  
  <p><strong>Essentially, what is the syntax to declare the partial specialization of a class without re-declaring all the internal functions to that class?</strong></p>