Boost logo

Boost Users :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-09-10 08:49:40


On Tuesday 10 September 2002 08:29 am, Bertolt Mildner wrote:
> [...]
>
> > I have tried to make nonnull() inline and/or static but that didn't help.
> > I think the root of the problem is that the address of nonnull() is
> > taken. I wonder if it is really needed to return a real (member) function
> > pointer or if it would be OK to just return (safe_bool)1 ?
>
> Don't know if this is useful but at least it makes my compiler more happy
[snip]
> > { return (this->empty())? 0 : (safe_bool)~0; }
> > { return (this->empty())? (safe_bool)~0 : 0; }

Unfortunately, that invokes implementation-defined behavior, because
(safe_bool)~0 may or may not be the null pointer.

Perhaps if we made nonnull a function template it would make precompiled
headers possible again... (I _really_ wish I had this compiler to try things
on, but thanks for helping out!)

        Doug


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