title: Can a unique_ptr take a nullptr value?
body: <p>Is this code fragment valid? :</p>
  
  <pre><code>unique_ptr&lt;A&gt; p(new A());
  p = nullptr;
  </code></pre>
  
  <p>That is, can I assign <code>nullptr</code> to a <code>unique_ptr</code> ? or it will fail? </p>
  
  <p>I tried this with the <strong>g++</strong> compiler and it worked, but what about other compilers?</p>