I have a base class and derivative class, e.g :
class Base {
public:
Base();
virtual doSomthing();
};
class Derivative : class Base {
public:
Derivative();
virtual doSomthing();
};
I know that if I want to change at runtime from the father to son I will do
Derivative& newDer = dynamic_cast<Derivative&>(baseInstance)
my question is how I can do the opposite operation - change from son to the father?