Monday, 9 September 2013

Coding standards for comparing pointer to NULL

Coding standards for comparing pointer to NULL

Are there any coding guidelines on what comparison, either:
if (ptr != nullptr) ...
or
if (ptr) ...
is better in C++(11)?
This question is not duplicate of C: Comparison to NULL, in the latter it
is said that these forms are equivivalent in C.
Neither this question is opition based: I'm not asking of what do you
prefer, but whether there are any coding standards or guidelines, which
tell to prefer one form or another.

No comments:

Post a Comment