Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-13 13:53:41


"David Abrahams" <dave_at_[hidden]> wrote in message
news:ubr9ow6b6.fsf_at_boost-consulting.com...
| JOAQUIN LOPEZ MU?Z <joaquin_at_[hidden]> writes:

| >> There are other cases too. reinterpret_cast could map all
| >> pointers to
| >> the same integer.
| >
| > If you allow me to be a little pedantic, this is not the
| > case. reinterpret_cast<> guarantees back conversion, so it can't
| > possibly map every pointer into the same integer.
|

| 5 A value of integral type or enumeration type can be explicitly
| converted to a pointer. 64) 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.
|
| There's no guarantee that the integer type will have sufficient size.

BOOST_STATIC_ASSERT( sizeof(void*) >= sizeof(std::size_t))

?

-Thorsten


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