Will the compiler auto generate copy/move functions if the Destructor of an otherwise trivial class is declared in the .hpp file and implemented as =default in the .cpp file?
//header
class ForwardDeclaredClass;
class TrivialClass
{
public:
~TrivialClass();
private:
std::shared_ptr<ForwardDeclaredClass> m_data;
};
//cpp file
TrivialClass::~TrivialClass() = default;
Our company has a guideline that enforces heavy use of forward declarations. This also forces us to forward declare the dtor and implement it in the .cpp. In addition to all other drawbacks of this guideline, do we also lose auto generate copy/move-assignment-operators and copy/move-constructors? From my understanding the compiler first sees a seemingly user defined dtor which would lead to the deletion of every copy/move function. Will the TrivialClass::~TrivialClass() = default; definition revert that deletion?
I tried to keep this question as precise and concise as possible, but feel free to make suggestions for re-formatting or re-writing. Thank you and best regards