title: std::remove_reference explained?
body: <p>I saw possible implementations for <a href="http://en.cppreference.com/w/cpp/types/remove_reference" rel="noreferrer"><code>std::remove_reference</code></a> as below  </p>
  
  <pre><code>template&lt; class T &gt; struct remove_reference      {typedef T type;};
  template&lt; class T &gt; struct remove_reference&lt;T&amp;&gt;  {typedef T type;};
  template&lt; class T &gt; struct remove_reference&lt;T&amp;&amp;&gt; {typedef T type;};   
  </code></pre>
  
  <p>Why is it that there are specializations for <code>lvalue</code> and <code>rvalue reference</code>? Won't the general template itself be sufficient and remove the reference? I'm confused here because in the <code>T&amp;</code> or <code>T&amp;&amp;</code> specialization if I try to use <code>::type</code> I should still get <code>T&amp;</code> or <code>T&amp;&amp;</code> respectively right?  </p>
  
  <p>Could you explain how, why we cast to <code>remove_reference&lt;t&gt;::type&amp;&amp;</code> in move? (is it because that the parameter is named so it will be treated as an lvalue inside the move function?).</p>
  
  <p>Also, could you point out a way whereby I can find out and print what the type is? for e.g if its an <code>rvalue</code> of type <code>int</code> then I should be able to print out that <code>int&amp;&amp;</code> was passed? (I've been using <code>std::is_same</code> to check but manually.)</p>
  
  <p>Thank you for your time.</p>