I have a base State
interface class with virtual default destructor.
class State {
public:
virtual void event() = 0;
virtual ~State() = default; // relevant part
virtual void onCreate() {}
virtual void onDestroy() {}
virtual void onActivate() {}
virtual void onDeactivate() {}
};
And then some classes inheriting from it:
class GameState : public State {
public:
void event() override;
// ...
};
class MenuState : public State {
public:
void event() override;
// ...
};
Compiler generates default move operations if no copy operation or destructor is user-defined. Compiler generates default copy operations if no move operation is user-defined.
Am I correct that by declaring virtual default destructor I have effectively deleted the default move operations?
Will the move operations work for the deriving classes if the base class had implicitly deleted its move operations, and the base class is just an interface without data members?
Is it really sensible to follow the Rule of 5 here? It seems quite a bloat to explicitly delete or default all 5 special member functions.