◆ none()

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

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

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