title: Is it possible to explicitly instantiate a function with the body, defined within a template definition?
body: <p>Let's consider the following code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  class A
  {
  public:
      template&lt;class T&gt;
      void foo(T t){ std::cout &lt;&lt; "foo()" &lt;&lt; std::endl; }
  };
  
  template&lt;&gt; void A::foo&lt;int&gt;(int t);
  template&lt;&gt; void A::foo&lt;A*&gt;(A* t);
  
  int main(){ A a; a.foo(5); };
  </code></pre>
  
  <p><strong><a href="http://coliru.stacked-crooked.com/a/439c1992c9fcb7f3" rel="nofollow">DEMO</a></strong></p>
  
  <p>For instance, I just want to explicitly provide two definitions as I defined in the function template body for the instantiated functions. Is it possible to do that with explicit instantiation or the only way to do that is implicit instantiation?</p>