Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-08-15 23:20:43


"David Abrahams" <dave_at_[hidden]> wrote:
> I don't see what point you're trying to make. The stuff you've quoted
> doesn't change anything. (T*)1 is either undefined or unspecified behavior
> for any T you choose; I forget which.
>
> From: "Philippe A. Bouchard" <philippeb_at_[hidden]>
> >
> > k = ptrdiff_t((char *) (T *) (U *) 1 - (char *) 1)
> > K is some constant

5.2.10.5:
A value of integral type or enumeration type can be explicitly converted to
a pointer.10) A pointer converted to an integer of sufficient size (if any
such exists on the implementation) and back to the same pointer type will
have its original value; mappings between pointers and integers are
otherwise implementation-defined.

This implies the value shall not be aligned when converted. The constant is
thus irrelevant.

Philippe A. Bouchard


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