find_if

template<class InIt, class Pred>
    InIt find_if(InIt first, InIt last, Pred pr);

The template function determines the lowest value of N in the range [0, last - first) for which the predicate pred(*(first + N)) is true. It then returns first + N. If no such value exists, the function returns last. It evaluates the predicate once, at most, for each N.

See the related sample program.