Why it is recommended not to have data members in virtual base class?
What about function members? If I have a task common to all derived classes is it OK for virtua
I've never seen this recommendation.
A class is a set of closely related functions and data. The purpose of a base class is to have a common set of functions and data that are available for reuse by derived classes.
I think restricting yourself to not have data members or non-pure virtual functions in base classes will reduce the amount of code reuse, which leads to less reliable code in the long run.