In order to reduce unnecessary coupling and decrease compilation time, is there a tool which can help locate (and perhaps interactively remove) unnecessary inclusion of header files in C/C++ translation units?
In particular, a tool that can detect, for every translation unit, all those types whose #include
directives can be replaced with forward declarations, in the context of that translation unit.
If this is not achievable, do useful approximations exist?