FileA.h
==================Code:#include <FileB.h> #include <FileC.h> class A{ typedef B<C> Engine; std::auto_ptr<Engine> engine; ... };
FileB.h
=================Code:class A; //forward declaration template <typename handle> class B{ B(A& a){...} };
FileC.h
Code:#include<FileA.h> class C{ C(A& a) {...} };
This code can pass compiling. But FileA includes FileC while FileC also includes FileA. How come that does NOT cause a problem?!