[libc++][ranges] Implement ranges::mismatch

Implement `ranges::mismatch`

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D117817

NOKEYCHECK=True
GitOrigin-RevId: c2cd15a6653197904e2cf8ffb40abc47770256a6
diff --git a/include/algorithm b/include/algorithm
index 6b5bc0c..72fdb29 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -44,6 +44,18 @@
   template<forward_range R, class Proj = identity,
     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 <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 mismatch_result<_I1, _I2>
+  mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
+
+  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 mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
+  mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {})                           // since C++20
 }
 
 template <class InputIterator, class Predicate>
@@ -765,6 +777,7 @@
 #include <__algorithm/push_heap.h>
 #include <__algorithm/ranges_max_element.h>
 #include <__algorithm/ranges_min_element.h>
+#include <__algorithm/ranges_mismatch.h>
 #include <__algorithm/ranges_swap_ranges.h>
 #include <__algorithm/remove.h>
 #include <__algorithm/remove_copy.h>