Skip to content
This repository was archived by the owner on Aug 31, 2018. It is now read-only.

Commit 1242c66

Browse files
joyeecheungQard
authored andcommitted
doc: add *-inl.h include rule to C++ style guide
PR-URL: nodejs/node#16548 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent b99b330 commit 1242c66

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)