Is this a valid null check on a DOUBLE pointer parameter passed in a function
if (!pdblValue) return E_POINTER;
Is this a valid null check on a DOUBLE pointer parameter passed in a function
if (!pdblValue) return E_POINTER;
Yes. Pointer evaluates to "yes" if it's non-zero, like every other primitive type in C++.
Assuming pdblValue is a pointer and it is set to NULL when initialised and invalid then yes.
In C++ the "if" statement uses a boolean expression. If it is true, it executes the part inside the conditional block. If it is false, it doesn't.
pdblValue is of type pointer. Negating it (!pdblValue) will give a long integer expression which is different to zero if the value of the pointer was NULL, and zero otherwise.
This will be converted into a boolean because that is what is needed in the condition. The different from zero value will be converted to true, and the zero value, to false.
Hence, this will have the same semantics than the more natural form:
if (pdblValue == NULL) ...
In which you are actually providing a boolean expression - the one that you were actually meaning.