Richard was right (why was his decision recorded?).
In any case, all C / C ++ headers should use include internal security devices.
This suggests that:
1 - Your old code is no longer supported, and you should use precompiled headers (which are a hack, but hey ... your need to speed up your compilation, not refactoring unsupported code)
2 - Your old code is still alive. Then you either use pre-compiled headers, or / or guards / external guards for a temporary solution, but in the end you will need to remove all of your included ones, one .C or .CPP at a time and compile each. C or .CPP one at a time, correcting their inclusion with forward-declarations or including if necessary (or even breaking up a large one, include in smaller ones so that each .C or .CPP file receives only the headers that it needs). In any case, testing and removing obsolete inclusions is part of the technical maintenance of the project, therefore ...
My own experience with precompiled headers was not entirely good, because for half the time the compiler could not find the character that I defined, and therefore I tried a complete clean / rebuild to make sure that it was not a precompiled header, which was outdated. Therefore, I suggest using it for external libraries that you wonβt even touch (for example, the STL, C API, Boost headers, whatever). However, my own experience was with Visual C ++ 6, so I think (hopefully?), They got that right now.
So the last thing: headlines should always be self-contained. This means that if the inclusion of headers depends on the order of inclusion, then you have a problem. For example, if you can write:
#include "AAA.hpp" #include "BBB.hpp"
But not:
#include "BBB.hpp" #include "AAA.hpp"
because BBB depends on AAA, then all you have is a dependency that you never recognized in the code. Not recognizing this with a definition will make your compilation a nightmare. The BBB should also include AAA (even if it can be slightly slower: after all, forward declarations will be pure useless anyway, so you should have a fast compilation timer).