diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2017-10-27 16:30:31 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2017-10-30 18:57:06 +0800 |
commit | ab2c35100fb2b67ecea597dbc29134b5c7f1d684 (patch) | |
tree | 6caa54be0b74e13bd6e82ce732567bb02f535267 /CPP_STYLE_GUIDE.md | |
parent | cdb263d3baebfe366fb817c6ae14202f8832c04d (diff) | |
download | android-node-v8-ab2c35100fb2b67ecea597dbc29134b5c7f1d684.tar.gz android-node-v8-ab2c35100fb2b67ecea597dbc29134b5c7f1d684.tar.bz2 android-node-v8-ab2c35100fb2b67ecea597dbc29134b5c7f1d684.zip |
doc: add *-inl.h include rule to C++ style guide
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'CPP_STYLE_GUIDE.md')
-rw-r--r-- | CPP_STYLE_GUIDE.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 3e7319c1f8..3bea5bb107 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -127,6 +127,21 @@ class FancyContainer { What it says in the title. +## Do not include `*.h` if `*-inl.h` has already been included + +Do + +```cpp +#include "util-inl.h" // already includes util.h +``` + +instead of + +```cpp +#include "util.h" +#include "util-inl.h" +``` + ## Avoid throwing JavaScript errors in nested C++ methods If you need to throw JavaScript errors from a C++ binding method, try to do it |