Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
find_if
Algorithm
Summary
Find an occurrence of value in a sequence that satisfies a specifed predicate.
Contents
Synopsis
Description
Complexity
Example
Warning
See Also
Synopsis
#include <algorithm>
template <class InputIterator, class Predicate>
InputIterator find_if(InputIterator first,
InputIterator last,
Predicate pred);
Description
The find_if algorithm allows you to search for the first element in a sequence that satisfies a
particular condition. The sequence is defined by iterators first and last, while the condition is
defined by the third argument: a predicate function that returns a boolean value. find_if returns
the first iterator i in the range [first, last) for which the following condition holds: