I have this structure:
class A { public: virtual void func(int a) { cout << "System is initiated correctly." << a; } }; class B : public A { public: virtual void func(int a) override { A::func(a); cout << "This particular system is initiated correctly too" << a; } };
Now in 95% of cases when I am overloaded from A, I override func , and in 100% of cases I have to call A::func(); before doing anything else? How can I prevent this from being recorded manually. Sometimes I even forgot to call A::func(); in the child class A::func(); and get runtime errors, throws, etc.
Narek source share