[lex.nullptr]:
:
nullptr
nullptr
. std::nullptr_t
. [: std::nullptr_t
- , , ; , . . 4.10 4.11. -end note]
Therefore, use nullptr
when you need a literal pointer, and std::nullptr_t
in the context when you need to take this type. The latter, for example, if you create a function or constructor or something that can take nullptr
as an argument.
Barry source
share