}
template <typename InputIterator, typename T>
- bool contains(InputIterator first, InputIterator last, T value)
+ bool container_contains(InputIterator first, InputIterator last, T value)
{
return std::find(first, last, value) != last;
}
template <typename Container, typename T>
- bool contains(const Container& c, const T& value)
+ bool container_contains(const Container& c, const T& value)
{
- return contains(begin(c), end(c), value);
- }
-
- template <typename InputIterator, typename Predicate>
- bool all(InputIterator first, InputIterator last, Predicate p)
- {
- for (; first != last; ++first)
- if (!p(*first))
- return false;
- return true;
- }
- template <typename Container, typename Predicate>
- bool all(const Container& c, Predicate p)
- {
- return all(begin(c), end(c), p);
+ return container_contains(begin(c), end(c), value);
}
template <typename Container, typename T>