File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,6 @@ node_modules
4
4
_site
5
5
scripts /python /__pycache__
6
6
scripts /python /* .pyc
7
+
8
+ # VS Code
9
+ .vs /
Original file line number Diff line number Diff line change @@ -18207,6 +18207,7 @@ Source file rule summary:
18207
18207
* [SF.8: Use `#include` guards for all `.h` files](#Rs-guards)
18208
18208
* [SF.9: Avoid cyclic dependencies among source files](#Rs-cycles)
18209
18209
* [SF.10: Avoid dependencies on implicitly `#include`d names](#Rs-implicit)
18210
+ * [SF.11: Header files should be self-contained](#Rs-contained)
18210
18211
18211
18212
* [SF.20: Use `namespace`s to express logical structure](#Rs-namespace)
18212
18213
* [SF.21: Don't use an unnamed (anonymous) namespace in a header](#Rs-unnamed)
@@ -18614,6 +18615,27 @@ This rule against implicit inclusion is not meant to prevent such deliberate agg
18614
18615
Enforcement would require some knowledge about what in a header is meant to be "exported" to users and what is there to enable implementation.
18615
18616
No really good solution is possible until we have modules.
18616
18617
18618
+ ### <a name="Rs-contained"></a>SF.11: Header files should be self-contained
18619
+
18620
+ ##### Reason
18621
+
18622
+ Usability, headers should be simple to use and work when included on their own.
18623
+ Headers should encapsulate the functionality they provide.
18624
+ Avoid clients of a header having to manage that header's dependencies.
18625
+
18626
+ ##### Example
18627
+
18628
+ #include "helpers.h"
18629
+ // helpers.h depends on std::string and includes <string>
18630
+
18631
+ ##### Note
18632
+
18633
+ Failing to follow this results in difficult to diagnose errors for clients of a header.
18634
+
18635
+ ##### Enforcement
18636
+
18637
+ A test should verify that the header file itself compiles or that a cpp file which only includes the header file compiles.
18638
+
18617
18639
### <a name="Rs-namespace"></a>SF.20: Use `namespace`s to express logical structure
18618
18640
18619
18641
##### Reason
You can’t perform that action at this time.
0 commit comments