In C++98, the null pointer was represented by the literal 0
(or in fact any constant expression whose value was zero). In C++11, we prefer nullptr
The = 0
syntax wasn't used to initialize a pointer, it was simply to indicate syntactically that the provided virtual
was pure.
Hence the = 0
syntax for declaring pure virtual
s is unchanged.
Because the syntax says 0
, not expression or some other non-terminal matching nullptr
.
For all the time only 0
has worked. Even 0L
would be ill-formed because it does not match the syntax.
Edit
Clang allows = 0x0
, = 0b0
and = 00
(31.12.2013). That is incorrect and should be fixed in the compiler, of course.