I have a C ++ project that is starting to get big. I came across a situation where I have many classes with circular dependencies. Suppose I have classes A, B, C, D. To solve this problem, I created a header file called circle_dep.h
The contents of this file will be a pointer to the classes:
class A; class B; class C; class D;
This title is now included with the entire title of my classes. So the compiler stopped complaining when I had circular dependencies. However, when I add a new class to the project, I will have to add it to round_dep.h
I could not find an easier way to do this, so for me this is the best solution. My question is: is it right to apply projects that may run into problems of circular dependence? Or is it a bad design / bad or dangerous practice?
source share