title: How to intentionally delete a boost::shared_ptr?
body: <p>I have many <code>boost::shared_ptr&lt;MyClass&gt;</code> objects, and at some point I intentionally want to <code>delete</code> some of them to free some memory. (I know at that point that I will never need the pointed-to <code>MyClass</code> objects anymore.) How can I do that? </p>
  
  <p>I guess you can't just call <code>delete()</code> with the raw pointer that I get with <code>get()</code>.</p>
  
  <p>I've seen a function <code>get_deleter(shared_ptr&lt;T&gt; const &amp; p)</code> in <code>boost::shared_ptr</code>, but I'm not sure how to use it, and also it says <em>experimental</em> right next to it. (I think I have Boost 1.38.)</p>
  
  <p>Maybe just assign a new empty <code>boost::shared_ptr</code> to the variable? That should throw away the old value and delete it.</p>