11 Dec
2006
11 Dec
'06
5:39 p.m.
On 12/10/06, Santosh Joseph
boost::function
f = bind(&test_str::str, Arg); //for_each( v2.begin(), v2.end(), bind( insert_func, var(str_con), var(f)));
I think this is because f is a is a boost::function object. You'e trying to pass a functor object to a function that takes a std::string& argument, and that's what the error is saying that it can't coerce f to a std::string type. Instead of using a boost::function<...> object try passing it directly to the expression, like as follows. for_each( v2.begin(), v2.end(), bind( insert_func, var(str_con), bind(&test_str::str, Arg))); the boost::lambda::bind function returns a lambda functor. HTH