Replace NULL with nullptr
From the cpp core guidelines: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nullptr
Reason
Readability. Minimize surprises: nullptr
cannot be confused with an int
. nullptr
also has a well-specified (very restrictive) type, and thus works in more scenarios where type deduction might do the wrong thing on NULL
or 0
.
Consider:
void f(int);
void f(char*);
f(0); // call f(int)
f(nullptr); // call f(char*)