E.V.E  0.1-beta

◆ any

eve::any = {}
inlineconstexpr

Callable object computing the any value.

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

Members Functions

Member Effect
operator() the computation of the any value
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

A bool value which is true if and only if any of elements of x is not zero.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/any.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = { 0.0f, 0.0f, -0.0f, -0.0f};
wide_it qi = {-1.0f, 02.0f, -3.0f, -0.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> any(pf != 0) = " << eve::any(pf != 0) << '\n'
<< "<- qi = " << qi << '\n'
<< "-> any(qi != 0) = " << eve::any(qi != 0) << '\n';
float xf = -0.0f;
float yf = -3.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> any(xf != 0) = " << eve::any(xf != 0) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> any(yf != 0) = " << eve::any(yf != 0) << '\n';
return 0;
}
constexpr callable_any_ any
Callable object computing the any value.
Definition: any.hpp:72
Wrapper for SIMD registers.
Definition: wide.hpp:65