namespace eve::algo
{
template <eve::algo::relaxed_range Rng>
}
unaligned_t< iterator_t< R > > unaligned_iterator_t
Unaligned iterator for a relaxed range.
Definition ranges_types.hpp:68
constexpr auto find_last
a version of find_last_if with a value to find instead of a predicate to test.
Definition find_last.hpp:184
typename decltype(detail::value_type_impl< T >())::type value_type_t
A meta function for getting an associated value_type for a relaxed iterator/range.
Definition value_type.hpp:94
#include <eve/module/core.hpp>
#include <eve/module/algo.hpp>
#include <tts/tts.hpp>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> v{12, 0, 5, -9, 3, 0, 5};
std::cout << " -> v = "
<< tts::as_string(v)
<< "\n";
std::cout << " <- eve::algo::find_if(v, eve::is_eqz) - v.begin() = " << pos - v.begin() << "\n";
std::cout << " <- eve::algo::find_last_if(v, eve::is_eqz) - v.begin() = " << pos_b - v.begin() << "\n";
std::cout << " <- eve::algo::find_last_if_not(v, x < 0) - v.begin() = " << pos_bn - v.begin() << "\n";
std::cout << " <- eve::algo::find_last(v, 5) - v.begin() = " << pos_bv - v.begin() << "\n";
return 0;
}
constexpr auto find_last_if
SIMD version of std::ranges::find_last_if
Definition find_last.hpp:135
constexpr auto find_last_if_not
a version of find_last_if where the preicate is negated
Definition find_last.hpp:233
constexpr auto find_if
SIMD version of std::find_if.
Definition find.hpp:130
constexpr auto is_eqz
elementwise callable returning a logical true if and only if the element value is zero.
Definition is_eqz.hpp:72