File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1818* [ Memory Management] ( #memory-management )
1919 * [ Memory allocation] ( #memory-allocation )
2020 * [ Use ` nullptr ` instead of ` NULL ` or ` 0 ` ] ( #use-nullptr-instead-of-null-or-0 )
21+ * [ Use explicit pointer comparisons] ( #use-explicit-pointer-comparisons )
2122 * [ Ownership and Smart Pointers] ( #ownership-and-smart-pointers )
2223 * [ Avoid non-const references] ( #avoid-non-const-references )
2324* [ Others] ( #others )
@@ -195,6 +196,12 @@ class FancyContainer {
195196
196197Further reading in the [ C++ Core Guidelines] [ ES.47 ] .
197198
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+
198205### Ownership and Smart Pointers
199206
200207* [ 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