I recently got stuck in a situation like this:
class A { public: typedef struct/class {...} B; ... C::D *someField; } class C { public: typedef
If you have access to change the source code of classes C and D, then you can take out class D separately, and enter a synonym for it in class C:
class CD { }; class C { public: using D = CD; }; class CD;