Synopsis: | Each file shall directly include each header file upon which declarations it directly depends |
Language: | C++ |
Severity Level: | 3 |
Category: | Code Organization |
Description: |
A file shall not depend on declarations that are only indirectly included by means of a nested #include directive in some other included header file. Otherwise, it would be unnecessarily difficult to change dependencies of a header file, even if it already was self-contained. It would also be somewhat less obvious which files are the actual users of specific headers. Exception:an exception to this is the inclusion of "stdafx.h" in Visual Studio. In this header file a lot of files are combined to speed up the compilation process. |