Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-10 11:45:41


From: "Bertolt Mildner" <Bertolt.Mildner_at_[hidden]>
> "Peter Dimov" <pdimov_at_[hidden]> schrieb im Newsbeitrag
news:001801c258e7$27b15d20$1d00a8c0_at_pdimov2...
> > From: "Bertolt Mildner" <Bertolt.Mildner_at_[hidden]>
> > >>>"Peter Dimov" <pdimov_at_[hidden]> schrieb im Newsbeitrag
> > news:004301c258e2$cc559850$1d00a8c0_at_pdimov2...
> > > From: "Douglas Gregor" <gregod_at_[hidden]>
>
> [...]
> >> CW now gives me the same error in operator safe_bool() ...<<<
> >
> > I'm curious... Do you get an error when you put boost/shared_ptr.hpp in
a
> > precompiled header?
>
> No, I had no problems with Boost in precompiled headers so far except with
Boost.Function.
>
> I'm using shared_ptr, BOOST_STATIC_ASSERT, lexical_cast, Boost.Threads,
pool allocator, iterator adapters, any, ...<

shared_ptr reuses shared_ptr::get as the nonnull value, without a dummy
nested class:

    // implicit conversion to "bool"

    typedef T * (this_type::*unspecified_bool_type)() const;

    operator unspecified_bool_type() const // never throws
    {
        return px == 0? 0: &this_type::get;
    }

Perhaps something along these lines will work for boost::function.


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