Firstly, std::nullptr_t
is a core language type, so why is it in the std
namespace? You don't see std::char
or std::int
.
Secondly, where is it in the std
namespace? When I right click in Visual Studio to see where it is declared, it says "the symbol nullptr_t is not located in any source file." If std::nullptr_t
is not declared in the std
namespace, why does code containing std::nullptr_t
compile?
EDIT: This link on microsoft's website says nullptr is a built in type, and that built in types are not defined in header files.
std::nullptr_t is a core language type
no, it is notwhere is it in the std namespace?
Defined in header <cstddef> see en.cppreference.com/w/cpp/types/nullptr_tchar
andint
are keywords. They are reserved and aren't scoped to a namespace.std::nullptr_t
is not even a pointer type.using nullptr_t = decltype(nullptr);