I assure you that you daily use a lot of headers such as these.
I assure you that you daily use a lot of headers such as these.
Sadly, I wouldn't be at all surprised if you were right and, in that context, I appreciate your original comment.
Otherwise, someone pointed me to https://code.google.com/p/include-what-you-use/. I wonder how that (beta) tool would handle your example...
No idea. However no tool will be able to detect that both files are needed as when a.h is present then b.h is not needed but once you remove a.h (or better yet have an ifndef there as well) b.h (or equivalent) is required despite the fact it is not used originally. It becomes even more complex with:
Qt Code:
#ifdef Q_OS_UNIX #include "a.h" #endif #include "b.h"To copy to clipboard, switch view to plain text mode
I'm sure I can find myrriads of other examples when such automatic cleanup would fail. Sorry but no tool can replace the process of thinking about what one's doing.
Bookmarks