That would require p to be an adaptable predicate (e.g. derive from std::unary_function). It's the same problem as with copy_if. |

This algorithm returns true if the predicate is true for all elements in the range.

template <typename InputIterator, typename Predicate> bool all(InputIterator first, InputIterator last, Predicate p) { for (; first != last; ++first) if (!p(*first)) return false; return true; }

Couldn't this be more simply stated as:

template <typename InputIterator, typename Predicate> bool all_if(InputIterator first, InputIterator last, Predicate p) { return std::find_if(first, last, std::not1(p)) == last; }

?

That would require

Disclaimer: This site not officially maintained by Boost Developers