◆ any()

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

This function object returns true if at least one element of the argument is non zero.

Header <boost/simd/function/any.hpp>
See also
all, 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 = {0.0f, 0.0f, -0.0f, 0.0f};
pack_ft qf = {1.0f, 0.0f, -1.0f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::any(pf) = " << bs::any(pf) << '\n'
<< "<- qf = " << qf << '\n'
<< "-> bs::any(qf) = " << bs::any(qf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (0, 0, -0, 0)
-> bs::any(pf) = 0
<- qf = (1, 0, -1, 0.5)
-> bs::any(qf) = 1