E.V.E
v2023.02.15
Loading...
Searching...
No Matches

Detailed Description

template<typename C>
struct eve::if_< C >

Extensible wrapper for SIMD conditional.

Required header: #include <eve/conditional.hpp>

eve::if_ wraps a eve::logical value so that it can be either extended with an alternative value or an helper to optimize conditional operations evaluation.

Template Parameters
CType of the wrapped eve::logical value

Public Member Functions

 if_ (C c)
 Constructs a conditional expression from a eve::logical value.
template<typename V>
auto else_ (V const &v) const
 Extends a conditional expression with an alternative value.
template<typename T>
auto mask (eve::as< T > const &) const
 Computes the eve::logical_value associated to the current conditional.

Public Attributes

condition_
 Stored logical value.

Friends

template<typename Ch, typename Ct>
auto & operator<< (std::basic_ostream< Ch, Ct > &os, if_ const &c)
 Inserts a eve::if_ conditional expression into a output stream.

Member Function Documentation

◆ else_()

template<typename C>
template<typename V>
auto eve::if_< C >::else_ ( V const & v) const
inline

Extends a conditional expression with an alternative value.

By default, conditional operations use their unchanged input whenever the conditional evaluates to false. By using this member function, operations will use the user provided eve::value v instead.

Parameters
vValue to use if the conditional expression evaluates to false
Returns
An instance of eve::or_ wrapping current conditional expression with v.