The Standard states, that nullptr
is a pointer literal of type std::nullptr_t
(2.14.7). And 18.2p9 defines nullptr_t
by
namespace std {
typedef decltype(nullptr) nullptr_t;
}
By 7.1.6.2p4 decltype(nullptr)
is the type of the expression nullptr
, which is by definition std::nullptr_t
(since the expression nullptr
is a prvalue). Substituting that into the definition of nullptr_t
results in
typedef nullptr_t nullptr_t
On the other hand a typedef specifier does not introduce a new type, it's just a name for another existing type. So, what is exactly nullptr_t
? I'm not able to comprehend these definitions.