Boost logo

Boost Users :

From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2005-01-25 02:37:14

On Mon, 24 Jan 2005 17:09:10 -0800, Brian McCandless <bmccandl_at_[hidden]> wrote:
> Hi,
> I just upgraded from boost 1.29 to boost 1.32, and found that operator== for
> weak_ptr has been dropped between these versions. My code uses std::find to
> find a weak_ptr in a container. This no longer compiles (g++-3.4.1) since find
> uses operator==. Has anyone else encountered this kind of problem? What are
> some good workarounds? Could operator== be put back?
> Thanks,
> Brian

Make use weak_ptr::operator< (which IS in 1.32) by using
std::lower_bound. You'll still have to check for 'equality' of the
returned pointer (use !(A<B || B<A) for that).


Stuart Dootson

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at