class Base {
private:
static Base* instance;
public:
Base* getInstance();
};
class Derived : public Base {
public:
void Func();
};
While working on the code we discovered that, prior to changing it to Base-Derived (before it was just Base), there were many lines of
Base* b = Base::getInstance()
However, these all have to be updated to Derived in order to use Derived's functions. The only option I could see was to use
Derived* d = (Derived*)Base::getInstance()
Is this a good idea, or will it cause problems in the future?

New Topic/Question
Reply




MultiQuote






|