24.4.3 Searching Algorithms - find_if
- Takes a predicate
- Identifies first element that satisfies predicate
- E.g., return the first leap year in a list of years:
list<int> years;
. . .
list<int>::iterator first_leap =
find_if(
years.begin(), years.end(), is_leap_year);
prev
|top
|next