25 Algorithms library [algorithms]

25.5 Non-modifying sequence operations [alg.nonmodifying]

25.5.1 All of [alg.all.of]

template<class InputIterator, class Predicate> constexpr bool all_of(InputIterator first, InputIterator last, Predicate pred); template<class ExecutionPolicy, class ForwardIterator, class Predicate> bool all_of(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); template<input_iterator I, sentinel_for<I> S, class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); template<input_range R, class Proj = identity, indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {});
Let E be pred(*i) and invoke(pred, invoke(proj, *i)) for the overloads in namespace std and std​::​ranges, respectively.
Returns: false if E is false for some iterator i in the range [first, last), and true otherwise.
Complexity: At most last - first applications of the predicate and any projection.