◆ all()

bool boost::simd::all ( Value const &  x)

This function object returns true if all elements of the argument are non zero.

Header <boost/simd/function/all.hpp>
See also
ant, none, nbtrue
Example:
#include <boost/simd/pack.hpp>
#include <boost/simd/reduction.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack<float, 4>;
int main() {
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
pack_ft qf = {1.0f, 0.0f, -1.0f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::all(pf) = " << bs::all(pf) << '\n'
<< "<- qf = " << qf << '\n'
<< "-> bs::all(qf) = " << bs::all(qf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::all(pf) = 1
<- qf = (1, 2, -1, 0.5)
-> bs::all(qf) = 0