diff options
| author | Pieter Wuille <[email protected]> | 2017-06-11 15:53:33 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-06-11 15:54:58 -0700 |
| commit | a090d1c1c9c379bce7345ba5b78aa9491e350d0b (patch) | |
| tree | af8c218cf1264984df03a92fb5ddafc755fe5dd0 /doc/developer-notes.md | |
| parent | Merge #10546: Remove 33 unused Boost includes (diff) | |
| download | discoin-a090d1c1c9c379bce7345ba5b78aa9491e350d0b.tar.xz discoin-a090d1c1c9c379bce7345ba5b78aa9491e350d0b.zip | |
Header include guideline
Diffstat (limited to 'doc/developer-notes.md')
| -rw-r--r-- | doc/developer-notes.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index ec6abda91..a596ea011 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -425,6 +425,14 @@ Source code organization - *Rationale*: Shorter and simpler header files are easier to read, and reduce compile time +- Every `.cpp` and `.h` file should `#include` every header file it directly uses classes, functions or other + definitions from, even if those headers are already included indirectly through other headers. One exception + is that a `.cpp` file does not need to re-include the includes already included in its corresponding `.h` file. + + - *Rationale*: Excluding headers because they are already indirectly included results in compilation + failures when those indirect dependencies change. Furthermore, it obscures what the real code + dependencies are. + - Don't import anything into the global namespace (`using namespace ...`). Use fully specified types such as `std::string`. |