What is the correct boost::bind syntax to use with a standard algorithm such as find_if with an array of weak_ptrs or shared_ptrs to an object such as a string?
My weak attempt to figure this out is below:
shared_ptr<string> sp1(new string("Play "));
shared_ptr<string> sp2(new string("with "));
shared_ptr<string> sp3(new string("C++!"));
vector a_vector;
a_vector.push_back(weak_ptr<string>(sp1));
a_vector.push_back(weak_ptr<string>(sp2));
a_vector.push_back(weak_ptr<string>(sp3));
// What is the correct syntax here?
find_if(a_vector.begin(), a_vector.end(), (bind(&equal_to<string>(), _1))(string("Play "));
Thanks,
Graham
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/