A null pointer constant can be
converted to a pointer type; the
result is the null pointer value of that type ([basic.compound]
) and is
distinguishable from every other value of
object pointer or function pointer
Two null pointer values of the same type shall compare
The conversion of a null pointer constant to a pointer to
cv-qualified type is a single conversion, and not the sequence of a
pointer conversion followed by a qualification
A null pointer constant of integral type
can be converted to a prvalue of type std::nullptr_t.
The resulting prvalue is not a null pointer value.
— end note
A prvalue of type “pointer to cv D
”, where D
is a complete class type, can be converted to a prvalue of type “pointer to
”, where B
is a base class ([class.derived]
The result of the
conversion is a pointer to the base class subobject of the derived class
The null pointer value is converted to the null pointer value of
the destination type.