1
- # C++ Style Guide
1
+ # C++ style guide
2
2
3
3
See also the [ C++ codebase README] ( ../../src/README.md ) for C++ idioms in the
4
4
Node.js codebase not related to stylistic issues.
5
5
6
- ## Table of Contents
6
+ ## Table of contents
7
7
8
- * [ Guides and References ] ( #guides-and-references )
8
+ * [ Guides and references ] ( #guides-and-references )
9
9
* [ Formatting] ( #formatting )
10
10
* [ Left-leaning (C++ style) asterisks for pointer declarations] ( #left-leaning-c-style-asterisks-for-pointer-declarations )
11
11
* [ C++ style comments] ( #c-style-comments )
@@ -18,11 +18,11 @@ Node.js codebase not related to stylistic issues.
18
18
* [ ` snake_case_ ` for private class fields] ( #snake_case_-for-private-class-fields )
19
19
* [ ` snake_case ` for C-like structs] ( #snake_case-for-c-like-structs )
20
20
* [ Space after ` template ` ] ( #space-after-template )
21
- * [ Memory Management ] ( #memory-management )
21
+ * [ Memory management ] ( #memory-management )
22
22
* [ Memory allocation] ( #memory-allocation )
23
23
* [ Use ` nullptr ` instead of ` NULL ` or ` 0 ` ] ( #use-nullptr-instead-of-null-or-0 )
24
24
* [ Use explicit pointer comparisons] ( #use-explicit-pointer-comparisons )
25
- * [ Ownership and Smart Pointers ] ( #ownership-and-smart-pointers )
25
+ * [ Ownership and smart pointers ] ( #ownership-and-smart-pointers )
26
26
* [ Avoid non-const references] ( #avoid-non-const-references )
27
27
* [ Use AliasedBuffers to manipulate TypedArrays] ( #use-aliasedbuffers-to-manipulate-typedarrays )
28
28
* [ Others] ( #others )
@@ -32,7 +32,7 @@ Node.js codebase not related to stylistic issues.
32
32
* [ Avoid throwing JavaScript errors in C++ methods] ( #avoid-throwing-javascript-errors-in-c )
33
33
* [ Avoid throwing JavaScript errors in nested C++ methods] ( #avoid-throwing-javascript-errors-in-nested-c-methods )
34
34
35
- ## Guides and References
35
+ ## Guides and references
36
36
37
37
The Node.js C++ codebase strives to be consistent in its use of language
38
38
features and idioms, as well as have some specific guidelines for the use of
@@ -191,7 +191,7 @@ class FancyContainer {
191
191
}
192
192
```
193
193
194
- ## Memory Management
194
+ ## Memory management
195
195
196
196
### Memory allocation
197
197
@@ -208,7 +208,7 @@ Use explicit comparisons to `nullptr` when testing pointers, i.e.
208
208
` if (foo == nullptr) ` instead of ` if (foo) ` and
209
209
` foo != nullptr ` instead of ` !foo ` .
210
210
211
- ### Ownership and Smart Pointers
211
+ ### Ownership and smart pointers
212
212
213
213
* [ R.20] [ ] : Use ` std::unique_ptr ` or ` std::shared_ptr ` to represent ownership
214
214
* [ R.21] [ ] : Prefer ` unique_ptr ` over ` shared_ptr ` unless you need to share
0 commit comments