title: Method defined in derived class and only declare in base class. Undefined reference
body: <p>Is it possible to just declare a in base class and leave the implementation in derived class? </p>
  
  <p>I thought that is possible, but the following doesn't work.</p>
  
  <pre><code>#include &lt;vector&gt;
  template &lt;typename I&gt;
  class A {
  public:
      A() {}
      template &lt;typename T2, typename A2&gt;
      void test0(const std::vector&lt;T2,A2&gt;&amp; vec,const I n) {
          test(vec[0]);
      }
  private:
      template &lt;typename I2&gt; void test(const I2 a);
  };
  
  template &lt;typename I&gt;
  class B: public A&lt;I&gt; {
  public:
      B() {}
  private:
      template &lt;typename I2&gt; void test(const I2 n) {}
  };
  
  int main() {
      B&lt;int&gt; b;
      std::vector&lt;int&gt; x(100);
      b.test0(x,0);
  }
  </code></pre>
  
  <p>Linker error:</p>
  
  <pre><code>/tmp/test7-76b4cc.o: In function `void A&lt;int&gt;::test0&lt;int, std::allocator&lt;int&gt; &gt;(std::vector&lt;int, std::allocator&lt;int&gt; &gt; const&amp;, int)':
  test7.cpp:(.text._ZN1AIiE5test0IiSaIiEEEvRKSt6vectorIT_T0_Ei[_ZN1AIiE5test0IiSaIiEEEvRKSt6vectorIT_T0_Ei]+0x35): undefined reference to `void A&lt;int&gt;::test&lt;int&gt;(int)'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>