Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2004-02-12 19:24:40


On Fri, 13 Feb 2004 01:22:10 +0200, "Peter Dimov" <pdimov_at_[hidden]>
wrote:

>He is right, but not because of 5.2.10/8. :-) 5.2.10/5 + footnote 64 say you
>are home free.

Hmm... I think a committee clarification is in order: 5.2.10/8
mentions "null pointer value", not "null pointer constant". That seems
intentional, but then the footnote makes a special case for any
integral constant expression (even if lvalue). Furthermore, that's a
footnote... I don't see anything in normative text supporting it; and
it seems more useful to have static_cast and reinterpret_cast work
differently.

Note that, if the footnote is correct, to have reinterpret_cast
semantics you have to use a non-const intermediary, for instance an
int variable:

  int v = 0;
  reinterpret_cast<T*>(v); // implementation defined.

  reinterpret_cast<T*>(0); // null pointer value of type T*
  const int W = 0;
  reinterpret_cast<T*>(w); // null pointer value of type T*

Nightly yours ;)
Genny.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk