I am deleting the class STFT. Compiles with this in the header:
class STFT;
class Whatever
{
private:
STFT* stft;
and this is in implementation:
#include "STFT.h"
Whatever::Whatever() : stft(new STFT()) {
}
Whatever::~Whatever() {
delete stft;
}
However, switching to std::unique_ptr<STFT> stft;over the raw pointer in the header and deleting the destructor, I get
error: invalid application 'sizeof' for incomplete STFT type 'static_assert (sizeof (_Tp)> 0, "default_delete cannot delete incomplete type");
But if I just put an empty destructor Whatever::~Whatever(){}, then it compiles fine. It completely stalled me. Please write to me what this meaningless destructor does for me.