View Problem

Test if a condition holds for any items of a list

Given a list, test if a certain logical condition (i.e. predicate) holds for any items of the list.
ExpandDiskEdit
cpp boost
template <typename InputIterator, typename Predicate>
bool match_any(InputIterator first, InputIterator last, Predicate pred)
{
return find_if(first, last, pred) != last;
}

Submit a new solution for cpp
There are 12 other solutions in additional languages (clojure, erlang, fantom, fsharp ...)