E.V.E  0.1-beta

◆ bitincrement

eve::bitincrement = {}
inlineconstexpr

Callable object computing the bit increment.

Required header: #include <eve/function/bitincrement.hpp>

Member Effect
operator() Computes the bitincrement constant

tempate < value T > T operator()( as<T> const & t) const noexcept;
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::bitincrement(as<T>()) returns a value of type T such as each element has all bits exept the lowest set to zero.


Example

See it live on Compiler Explorer

#include <eve/constant/bitincrement.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
using wide_it = eve::wide<std::int16_t>;
int main()
{
wide_ft wxf;
wide_it wxi;
std::cout << "---- simd" << '\n'
<< "-> bitincrement(as<wide_ft>()) = " << eve::bitincrement(eve::as<wide_ft>()) << '\n'
<< "-> bitincrement(as<wide_it>()) = " << eve::bitincrement(eve::as<wide_it>()) << '\n'
<< "-> bitincrement(as(wxf)) = " << eve::bitincrement(eve::as(wxf)) << '\n'
<< "-> bitincrement(as(wxi)) = " << eve::bitincrement(eve::as(wxi)) << '\n';
double xf;
std::int16_t xi;
std::cout << "---- scalar" << '\n'
<< "-> bitincrement(as<float>()) = " << eve::bitincrement(eve::as(float())) << '\n'
<< "-> bitincrement(as<std::int16_t>()) = " << eve::bitincrement(eve::as(std::int16_t())) << '\n'
<< "-> bitincrement(as<xf)) = " << eve::bitincrement(eve::as(xf)) << '\n'
<< "-> bitincrement(as<xi)) = " << eve::bitincrement(eve::as(xi)) << '\n';
return 0;
}
constexpr callable_bitincrement_ bitincrement
Callable object computing the bit increment.
Definition: bitincrement.hpp:54
Wrapper for SIMD registers.
Definition: wide.hpp:65