title: c++ explicit instantiation -- function templates -- replace a implicit instantiation to learn it
body: <p>Im reading c++ primer plus and having some issues understanding how implicit instantiation works. I havent learned classes yet, so I am just dealing with functions. I think I understand the basics of implicit instantiation (function templates) but I just dont understand explicit instantiation. I have below a function that uses a template, can someone show me how a function like this would be written if it used a explicit instantiation. You can change the way it works, but just keep it simple. I would really be appreciative. This will help me understand the syntax, and how it is used.</p>
  
  <pre><code>  2 #include &lt;iostream&gt;
    3 
    4 template &lt;typename T&gt;
    5 void show(T,T);
    6 
    7 
    8 int main()
    9 {
   10   int a = 10, b = 12;
   11   char c = 'x', d = 'y';
   12   
   13   show(a,b);
   14   show(c,d);
   15   
   16   return 0;
   17 } 
   18 
   19 template &lt;typename T&gt;
   20 void show(T a, T b )
   21 { 
   22   std::cout &lt;&lt; "I used the int version " &lt;&lt; a &lt;&lt; " " &lt;&lt; b &lt;&lt; "\n";
   23 }
  </code></pre>