要約:nullptr
に変換しbool
、 にbool
変換するのにint
、なぜ にnullptr
変換しないのint
ですか?
このコードは問題ありません:
void f(bool);
f(nullptr); // fine, nullptr converts to bool
そして、これは大丈夫です:
bool b;
int i(b); // fine, bool converts to int
では、なぜこれは大丈夫ではないのでしょうか。
void f(int);
f(nullptr); // why not convert nullptr to bool, then bool to int?