Don’t use zero as null pointer constant.
From the developer notes:
nullptris preferred overNULLor(void*)0.
From the C++ Core Guidelines:
ES.47: Use
nullptrrather than0orNULLReason Readability. Minimize surprises:nullptrcannot be confused with anint.nullptralso has a well-specified (very restrictive) type, and thus works in more scenarios where type deduction might do the wrong thing onNULLor0.
Found by compiling the project with -Wzero-as-null-pointer-constant and fixing where appropriate (skipping false positives).