◆ bits()

as_integer_t<Value, unsigned> boost::simd::bits ( Value const &  x)

This function object returns an unsigned integer value which has the same bits as the input.

Header <boost/simd/function/bits.hpp>
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/pack.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};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::bits(pf) = " << bs::bits(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::bits(xf) = " << bs::bits(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::bits(pf) = (1065353216, 1073741824, 3212836864, 1056964608)
---- scalar
<- xf = 2
-> bs::bits(xf) = 1073741824