E.V.E
v2022.09.01

◆ slice() [2/2]

template<arithmetic_scalar_value Type, typename Cardinal >
template<std::size_t Slice>
auto eve::logical< wide< Type, Cardinal > >::slice ( slice_t< Slice >  s) const
inline

Return the upper or lower half-sized slice of a eve::logical. Does not participate in overload resolution if Cardinal::value == 1.

See also
eve::upper_
eve::lower_
Parameters
sA tag indicating which slice is required

Example:

See it live on Compiler Explorer

#include <eve/logical.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
// Generates the logical<wide> [true false true .. ]
eve::logical<eve::wide<int>> r = [](auto i, auto) { return i%2 == 0;};
std::cout << r << "\n";
auto lo = r.slice(eve::lower_);
auto hi = r.slice(eve::upper_);
std::cout << lo << " " << hi << "\n";
}
constexpr callable_i_ i
Callable object computing the pure imaginary ( ) value.
Definition: i.hpp:51
constexpr callable_hi_ hi
Computes the most significant half of each lane.
Definition: hi.hpp:54
constexpr callable_lo_ lo
Computes the least significant half of each lane.
Definition: lo.hpp:54