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