
2 Jan
2008
2 Jan
'08
10:17 p.m.
On 02/01/2008, Robert Dailey
They are unrelated types.
But 0 is a compile-time integral constant with value 0, and is therefore implicitly convertible to any null pointer. Why do you think the comparison is any less portable than the initialization? And the reinterpret_cast is actually less portable, since it assumes that the null pointer is represented by a null bit sequence. The correct way to cast 0 to a null pointer is through static_cast (or boost::implicit_cast).