std::vector<Landmark>::const_iterator iter = std::find_if(v.begin(), v.end(), boost::bind<bool>(std::equal_tostd::string(), boost::bind(&Landmark::getName, _1), name_to_find));
I've not started using boost::bind yet, but I've been meaning to for some time, and I have read up on it, but one thing confuses me. Am I right in thinking that boost::bind will automatically detect whether the function call should be a->f(), a.f() or f(a)? If so, how does it handle the (admittedly very pathological) situation like this: struct B; struct A { bool f(); B* operator->(); }; struct B { bool f(); }; bool f(const A& a); std::vector<A> v; std::vector<A>::const_iterator iter = std::find_if(v.begin(), v.end(), boost::bind(&A::f, _1)); Presumably it does the right thing and calls A::f, but how does it do that? Cheers sam