◆ compare_equal()

bool boost::simd::compare_equal ( Value const &  x,
Value const &  y 
)

This function object returns all(x == y), i.e.

return true if and only if all corresponding entries elements are equal.

Header <boost/simd/function/compare_equal.hpp>
Example:
#include <boost/simd/pack.hpp>
#include <boost/simd/reduction.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_it = bs::pack<std::int32_t, 4>;
int main() {
pack_it pi = {1, 2, 5, 2};
pack_it qi = {0, 1, 2, 8};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "<- qi = " << qi << '\n'
<< "-> bs::compare_equal(pi, pi) = " << bs::compare_equal(pi, pi)
<< '\n'
<< "-> bs::compare_equal(pi, qi) = " << bs::compare_equal(pi, qi)
<< '\n';
return 0;
}
Possible output:
---- simd
<- pi = (1, 2, 5, 2)
<- qi = (0, 1, 2, 8)
-> bs::compare_equal(pi, pi) = 1
-> bs::compare_equal(pi, qi) = 0