I see that Microsoft stddef.h
defines it nullptr_t
this way:
namespace std
{
typedef decltype(__nullptr) nullptr_t;
}
using ::std::nullptr_t;
Ad using
embeds nullptr_t
in global namespace. I can not find anything in the standard that says this should be done.
I also see that GCC is nullptr_t
not 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 cstddef
following compiles with VC ( on the Internet too ).
#include <cstddef>
int main()
{
nullptr_t nil = nullptr;
}
Motti source
share