I learned that nullptr, in addition to being convertible to any pointer type (but not to any integral type) also has its own type std::nullptr_t. So it is possible to have a method overload that accepts std::nullptr_t.
Exactly why is such an overload required?
If more than one overload accepts a pointer type, an overload for
std::nullptr_tis necessary to accept anullptrargument. Without thestd::nullptr_toverload, it would be ambiguous which pointer overload should be selected when passednullptr.Example: