[libc++] Add ranges::max_element to the synopsis and ADL-proof the __min_element_impl calls
Reviewed By: ldionne, #libc
Spies: sstefan1, libcxx-commits
Differential Revision: https://reviews.llvm.org/D126167
NOKEYCHECK=True
GitOrigin-RevId: 40f7fca3d91fa4a480a7f8477a207a6a1a4a2496
diff --git a/include/algorithm b/include/algorithm
index 1a75dc0..a95fa76 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -45,6 +45,15 @@
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20
constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {});
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
+ constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
+
+ template<forward_range R, class Proj = identity,
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
+ constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, 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>