Boost logo

Boost Users :

From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-01-02 17:17:44


On 02/01/2008, Robert Dailey <rcdailey_at_[hidden]> wrote:
> 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).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net