title: Instantiation of template member function
body: <p>In <code>Class.h</code>:</p>
  
  <pre><code>class Class {
  public:
      template &lt;typename T&gt; void function(T value);
  };
  </code></pre>
  
  <p>In <code>Class.cpp</code>:</p>
  
  <pre><code>template&lt;typename T&gt; void Class::function(T value) {
      // do sth
  }
  </code></pre>
  
  <p>In <code>main.cpp</code>:</p>
  
  <pre><code>#include "Class.h"
  
  int main(int argc, char ** argv) {
      Class a;
      a.function(1);
      return 0;
  }
  </code></pre>
  
  <p>I get a linked error because <code>Class.cpp</code> never instantiate <code>void Class::function&lt;int&gt;(T)</code>. 
  You can explicitly instantiate a template class with :</p>
  
  <pre><code>template class std::vector&lt;int&gt;;
  </code></pre>
  
  <p>How do you explicitly instantiate a template member of a non-template class ?</p>
  
  <p>Thanks,</p>