4#ifndef TETL_ALGORITHM_EQUAL_HPP
5#define TETL_ALGORITHM_EQUAL_HPP
7#include <etl/_functional/equal_to.hpp>
8#include <etl/_iterator/distance.hpp>
9#include <etl/_iterator/iterator_traits.hpp>
10#include <etl/_iterator/tags.hpp>
11#include <etl/_type_traits/is_base_of.hpp>
18template <
typename InputIt1,
typename InputIt2,
typename Predicate>
19[[nodiscard]]
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, Predicate p) ->
bool
21 for (; first1 != last1; ++first1, (
void)++first2) {
22 if (
not p(*first1, *first2)) {
30template <
typename InputIt1,
typename InputIt2>
31[[nodiscard]]
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) ->
bool
37template <
typename InputIt1,
typename InputIt2,
typename Predicate>
38[[nodiscard]]
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Predicate p)
45 if constexpr (
etl::is_base_of_v<Tag, Category1>
and etl::is_base_of_v<Tag, Category2>) {
46 if (
etl::distance(first1, last1) !=
etl::distance(first2, last2)) {
50 return etl::equal(first1, last1, first2, p);
54template <
typename InputIt1,
typename InputIt2>
55[[nodiscard]]
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) ->
bool
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) -> bool
Definition equal.hpp:31
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) -> bool
Definition equal.hpp:55
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Predicate p) -> bool
Definition equal.hpp:38
constexpr auto equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, Predicate p) -> bool
Returns true if the range [first1, last1) is equal to the range [first2, first2 + (last1 - first1)),...
Definition equal.hpp:19
Definition adjacent_find.hpp:9
Function object for performing comparisons. Unless specialised, invokes operator== on type T....
Definition equal_to.hpp:15
iterator_traits is the type trait class that provides uniform interface to the properties of LegacyIt...
Definition iterator_traits.hpp:48
Defines the category of an iterator. Each tag is an empty type and corresponds to one of the five (un...
Definition tags.hpp:37