nullptr is a keyword that can be used at all places where NULL is expected. Like NULL, nullptr is implicitly convertible and comparable to any pointer type. Unlike NULL, it is not implicitly convertible or comparable to integral types.
std::nullptr_t is the type of the null pointer literal, nullptr. It is a distinct type that is not itself a pointer type or a pointer to member type. Its values are null pointer constants (see NULL), and may be implicitly converted to any pointer and pointer to member type.
The nullptr keyword specifies a null pointer constant of type std::nullptr_t , which is convertible to any raw pointer type. Although you can use the keyword nullptr without including any headers, if your code uses the type std::nullptr_t , then you must define it by including the header <cstddef> . Note.
- In the context of a direct-initialization, a bool object may be initialized from a prvalue of type std::nullptr_t, including nullptr. The resulting value is false.
If I am talking about nullptr
, is the correct terminology the nullptr
(there is only one, and all mentions are references to the same thing), or a nullptr
(there are several identical things).
That is, should function documentation say
If ptr is the
nullptr
, the function uses an internal buffer...
or
If ptr is a
nullptr
, the function uses an internal buffer...
(Pedantically, this is not an opinion based question, because it can be answered by reference to what exactly nullptr
is)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With