File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 18
18
* [ Memory Management] ( #memory-management )
19
19
* [ Memory allocation] ( #memory-allocation )
20
20
* [ Use ` nullptr ` instead of ` NULL ` or ` 0 ` ] ( #use-nullptr-instead-of-null-or-0 )
21
+ * [ Use explicit pointer comparisons] ( #use-explicit-pointer-comparisons )
21
22
* [ Ownership and Smart Pointers] ( #ownership-and-smart-pointers )
22
23
* [ Avoid non-const references] ( #avoid-non-const-references )
23
24
* [ Others] ( #others )
@@ -195,6 +196,12 @@ class FancyContainer {
195
196
196
197
Further reading in the [ C++ Core Guidelines] [ ES.47 ] .
197
198
199
+ ### Use explicit pointer comparisons
200
+
201
+ Use explicit comparisons to ` nullptr ` when testing pointers, i.e.
202
+ ` if (foo == nullptr) ` instead of ` if (foo) ` and
203
+ ` foo != nullptr ` instead of ` !foo ` .
204
+
198
205
### Ownership and Smart Pointers
199
206
200
207
* [ R.20] : Use ` std::unique_ptr ` or ` std::shared_ptr ` to represent ownership
You can’t perform that action at this time.
0 commit comments