title: Why is "error: invalid application of 'sizeof' to an incomplete type using unique_ptr" fixed by adding an empty destructor?
body: <p>I am Pimpling off the class <code>STFT</code>. Compiles just fine with this in the header:</p>
  
  <pre><code>class STFT; // pimpl off to prevent point name clash
  
  class Whatever
  {
  private:
      STFT* stft;
  </code></pre>
  
  <p>and this in the implementation:</p>
  
  <pre><code>#include "STFT.h"
  Whatever::Whatever() : stft(new STFT()) {
  // blah blah
  }
  
  Whatever::~Whatever() {
      delete stft; // pure evil
  }
  </code></pre>
  
  <p>However, switching to <code>std::unique_ptr&lt;STFT&gt; stft;</code> over the raw pointer in the header, and removing the destructor, I get </p>
  
  <blockquote>
    <p>error: invalid application of 'sizeof' to an incomplete type 'STFT'
                static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");</p>
  </blockquote>
  
  <p>But if I simply supply an empty destructor <code>Whatever::~Whatever(){}</code>, then it compiles fine. This has me completely stumped. Please fill me in on what this meaningless destructor is doing for me.</p>