title: How to specialize only some members of a template class?
body: <p>Code:</p>
  
  <pre><code>template&lt;class T&gt;
  struct A {
    void f1() {};
    void f2() {};
  
  };
  
  template&lt;&gt;
  struct A&lt;int&gt; {
    void f2() {};
  };
  
  
  int main() {
    A&lt;int&gt; data;
    data.f1();
    data.f2();
  };
  </code></pre>
  
  <h2>ERROR:</h2>
  
  <pre><code>test.cpp: In function 'int main()':
  test.cpp:16: error: 'struct A&lt;int&gt;' has no member named 'f1'
  </code></pre>
  
  <p>Basically, I only want to specialize one function and use the common definition for other functions. (In actual code, I have many functions which I don't want to specialize).</p>
  
  <p>How to do this? Thanks!</p>