Template Function thrust::none_of(InputIterator, InputIterator, Predicate)¶
Function Documentation¶
-
template<typename
InputIterator
, typenamePredicate
>
boolthrust
::
none_of
(InputIterator first, InputIterator last, Predicate pred) none_of
determines whether no element in a range satifies a predicate. Specifically,none_of
returnstrue
if there is no iteratori
in the range[first, last)
such thatpred(*i)
istrue
, andfalse
otherwise.#include <thrust/logical.h> #include <thrust/functional.h> ... bool A[3] = {true, true, false}; thrust::none_of(A, A + 2, thrust::identity<bool>()); // returns false thrust::none_of(A, A + 3, thrust::identity<bool>()); // returns false thrust::none_of(A + 2, A + 3, thrust::identity<bool>()); // returns true // empty range thrust::none_of(A, A, thrust::identity<bool>()); // returns true
- Return
true
, if no element satisfies the predicate;false
, otherwise.- Parameters
first
: The beginning of the sequence.last
: The end of the sequence.pred
: A predicate used to test range elements.
- Template Parameters
InputIterator
: is a model of Input Iterator,Predicate
: must be a model of Predicate.
- See
all_of
- See
any_of
- See
transform_reduce