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

◆ reverse_conditional()

template<eve::relative_conditional_expr C, typename T >
auto eve::reverse_conditional ( C c,
eve::as< T > tgt )
constexpr

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

For a given eve::relative_conditional_expr c, optimally computes the reverse eve::relative_conditional_expr for a given type T. For example, ignoring the first N lanes get reversed as ignoring the last N lanes.

Parameters
cCondition to reverse
tgtWrapped type of the expected output
Returns
The exact semantic opposite of c with the same internal state.

Example

#include <iostream>
#include <eve/wide.hpp>
#include <eve/conditional.hpp>
int main()
{
std::cout << eve::ignore_all << " -> "
std::cout << eve::ignore_none << " -> "
std::cout << eve::keep_first(1) << " -> "
std::cout << eve::ignore_last(1) << " -> "
}
constexpr auto reverse_conditional(C c, eve::as< T > tgt)
Computes the reverse of a given eve::relative_conditional_expr.
Definition conditional.hpp:710
constexpr ignore_all_ ignore_all
Object representing the eve::ignore_all_ conditional expression.
Definition conditional.hpp:195
constexpr ignore_none_ ignore_none
Object representing the eve::ignore_none_ conditional expression.
Definition conditional.hpp:258
Lightweight type-wrapper.
Definition as.hpp:29
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Conditional expression selecting the k first lanes from a eve::simd_value.
Definition conditional.hpp:268