title: what is the difference between T& and T&& in template parameter?
body: <p>What is the difference between T&amp; and T&amp;&amp; in template parameter? For example:</p>
  
  <pre><code>template&lt;class T&gt; void f(T&amp; t) {...}
  template&lt;class T&gt; void f(T&amp;&amp; t) {...}
  </code></pre>
  
  <p>I try the code</p>
  
  <pre><code>template&lt;class T&gt;
  void f(T&amp;&amp; t)
  {
      t = 5;
  }
  
  int main()
  {
      int a = 0;
      f(a); //a == 5 why?        
      return 0;
  }
  </code></pre>
  
  <p>I expect a = 0 but = 5, why?</p>