From e5e2abe44628ac8a5e0493bd5c0ff92057f801cb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Sep 2020 10:51:55 -0400 Subject: [PATCH] update include file policy file and policy for pointers.h special case --- doc/include-file-conventions.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/include-file-conventions.md b/doc/include-file-conventions.md index e3448cb8ce..ea4e07eb59 100644 --- a/doc/include-file-conventions.md +++ b/doc/include-file-conventions.md @@ -91,21 +91,21 @@ statements should follow the "include what you use" principle. Include files should be included in this order: * the header matching the implementation (`some_class.h` for file `some_class.cpp`) -* mpi.h -* system and library headers (anything that is using angular brackets; C-library headers first, then C++) +* mpi.h (only if needed) * LAMMPS local headers (preferably in alphabetical order) +* system and library headers (anything that is using angular brackets; C-library headers first, then C++) ### Special Cases and Exceptions #### pointers.h -The `pointer.h` header file also includes `cstdio`, `cstddef`, -`string`, `lmptype.h`, and `utils.h` (and through those indirectly - `stdint.h`, `intttypes.h`, cstdlib, and `climits`). +The `pointer.h` header file also includes (in this order) `lmptype.h`, +`mpi.h`, `cstddef`, `cstdio`, `string`, `utils.h`, and `fmt/format.h` +and through `lmptype.h` indirectly also `climits`, `cstdlib`, `cinttypes`. This means any header including `pointers.h` can assume that `FILE`, -`NULL`, `INT_MAX` are defined, they may freely use std::string -and functions from the utils namespace without including the -corresponding header files. +`NULL`, `INT_MAX` are defined, and the may freely use the std::string +for arguments. Corresponding implementation files do not need to include +those headers. ## Tools