Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-09-13 14:45:06


Alexander Shyrokov wrote:
> I want to call a member function with a parameter from within an
> algorithm.
>
> http://boost.org/libs/bind/bind.html#with_algorithms gives an example:
>
> void animation::advance(int ms);
> std::vector<animation> anims;
> std::for_each(anims.begin(), anims.end(),
> boost::bind(&animation::advance, _1, ms));
>
> I am using boost::lambda:: before _1. I get an error error C2825:
> 'F::result_type': cannot form a qualified name
>
> I am using MS VC7.1 and boost_1_33_1
>
> Any ideas why this does not work? Thanks.

In 1.33, you can't use boost::bind with Lambda's placeholders. Either use
Bind's ::_1 placeholder, or use boost::lambda::bind.

In 1.35, the code will work even with Lambda's placeholder.


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