I see that Microsoft's stddef.h
defines nullptr_t
thus:
namespace std
{
typedef decltype(__nullptr) nullptr_t;
}
using ::std::nullptr_t;
The using
decleration injects nullptr_t
into the global namespace. I can't find anything in the standard that says that this should be done.
I also see that in GCC nullptr_t
isn't in the global namespace.
Can both implementations be allowed or is one of them a bug?
My bad, GCC behaves the same as CL.
Edit: The same happens with cstddef
, the following compiles fine with VC (online too).
#include <cstddef>
int main()
{
nullptr_t nil = nullptr;
}
using ::std::nullptr_t;
andusing std::nullptr_t;
? Nice question btw.namespace foo { namespace std { using nullptr_t = int } using std::nullptr_t; }
.