Quantifiers
all
Computes whether all elements of the range satisfy a predicate
.
predicate
must be a function that takes the range's element as input, and
returns a bool
indicating whether that element satisfied it, i.e. \(f(x) \mapsto bool\).
The operator has a complexity of \(O(N)\), where N
is the number of elements searched.
The search finishes as soon as an element does not satisfy the predicate.
template <typename TPredicate>
constexpr auto all( const TPredicate& predicate ) const -> bool;
Example | |
---|---|
any
Computes whether any element of the range satisfies a predicate
.
predicate
must be a function that takes the range's element as input, and
returns a bool
indicating whether that element satisfied it, i.e. \(f(x) \mapsto bool\).
The operator has a complexity of \(O(N)\), where N
is the number of elements searched.
The search finishes as soon as an element satisfies the predicate.
template <typename TPredicate>
constexpr auto any( const TPredicate& predicate ) const -> bool;
none
Computes whether none of the range's elements satisfy a predicate
.
predicate
must be a function that takes the range's element as input, and
returns a bool
indicating whether that element satisfied it, i.e. \(f(x) \mapsto bool\).
The operator has a complexity of \(O(N)\), where N
is the number of elements searched.
The search finishes as soon as an element satisfies the predicate.