title: Why does enable_shared_from_this have a non-virtual destructor?
body: <p>I have a pet project with which I experiment with new features of C++11. While I have experience with C, I'm fairly new to C++. To train myself into best practices, (besides reading a lot), I have enabled some strict compiler parameters (using GCC 4.4.1):</p>
  
  <pre><code>-std=c++0x -Werror -Wall -Winline -Weffc++ -pedantic-errors
  </code></pre>
  
  <p>This has worked fine for me. Until now, I have been able to resolve all obstacles. However, I have a need for <code>enable_shared_from_this</code>, and this is causing me problems. I get the following warning (error, in my case) when compiling my code (probably triggered by <code>-Weffc++</code>):</p>
  
  <pre><code>base class ‘class std::enable_shared_from_this&lt;Package&gt;’ has a non-virtual destructor
  </code></pre>
  
  <p>So basically, I'm a bit bugged by this implementation of <code>enable_shared_from_this</code>, because:</p>
  
  <ul>
  <li>A destructor of a class that is <em>intended</em> for subclassing <em>should always</em> be virtual, IMHO.</li>
  <li>The destructor is empty, why have it at all?</li>
  <li>I can't imagine anyone would want to delete their instance by reference to <code>enable_shared_from_this</code>.</li>
  </ul>
  
  <p>But I'm looking for ways to deal with this, so my question is really, is there a proper way to deal with this? And: am I correct in thinking that this destructor is bogus, or is there a real purpose to it?</p>