title: Specialized template classes with common functions
body: <p>Is it possible to specialize a few functions for a template class without specializing the whole thing?</p>
  
  <p>For example:</p>
  
  <pre><code>template &lt;typename T&gt;
  struct A {
      int foo();
  };
  
  template &lt;typename T&gt;
  int A&lt;T&gt;::foo() { return 1;}
  
  template &lt;&gt;
  struct A&lt;int&gt; {
      int bar() { return 2; };
  };
  
  main() {
      A&lt;int&gt; a;
      a.foo(); //1
      a.bar(); //2
      A&lt;double&gt; b;
      b.foo(); //1
      b.bar(); // ERROR
  }
  </code></pre>
  
  <p>Or something similar?</p>