aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2022-08-04 10:54:13 -0700
committerTom Stellard <tstellar@redhat.com>2022-08-08 13:29:17 -0700
commit80f03ecb130d8d16f5c747bd4a4d0146734e7d81 (patch)
treec255ba8dbcfc124784803ec08c24b8c56ab3b666 /libcxx/include/algorithm
parent1711b90981ff1be8fe5c04f0b9caaeb8a23f3235 (diff)
downloadllvm-80f03ecb130d8d16f5c747bd4a4d0146734e7d81.zip
llvm-80f03ecb130d8d16f5c747bd4a4d0146734e7d81.tar.gz
llvm-80f03ecb130d8d16f5c747bd4a4d0146734e7d81.tar.bz2
[libc++][ranges] Implement `ranges::is_permutation`
Co-authored-by: Konstantin Varlamov <varconst@apple.com> Differential Revision: https://reviews.llvm.org/D127194 (cherry picked from commit 4038c859e58c12e997041927a87e880f2f3ef883)
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm16
1 files changed, 16 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index bf8a984..69ada03 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -793,6 +793,21 @@ namespace ranges {
borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // Since C++20
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
+ sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity,
+ indirect_equivalence_relation<projected<I1, Proj1>,
+ projected<I2, Proj2>> Pred = ranges::equal_to>
+ constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2,
+ Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+
+ template<forward_range R1, forward_range R2,
+ class Proj1 = identity, class Proj2 = identity,
+ indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>,
+ projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to>
+ constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+
+ template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
sentinel_for<I2> S2, class Pred = ranges::equal_to,
class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
@@ -1794,6 +1809,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/ranges_is_heap.h>
#include <__algorithm/ranges_is_heap_until.h>
#include <__algorithm/ranges_is_partitioned.h>
+#include <__algorithm/ranges_is_permutation.h>
#include <__algorithm/ranges_is_sorted.h>
#include <__algorithm/ranges_is_sorted_until.h>
#include <__algorithm/ranges_lexicographical_compare.h>