Skip to content

Commit d733dd9

Browse files
joyeecheungcjihrig
authored andcommitted
doc: add *-inl.h include rule to C++ style guide
PR-URL: #16548 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 97fd6df commit d733dd9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CPP_STYLE_GUIDE.md

+15
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ class FancyContainer {
127127
128128
What it says in the title.
129129
130+
## Do not include `*.h` if `*-inl.h` has already been included
131+
132+
Do
133+
134+
```cpp
135+
#include "util-inl.h" // already includes util.h
136+
```
137+
138+
instead of
139+
140+
```cpp
141+
#include "util.h"
142+
#include "util-inl.h"
143+
```
144+
130145
## Avoid throwing JavaScript errors in nested C++ methods
131146

132147
If you need to throw JavaScript errors from a C++ binding method, try to do it

0 commit comments

Comments
 (0)