find_if的STL定义:
template <class InputIterator, class Predicate>
InputIterator find_if(InputIterator first, InputIterator last,Predicate pred) { while (first != last && !pred(*first)) ++first; return first; //传入的是迭代器解引用后的}//例子1struct isWanted{ bool operator()(int a){ return a==5; }};int main(){ vector vec; vec.push_back(1); vec.push_back(2); vec.push_back(6); vec.push_back(5); vec.push_back(9); vec.push_back(0); vec.push_back(3); vector ::iterator ans=find_if(vec.begin(),vec.end(),isWanted()); cout<<