◆ not_all_of()

template<typename T , typename Pred >
bool boost::simd::not_all_of ( T const *  first,
T const *  last,
Pred  f 

Returns true if pred returns false on any element in the range [first,last), and false otherwise (in particular when the range is empty).

firstBeginning of the range of elements to test
lastEnd of the range of elements
fpredicate function object that will be applied.
  • first and last must be pointers to Vectorizable type.
  • f must be a polymorphic unary function object, i.e cnot_allable on generic types.
  • if f is not present the function test if any element is zero
#include <boost/simd/algorithm/not_all_of.hpp>
#include <boost/simd/function/is_gtz.hpp>
#include <iostream>
#include <vector>
int main()
namespace bs = boost::simd;
std::vector<float> d{ 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f};
auto rt1 = bs::not_all_of( d.data(), d.data()+7, bs::is_gtz );
std::cout << "rt1 " << rt1 << "\n";
auto rf1 = bs::not_all_of( d.data(), d.data()+7, bs::is_gez);
std::cout << "rf1 " << rf1 << "\n";
auto rt2 = bs::not_all_of( d.data()+1, d.data()+8);
std::cout << "rt2 " << rt2 << "\n";
auto rf2 = bs::not_all_of( d.data()+2, d.data()+9);
std::cout << "rf2 " << rf2 << "\n";
return 0;
Possible output:
rt1 1
rf1 0
rt2 1
rf2 0