3#ifndef TETL_ALGORITHM_IS_PERMUTATION_HPP
4#define TETL_ALGORITHM_IS_PERMUTATION_HPP
22template <
typename ForwardIt1,
typename ForwardIt2>
23[[nodiscard]]
constexpr auto is_permutation(ForwardIt1 first, ForwardIt1 last, ForwardIt2 first2) ->
bool
26 auto const [fDiff1, fDiff2] =
etl::mismatch(first, last, first2);
32 for (
auto i = fDiff1; i != last; ++i) {
49template <
typename ForwardIt1,
typename ForwardIt2>
50[[nodiscard]]
constexpr auto is_permutation(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, ForwardIt2 last2)
58 if constexpr (lhsIsRandomIt and rhsIsRandomIt) {
constexpr auto mismatch(InputIt1 first1, InputIt1 last1, InputIt2 first2, Predicate pred) -> pair< InputIt1, InputIt2 >
Returns the first mismatching pair of elements from two ranges: one defined by [first1,...
Definition mismatch.hpp:25
constexpr auto is_permutation(ForwardIt1 first, ForwardIt1 last, ForwardIt2 first2) -> bool
Returns true if there exists a permutation of the elements in the range [first1, last1) that makes th...
Definition is_permutation.hpp:23
constexpr auto count(InputIt first, InputIt last, T const &value) -> typename iterator_traits< InputIt >::difference_type
Returns the number of elements in the range [first, last) satisfying specific criteria....
Definition count.hpp:21
constexpr auto find(InputIt first, InputIt last, T const &value) noexcept -> InputIt
Searches for an element equal to value.
Definition find.hpp:18
constexpr auto next(InputIt it, typename iterator_traits< InputIt >::difference_type n=1) -> InputIt
Return the nth successor of iterator it.
Definition next.hpp:14
constexpr auto distance(It first, It last) -> typename iterator_traits< It >::difference_type
Returns the number of hops from first to last.
Definition distance.hpp:16
Definition adjacent_find.hpp:8
constexpr bool is_base_of_v
Definition is_base_of.hpp:39
Defines the category of an iterator. Each tag is an empty type and corresponds to one of the five (un...
Definition tags.hpp:36