I know that in C++ 0x
or NULL
was replaced by nullptr
in pointer-based applications. I'm just curious of the exact reason why they made this replacement?
In what scenario is using nullptr
over NULL
beneficial when dealing with pointers?
nullptr
is always a pointer type. 0
(aka. C's NULL bridged over into C++) could cause ambiguity in overloaded function resolution, among other things:
f(int);
f(foo *);