How can I include "A.h" in B.h when compiling B.cpp but not require A.h for classes using B
Posted on 2003-10-24
I have a class B which uses services from a class A. Indeed, it contains private data of a type defined in A.h. However, I don't want users of class B to have to include "A.h" (A.h is in a different directory and besides I would just prefer to hide that implementation detail from users of class B).
Here is an untested code fragment which may make this more clear:
typedef int my_int ;
I would like to allow other classes to include B.h without having A.h in their include path.