Skip to content

Commit

Permalink
Add clarifying example to SF.12
Browse files Browse the repository at this point in the history
The examples in SF.12 are likely to encourage readers to always use the `""` form of `'#include` when including headers from the same project ([discussion](isocpp#1596 (comment))). However, in larger projects this may not always be appropriate; `<>` should be used for includes located via a header search path.

This proposed solution adds an example of the later, i.e. where `<>` is used to include a header from the same project.
  • Loading branch information
johnmcfarlane authored and frozenca committed Nov 7, 2020
1 parent e8e4a5c commit 0adea8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CppCoreGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -19306,6 +19306,7 @@ Nevertheless, the guidance is to use the quoted form for including files that ex
#include <some_library/common.h> // A file that is not locally relative, included from another library; use the <> form
#include "foo.h" // A file locally relative to foo.cpp in the same project, use the "" form
#include "foo_utils/utils.h" // A file locally relative to foo.cpp in the same project, use the "" form
#include <component_b/bar.h> // A file in the same project located via a search path, use the <> form

##### Note

Expand Down

0 comments on commit 0adea8d

Please sign in to comment.