The standard indicates in clause 2.2.14.1 that:
The pointer literal is the nullptr keyword. This value is of type std::nullptr_t . [Note: std::nullptr_t is a separate type that is neither a pointer type nor a pointer to a member type; rather, a prvalue of this type is a null pointer constant and can be converted to a null pointer value or a null element pointer value. -endnote]
The only prvalue of type nullptr_t is nullptr , which is then converted to another type of pointer, following the rules specified in paragraphs. 4.10 and § 4.11.
Other integer literals can be converted to a value of type std::nullptr_t according to §4.10.1:
The null pointer constant is an integer literal (2.14.2) with a value of 0 or prvalue of type std::nullptr_t .
This way you can use a mediation literal with a value of zero or nullptr .
In particular:
00u , 0u0l , 0l0ul , 0ul , 0ul , 0ul0ll , 0ll0ull , 0ull , 0ullnullptrNULL
Perhaps I missed some cases, so I could not fix me.
source share