title: How to use unique_ptr with std::copy?
body: <p>I googled and found nothing. I guess I just don't know how to type the right question.</p>
  
  <p>Okay, my simple MemoryBlock class has two member data, <code>int size</code> and <code>int* data</code>. So to build a copy constructor, I use std::copy to do the memory copy. Now I would like to try the C++ smart pointer to replace the raw pointer. Say using the <code>unique_ptr&lt;int&gt; data</code>. What is the equivalence of the following code? Because now, <code>rhs.data + size</code> won't work.</p>
  
  <pre><code>std::copy(rhs.data, rhs.data + size, data);
  </code></pre>