thrust::all_of
Defined in thrust/logical.h
- 
template<typename InputIterator, typename Predicate>
 bool thrust::all_of(InputIterator first, InputIterator last, Predicate pred)
- all_ofdetermines whether all elements in a range satisfy a predicate. Specifically,- all_ofreturns- trueif- pred(*i)is- truefor every iterator- iin the range- [first, last)and- falseotherwise.- #include <thrust/logical.h> #include <thrust/functional.h> ... bool A[3] = {true, true, false}; thrust::all_of(A, A + 2, ::cuda::std::identity{}); // returns true thrust::all_of(A, A + 3, ::cuda::std::identity{}); // returns false // empty range thrust::all_of(A, A, ::cuda::std::identity{}); // returns true - See also - any_of - See also - none_of - See also - transform_reduce - 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. 
 
- Returns
- true, if all elements satisfy the predicate;- false, otherwise.