aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2022-06-06 13:57:34 +0200
committerNikolas Klauser <nikolasklauser@berlin.de>2022-06-06 22:29:02 +0200
commitb79b2b67725633dfb572660a0e1740190fc0afb5 (patch)
treed75c0a0ee5f6958202dbe8c789d1bc69e1241acb /libcxx/include/algorithm
parentfcb784db496137fa29a11b7e106efe89c7550e11 (diff)
downloadllvm-b79b2b67725633dfb572660a0e1740190fc0afb5.zip
llvm-b79b2b67725633dfb572660a0e1740190fc0afb5.tar.gz
llvm-b79b2b67725633dfb572660a0e1740190fc0afb5.tar.bz2
[libc++] Implement ranges::find_first_of
Reviewed By: Mordante, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126529
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 c55c87f..80788ed3f 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -370,11 +370,26 @@ namespace ranges {
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
constexpr bool binary_search(I first, S last, const T& value, Comp comp = {},
Proj proj = {}); // since C++20
+
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr bool binary_search(R&& r, const T& value, Comp comp = {},
Proj proj = {}); // since C++20
+ template<input_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>
+ constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2,
+ Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+
+ template<input_range R1, forward_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 borrowed_iterator_t<R1>
+ ranges::find_first_of(R1&& r1, R2&& r2,
+ Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
}
@@ -1105,6 +1120,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/ranges_fill.h>
#include <__algorithm/ranges_fill_n.h>
#include <__algorithm/ranges_find.h>
+#include <__algorithm/ranges_find_first_of.h>
#include <__algorithm/ranges_find_if.h>
#include <__algorithm/ranges_find_if_not.h>
#include <__algorithm/ranges_for_each.h>