title: How are std::move template parameters deduced?
body: <p>Suppose we have:</p>
  
  <pre><code>foo(A&amp;&amp; a);
  </code></pre>
  
  <p>if you do </p>
  
  <pre><code>A a;
  foo(a);
  </code></pre>
  
  <p>it won't compile and complain cannot bind a lvalue to A&amp;&amp;. that's perfectly fine.</p>
  
  <p>However, given the signature of std::move,</p>
  
  <pre><code>template&lt;class T&gt; typename remove_reference&lt;T&gt;::type&amp;&amp; std::move(T&amp;&amp; a);
  </code></pre>
  
  <p>Looks like it takes a rvalue reference, just as in foo, why the following code complies?</p>
  
  <pre><code>A a;
  std::move(a);
  </code></pre>
  
  <p>isn't <code>a</code> is a lvalue?</p>
  
  <p>furthur, it is said the compile will instantiate:</p>
  
  <pre><code>typename remove_reference&lt;A&amp;&gt;::type&amp;&amp; std::move(A&amp; &amp;&amp; a);
  </code></pre>
  
  <p>I don't understand why it is not:</p>
  
  <pre><code>typename remove_reference&lt;A&gt;::type&amp;&amp; std::move(A &amp;&amp; a);
  </code></pre>
  
  <p>it looks to me <code>a</code> is of type <code>A</code>, not <code>A&amp;</code>.</p>