If I have a pure virtual class like the following:
I have class structure like the following:
class interface_class {
virtual void someFunction(MyClassA& a) = 0;
virtual void someFunction(MyClassB& b) = 0;
}
What is the correct way to include MyClassA/MyClassB? Should I do some forward declaration in the header file of the interface class and do the real inclusion in the header file of the implemention, or should I include the header file of MyClassA/B directly in the interface class?
Use Forward Declarations for both the classes.
In fact always use forward declarations wherever you can.
Using forward declarations saves you compilation time & also restricts you from creating unneeded dependencies.