find_if
Prototypetemplate<class InputIterator, class Predicate> InputIterator find_if(InputIterator first, InputIterator last, Predicate pred); DescriptionReturns the first iterator DefinitionDefined in the standard header algorithm, and in the nonstandard backward-compatibility header algo.h. Requirements on types
Preconditions
ComplexityLinear: at most ExampleList<int> L; L.push_back(-3); L.push_back(0); L.push_back(3); L.push_back(-2); List<int>::iterator result = find_if(L.begin(), L.end(), bind2nd(greater<int>(), 0)); assert(result == L.end() || *result > 0); NotesSee alsofind. |