title: Convert Object to std::unique_ptr
body: <p>I've got a simple noob question that I can't find an answer to:</p>
  
  <p>In C++ how do you convert a regular object</p>
  
  <pre><code>int i;
  </code></pre>
  
  <p>into a <code>std::unique_ptr</code>?</p>
  
  <pre><code>std::unique_ptr&lt;int&gt; iptr = &amp;i; //invalid
  std::unique_ptr&lt;int&gt; iptr = static_cast&lt;std::unique_ptr&lt;int&gt;&gt;(&amp;i); //invalid
  </code></pre>
  
  <p>Thanks.</p>