◆ bitwise_not()

Value boost::simd::bitwise_not ( Value const &  x)

This function object returns the return the bitwise bitwise_not of the entry Infix notation can be used with operator '~' This is a convenience alias of complement.

Header <boost/simd/function/bitwise_not.hpp>
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
int main() {
pack_it pi = {1, 2, ~0, 1023};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "-> bs::bitwise_not(pi) = " << bs::bitwise_not(pi) << '\n';
std::uint32_t xi = 2;
std::cout << "---- scalar" << '\n'
<< "<- xi = " << xi << '\n'
<< "-> bs::bitwise_not(xi) = " << bs::bitwise_not(xi) << '\n';
return 0;
}
Possible output:
---- simd
<- pi = (1, 2, 4294967295, 1023)
-> bs::bitwise_not(pi) = (4294967294, 4294967293, 0, 4294966272)
---- scalar
<- xi = 2
-> bs::bitwise_not(xi) = 4294967293