diff --git a/include/boost/algorithm/cxx11/any_of.hpp b/include/boost/algorithm/cxx11/any_of.hpp index c3ab3ce59..0c15ca402 100644 --- a/include/boost/algorithm/cxx11/any_of.hpp +++ b/include/boost/algorithm/cxx11/any_of.hpp @@ -35,10 +35,7 @@ using std::any_of; // Section 25.2.2 template bool any_of ( InputIterator first, InputIterator last, Predicate p ) { - for ( ; first != last; ++first ) - if ( p(*first)) - return true; - return false; + return std::find_if(first, last, p) != last; } #endif @@ -66,10 +63,7 @@ bool any_of ( const Range &r, Predicate p ) template bool any_of_equal ( InputIterator first, InputIterator last, const V &val ) { - for ( ; first != last; ++first ) - if ( val == *first ) - return true; - return false; + return std::find(first, last, val) != last; } /// \fn any_of_equal ( const Range &r, const V &val )