I prefer to minimize the use #includein my header files using, whenever possible, advanced declarations, and I think this is considered good practice.
It works fine if I have a method declaration, for example:
bool IsFlagSet(MyObject *pObj);
However, if I have typedef Ptr<MyObject> MyObjectPtrin MyObject.h, and the API will change to:
bool IsFlagSet(MyObjectPtr pObj);
Do I really need it now #include "MyObject.h"? Is there a way around this, or is it just the price that pays for using smart pointers?
source
share