Overriding problem
-
There is Base class A which has child's B, C, D, ... Z. I need to add some methods to Z as virtual ones so that they will be overridden in Z child classes Z1, Z2, .. Zn. Is it possible, how can I do it. Note: I cannot add to base class A.
Start by telling us why you need to add the virtual methods. And why you can't add to the base class A.
The difficult we do right away... ...the impossible takes slightly longer.
-
Start by telling us why you need to add the virtual methods. And why you can't add to the base class A.
The difficult we do right away... ...the impossible takes slightly longer.
Well I have over 50 classes there. All of them have base class the same. Those functions (about 20 functions) are needed only for my one 5 level class (Class A5 : public A4) and two 6 level child classes ( Class A61 : public A5 and Class A62 : public A5). Reason because I want to make one handler class which will use A5 class virtual functions and will handle A61 and A62.
-
There is Base class A which has child's B, C, D, ... Z. I need to add some methods to Z as virtual ones so that they will be overridden in Z child classes Z1, Z2, .. Zn. Is it possible, how can I do it. Note: I cannot add to base class A.
-
Quote:
I need to add some methods to Z as virtual ones so that they will be overridden in Z child classes Z1, Z2, .. Zn. Is it possible, how can I do it.
Yes it is possible. Just do it.
You might not need to make them virtual.