E.V.E  0.1-beta

◆ inc

eve::inc = {}
inlineconstexpr

Callable object computing the inc unary operation.

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

Members Functions

Member Effect
operator() the inc unary operation
operator[] Construct a conditional version of current function object

auto operator()( value auto x ) const noexcept;
Definition: value.hpp:31

Parameters

x: value.

Return value

Computes elementwise a value with the same type as x. The result is x+1.


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::inc

Parameters

cond : conditional expression

Return value

A Callable object so that the expression inc[cond](x, ...) is equivalent to if_else(cond,inc(x, ...),x)


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/inc.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <eve/constant/mindenormal.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> eve::inc(pf) = " << eve::inc(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> eve::inc(xf) = " << eve::inc(xf) << '\n';
return 0;
}
constexpr callable_inc_ inc
Callable object computing the inc unary operation.
Definition: inc.hpp:73
Wrapper for SIMD registers.
Definition: wide.hpp:65