◆ add
Callable object performing the sum of multiple values. Required header: Members Functions
Definition: value.hpp:31 Parameters
Return value A value of the common compatible type of all
auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::add Parameters
Return value A Callable object so that the expression Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/add.hpp>
#include <eve/function/saturated/add.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using w_t = eve::wide<std::int16_t, eve::fixed<4>>;
w_t pi = {3, 2, -32700, 32700}, qi = {4, 1, -100, 100};
std::cout << "---- simd" << '\n'
<< " <- qi = " << qi << '\n'
std::int16_t xi = 100, yi = 32700;
std::cout << "---- scalar" << '\n'
<< " <- xi = " << xi << '\n'
<< " <- yi = " << yi << '\n'
<< " -> xi + yi = " << xi + yi << '\n'; // C++ promotion to int
std::cout << "---- multi parameters" << '\n'
return 0;
}
constexpr saturated_type const saturated Higher-order Callable Object imbuing saturation semantic onto other Callable Objects. Definition: saturated.hpp:68 constexpr callable_add_ add Callable object performing the sum of multiple values. Definition: add.hpp:89 |