Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-05-01 10:06:47


on Wed Mar 19 2008, "Phil Bouchard" <philippe-AT-fornux.com> wrote:

> "Steven Watanabe" <watanabesj_at_[hidden]> wrote in message
> news:47DFF458.7010409_at_providere-consulting.com...
>
> [...]
>
>> Which compilers? IMO, you shouldn't make the code even more obscure until
>> it's known for certain to be a problem.
>
> Well 0 is considered to be a null pointer, not a pointer to 0x0000. This
> can potentially be replaced by "nullptr" in the next revision, which
> shouldn't be assumed to be a pointer to 0x0000. Having a non-null constant
> removes this nullness ambiguity.
>
> I see there is a BOOST_PYTHON_OFFSETOF macro that exists and which uses this
> technique. It is unfortunate offsetof() doesn't take a real
> pointer-to-member address.

That's only there because one old compiler's "standard" offsetof macro
was incorrectly generating errors, even for POD types. It's not a
justification for anything; just a workaround for a broken compiler.

-- 
Dave Abrahams
Boost Consulting
http://boost-consulting.com

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