title: When should I use remove_reference and add_reference?
body: <p>I'm looking at [VC10's] unique_ptr and they do a couple things I don't understand:</p>
  
  <pre><code>typedef typename tr1::remove_reference&lt;_Dx&gt;::type _Dx_noref;
  
  _Dx_noref&amp; get_deleter()
      {   // return reference to deleter
      return (_Mydel);
      }
  
  unique_ptr(pointer _Ptr,
      typename _If&lt;tr1::is_reference&lt;_Dx&gt;::value, _Dx,
          const typename tr1::remove_reference&lt;_Dx&gt;::type&amp;&gt;::_Type _Dt)
      : _Mybase(_Ptr, _Dt)
      {   // construct with pointer and (maybe const) deleter&amp;
      }
  
  typename tr1::add_reference&lt;_Ty&gt;::type operator*() const
      {   // return reference to object
      return (*this-&gt;_Myptr);
      }
  </code></pre>
  
  <p>Wouldn't just writing _Dx&amp; or _Ty&amp; be the same thing?</p>
  
  <p>I actually do understand why they did it here though:</p>
  
  <pre><code>unique_ptr(pointer _Ptr, typename tr1::remove_reference&lt;_Dx&gt;::type&amp;&amp; _Dt)
      : _Mybase(_Ptr, _STD move(_Dt))
      {   // construct by moving deleter
      }
  </code></pre>