title: Transferring the ownership of object from one unique_ptr to another unique_ptr in C++11?
body: <p>In <code>C++11</code> we can transfer the ownership of an object to another <code>unique_ptr</code> using <code>std::move()</code>. After the ownership transfer, the smart pointer that ceded the ownership becomes <code>null</code> and <code>get()</code> returns <code>nullptr.</code></p>
  
  <pre><code>std::unique_ptr&lt;int&gt; p1(new int(42));
  std::unique_ptr&lt;int&gt; p2 = std::move(p1); // Transfer ownership
  </code></pre>
  
  <p>What are the situations where this will be useful as it is transferring the ownership to another <code>unique_ptr</code>?</p>