C++0x 標準に関する記事を読みました: http://www.softwarequalityconnection.com/2011/06/the-biggest-changes-in-c11-and-why-you-should-care/
厳密に型指定さnullptr
れている、つまり整数の 0 と区別できるということです。
f(int);
f(char* p);
f(nullptr); // calls char* version
nullptr
それはすべて良いことですが、2 つのポインター関数について標準が何を言っているのかを知ることに興味があります。
f(char* p);
f(int* p);
f(nullptr);
ここでキャストが必要ですか?そして、nullptr
テンプレート化されていますか?
f((int*)(nullptr);
f(static_cast<int*>(nullptr));
f(nullptr<int>); // I would prefer this