I see that Microsoft stddef.hdefines it nullptr_tthis way:
namespace std
{
typedef decltype(__nullptr) nullptr_t;
}
using ::std::nullptr_t;
Ad usingembeds nullptr_tin global namespace. I can not find anything in the standard that says this should be done.
I also see that GCC is nullptr_tnot part of the global namespace.
Is it possible to resolve both implementations or is one of them an error? My bad, GCC behaves just like CL.
Edit: The same thing happens with the cstddeffollowing compiles with VC ( on the Internet too ).
#include <cstddef>
int main()
{
nullptr_t nil = nullptr;
}
Motti source
share