How do you maintain the #include statements in your C or C++ project? It seems almost inevitable that eventually the set of include statements in a file is either insufficie
I have the habit of ordering my includes from high abstraction level to low abstraction level. This requires that headers have to be self-sufficient and hidden dependencies are quickly revealed as compiler errors.
For example a class 'Tetris' has a Tetris.h and Tetris.cpp file. The include order for Tetris.cpp would be
#include "Tetris.h" // corresponding header first
#include "Block.h" // ..then application level includes
#include "Utils/Grid.h" // ..then library dependencies
#include // ..then stl
#include // ..then system includes
And now I realize this doesn't really answer your question since this system does not really help to clean up unneeded includes. Ah well..