3 ms·
There's nothing self-contradictory. The two rules you're speaking of are: make sure that your header file is the first #include in the corresponding so
by mort96 3y ago
There's nothing self-contradictory. The two rules you're speaking of are:
make sure that your header file is the first #include
in the corresponding source file, except the common header,
if your codebase has one.
and:
make sure that each source file includes the common header
before everything else
This defines a pretty clear order: 1) common header, if it exists; 2) the corresponding header for the source file, if it exists; 3) other headers needed by the source file.
- JonChesterfield 3y agoAh you are right, I missed the "except the common header" clause. Probably because the preceding part was in bold, possibly because "common header" is defined further down the article so the clause didn't mean much when first read.