title: Rvalue reference parameters and template functions
body: <p>If I define a function which accepts an rvalue reference parameter:</p>
  
  <pre><code>template &lt;typename T&gt;
  void fooT(T &amp;&amp;x) {}
  </code></pre>
  
  <p>I can call it, using GCC 4.5, with either <code>a</code>, <code>ar</code>, or <code>arr</code>:</p>
  
  <pre><code>int a, &amp;ar = a, &amp;&amp;arr = 7;
  fooT(a); fooT(ar); fooT(arr);
  </code></pre>
  
  <p>However, calling a similar, <em>non-template</em> function, </p>
  
  <pre><code>void fooInt(int &amp;&amp;x) {}
  </code></pre>
  
  <p>with any of those three arguments will fail. I was preparing to strengthen my knowledge of <code>forward</code>, but this has knocked me off course. Perhaps it's GCC 4.5; I was surprised to find that the first example from <a href="http://www.artima.com/cppsource/rvalue.html" rel="noreferrer">A Brief Introduction to Rvalue References</a> also gives a compile error:</p>
  
  <pre><code>A a;
  A&amp;&amp; a_ref2 = a;  // an rvalue reference
  </code></pre>