Boost logo

Boost Users :

From: Dave Steffen (dgsteffen_at_[hidden])
Date: 2008-01-02 19:29:43


On Wednesday 02 January 2008, Scott McMurray wrote:
> On 02/01/2008, Robert Dailey <rcdailey_at_[hidden]> wrote:
> > Where in the standard does it state that assigning an integral constant
> > to a pointer type is legal? Perhaps there is some more generic rule in
> > the standard to which this concept applies.
>
> 4.10 Pointer conversions [conv.ptr]
> 1) A null pointer constant is an integral constant expression (5.19)
> rvalue of integer type that evaluates to zero. A null pointer constant
> can be converted to a pointer type; the result is the null pointer
> value of that type and is distinguishable from every other value of
> pointer to object or pointer to function type. Two null pointer values
> of the same type shall compare equal.

  Those interested should check out
  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
  "A name for the null pointer: nullptr (revision 4)". It's not in
  the draft standard yet, but will be soon. IIRC it also contains an
  excellent discussion of the issues involved.

-- 
Dave Steffen - Software Engineer 4
Numerica Corporation (www.numerica.us <http://www.numerica.us/> ) 
4850 Hahns Peak Drive, Suite 200
Loveland, Colorado 80538
main (970) 461-2000 
direct (970) 461-2422 x227
fax (970) 461-2004
Email: dave.steffen_at_[hidden]
This message and any attachments are intended only for the individual
or entity to which the message is addressed.  This is a private
message and may contain privileged information.  If you are neither
the intended recipient nor the agent responsible for delivering the
message to the intended recipient, you are hereby notified that any
review, retransmission, dissemination, or taking of any action in
reliance upon, the information in this communication is strictly
prohibited, and may be unlawful.  If you feel you have received this
communication in error, please notify me immediately by returning this
email to me and deleting it from your computer.

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