Hi everyone) Is there a way in C++ to design classes so that each time overridden virtual function is called, corresponding base class function is called too, without calling it explicitly in subclass method implementation?
No, but there exists a pattern that works similarly.
1) Declare a virtual protected function that does the work
2) Declare a public function that calls the virtual protected function
For your purpose, you would only need to modify it one step further: add a third level of indirection to call the parent class's indirection, which will in turn do the same, etc, so that all levels of the function get called.
It would be much simpler, though, to just do it explicitly.
If there are some actions that must be performed every time a particular task needs to be accomplished, those actions should be factored out of the virtual function (sort of like Duoas describes above) and placed in the public interface which invokes the virtual implementation.