M
Marcin Kalicinski
Hi,
In the following code example:
class Base {
virtual void CopyFrom(const Base *);
};
class Derived: public Base {
void CopyFrom(const Derived *);
};
Derived::CopyFrom() does not override Base::CopyFrom() (am I right?)
What should I do if I want this kind of method in hierarchy to be virtual?
Do I have to change the signature of CopyFrom in Derived to
void Derived::CopyFrom(const Base *)
And do a compile time check if supplied pointer is of Derived class by using
dynamic_cast?
Best regards,
Marcin
In the following code example:
class Base {
virtual void CopyFrom(const Base *);
};
class Derived: public Base {
void CopyFrom(const Derived *);
};
Derived::CopyFrom() does not override Base::CopyFrom() (am I right?)
What should I do if I want this kind of method in hierarchy to be virtual?
Do I have to change the signature of CopyFrom in Derived to
void Derived::CopyFrom(const Base *)
And do a compile time check if supplied pointer is of Derived class by using
dynamic_cast?
Best regards,
Marcin