title: Specializing function template for reference types
body: <p>Why is the output of this <a href="http://www.ideone.com/IlirG">code</a> :</p>
  
  <pre><code>#include &lt;iostream&gt;  
  template&lt;typename T&gt; void f(T param) 
  { 
     std::cout &lt;&lt; "General" &lt;&lt; std::endl ; 
  } 
  template&lt;&gt; void f(int&amp; param) 
  { 
     std::cout &lt;&lt; "int&amp;" &lt;&lt; std::endl ; 
  }  
  
  int main() 
  {   
    float x ;  f (x) ;   
    int y ; f (y) ;   
    int&amp; z = y ; f (z) ; 
  }  
  </code></pre>
  
  <p>is</p>
  
  <blockquote>
    <p>General<br>
    General<br>
    General</p>
  </blockquote>
  
  <p>The third one is surprizing because the function was specialized exactly for <code>int&amp;</code></p>
  
  <p>Edit : I know that overloading might be a proper solution. I just want to learn the logic behind it.</p>