title: C++: make unique_ptr null by reference to unique_ptr object
body: <p>This might be a stupid question, but can I make unique_ptr null by reference to unique_ptr object?</p>
  <pre><code>#include&lt;iostream&gt;
  #include&lt;memory&gt;
  
  int main() 
  {
      std::unique_ptr&lt;int&gt; a = std::make_unique&lt;int&gt;(2);
      int&amp; b = *a.get();
      
      // use &quot;b&quot; to make &quot;a&quot; nullptr
  
      return 0;
  }
  </code></pre>