Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::bind used with boost shared_ptr
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-03-04 14:49:41


Kevin Ludwig:
> Hi,
>
> I've recently been making more use of boost::bind, and I coded the
> following, which I thought would work:
>
> class A {
> public:
> void reset () {}
> };
> typedef std::map<int, boost::shared_ptr<A> > map_type;
> map_type m;
> std::for_each (m.begin(), m.end(),
> boost::bind(&A::reset,
> boost::bind(&map_type::value_type::second, _1)));
>
> but fails to compile.

This compiles for me with MSVC 7.1. What compiler and Boost version do you
use? What errors do you get?


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