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

◆ none_of

eve::algo::none_of = function_with_traits<none_of_>
inlineconstexpr

#include <eve/module/algo/algo/none_of.hpp>

Tests if none of the elements in the range match the predicate. by default aligns and unrolls 4 times.

Alternative Header

#include <eve/algo.hpp>

Callable Signatures

namespace eve::algo
{
template <eve::algo::relaxed_range Rng, typename P>
bool none_of(Rng&& rng, P p);
}
constexpr auto none_of
a SIMD version of std::none_of
Definition: none_of.hpp:68

Parameters

  • rng: Relaxed input range to process
  • 'p': Predicate

Return value

true if p returns true for no elements in the range, false otherwise. Returns true if the range is empty.

Example

#include <eve/module/core.hpp>
#include <eve/module/algo.hpp>
#include <iostream>
#include <vector>
#include <tts/tts.hpp>
int main()
{
std::vector<int> v = {2,5,-9,3,-8,2,-5,7,-2,3};
std::cout << " -> v = "
<< tts::as_string(v)
<< "\n";
std::cout << " -> eve::algo::none_of(v, i == 0) = "
<< std::boolalpha << eve::algo::none_of(v, [](auto i){ return i == 0; })<< "\n";
std::cout << " -> eve::algo::none_of(v, eve::is_ltz) = "
<< std::boolalpha << eve::algo::none_of(v, eve::is_ltz)<< "\n";
return 0;
}
constexpr auto is_ltz
elementwise callable returning a logical true if and only if the element value is less than 0.
Definition: is_ltz.hpp:71