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
All-abtract base classes that are used to simulate interfaces in C++ should not have data members - because they are describing an interface, and instance state is an implementation detail.
Other than that, base classes containing virtual functions may well have data members. The usual rules apply, though: