summaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorzijunzhao <zijunzhao@google.com>2023-05-08 22:04:00 +0000
committerzijunzhao <zijunzhao@google.com>2023-05-15 18:15:38 +0000
commit205175578e0d73b4cd63d4d124a900fff10da7f8 (patch)
tree5e69b779e64651ba2233f86a3aa0f81f1e6fbb73 /libcxx/include/algorithm
parentca39168a7c1cb8299786d697baaafcda9cf23e60 (diff)
[libc++] Implement ranges::starts_with
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm13
1 files changed, 13 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 18a89eb1a4dc..280333e5b33d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -446,6 +446,18 @@ namespace ranges {
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ template<input_iterator I1, sentinel_for<I1> S1, input_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>
+ constexpr bool ranges::starts_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
+
+ template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity,
+ class Proj2 = identity>
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
+ constexpr bool ranges::starts_with(R1&& r1, R2&& r2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
+
template<input_iterator I1, sentinel_for<I1> S1,
random_access_iterator I2, sentinel_for<I2> S2,
class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
@@ -1874,6 +1886,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/ranges_sort_heap.h>
#include <__algorithm/ranges_stable_partition.h>
#include <__algorithm/ranges_stable_sort.h>
+#include <__algorithm/ranges_starts_with.h>
#include <__algorithm/ranges_swap_ranges.h>
#include <__algorithm/ranges_transform.h>
#include <__algorithm/ranges_unique.h>