
13 Sep
2006
13 Sep
'06
6:45 p.m.
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.