Strong typing of nullptr?

Viewed 892

I just read an article on the C++0x standard: http://www.softwarequalityconnection.com/2011/06/the-biggest-changes-in-c11-and-why-you-should-care/

It said nullptr was strongly typed, meaning that it can be distinguished from an integer 0.

f(int);
f(char* p);

f(nullptr); // calls char* version

That's all good, but I'm interesting in knowing what the standard says about nullptr with two pointer functions:

f(char* p);
f(int* p);

f(nullptr);

Do I need a cast here? And is nullptr templated?

f((int*)(nullptr);
f(static_cast<int*>(nullptr));
f(nullptr<int>);               // I would prefer this
1 Answers
Related