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

◆ equal

auto eve::algo::equal = function_with_traits<equal_>[all_of.get_traits()]
inlineconstexpr

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

Tests wether two ranges are equal (accepts anything that zips together as a range of 2 things) By default aligns and unrolls 4 times.

Alternative Header

#include <eve/algo.hpp>

Callable Signatures

namespace eve::algo
{
template <zipped_range_pair Rng>
bool equal(Rng&& rng); // 1
template <zipped_range_pair Rng, typename P>
bool equal(Rng&& rng, P p); // 2
template<typename R1, typename R2>
bool equal(R1&& r1, R2&& r2) requires zip_to_range<R1, R2>; // 3
template<typename R1, typename R2, typename P>
bool equal(R1&& r1, R2&& r2, P p) requires zip_to_range<R1, R2>; // 4
}
constexpr auto equal
a SIMD version of std::equal
Definition equal.hpp:111
  1. Compare both halves of zipped_range_pair for equality
  2. Compare both halves of zipped_range_pair for equivalence using predicate P
  3. Compare r1 and r2 that zip together to zip_range_pair for equality
  4. Compare r1 and r2 that zip together to zip_range_pair for equivalence using predicate P
Note
1. and 3. will convert to common type to do equality comparison if necessary to get the same for custom predicate, use [common_type] trait on your zip.
to better understand the zip interfaces, have a look at examples/algorithms/using_existing/memcmp_... or examples/algorithms/using_existing/case_insensitive....

Parameters

  • rng: zipped pair of 2 ranges to compare
  • 'r1,r2- two separate components thatzipto azipped_range_pair ! *p` - binary predicate for equivelence testing.
      **Return value**
    
      bool wether any values matched the predicate
    
      <h2 class="groupheader"> Example </h2>
    
      @include doc/algo/equal.cpp