[libcxx-commits] [libcxx] 73ebcab - [libc++][ranges][NFC] Implement the repetitive parts of the remaining range algorithms:

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 12 02:48:57 PDT 2022


Author: Konstantin Varlamov
Date: 2022-07-12T02:48:31-07:00
New Revision: 73ebcabff2d95d59b5ef05108738f2a2468cab12

URL: https://github.com/llvm/llvm-project/commit/73ebcabff2d95d59b5ef05108738f2a2468cab12
DIFF: https://github.com/llvm/llvm-project/commit/73ebcabff2d95d59b5ef05108738f2a2468cab12.diff

LOG: [libc++][ranges][NFC] Implement the repetitive parts of the remaining range algorithms:

- create the headers (but not include them from `<algorithm>`);
- define the niebloid and its member functions with the right signatures
  (as no-ops);
- make sure all the right headers are included that are required by each
  algorithm's signature;
- update `CMakeLists.txt` and the module map;
- create the test files with the appropriate synopses.

The synopsis in `<algorithm>` is deliberately not updated because that
could be taken as a readiness signal. The new headers aren't included
from `<algorithm>` for the same reason.

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

Added: 
    libcxx/include/__algorithm/ranges_equal_range.h
    libcxx/include/__algorithm/ranges_generate.h
    libcxx/include/__algorithm/ranges_generate_n.h
    libcxx/include/__algorithm/ranges_includes.h
    libcxx/include/__algorithm/ranges_inplace_merge.h
    libcxx/include/__algorithm/ranges_is_heap.h
    libcxx/include/__algorithm/ranges_is_heap_until.h
    libcxx/include/__algorithm/ranges_partial_sort_copy.h
    libcxx/include/__algorithm/ranges_partition.h
    libcxx/include/__algorithm/ranges_partition_copy.h
    libcxx/include/__algorithm/ranges_partition_point.h
    libcxx/include/__algorithm/ranges_remove_copy.h
    libcxx/include/__algorithm/ranges_remove_copy_if.h
    libcxx/include/__algorithm/ranges_replace_copy.h
    libcxx/include/__algorithm/ranges_replace_copy_if.h
    libcxx/include/__algorithm/ranges_set_union.h
    libcxx/include/__algorithm/ranges_shuffle.h
    libcxx/include/__algorithm/ranges_stable_partition.h
    libcxx/include/__algorithm/ranges_unique.h
    libcxx/include/__algorithm/ranges_unique_copy.h
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_random_shuffle.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/ranges_equal_range.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/includes/ranges_includes.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp

Modified: 
    libcxx/include/CMakeLists.txt
    libcxx/include/module.modulemap.in
    libcxx/test/libcxx/private_headers.verify.cpp
    libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index f72c7c66ccc8..5af1f9439301 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -79,6 +79,7 @@ set(files
   __algorithm/ranges_count.h
   __algorithm/ranges_count_if.h
   __algorithm/ranges_equal.h
+  __algorithm/ranges_equal_range.h
   __algorithm/ranges_fill.h
   __algorithm/ranges_fill_n.h
   __algorithm/ranges_find.h
@@ -87,6 +88,12 @@ set(files
   __algorithm/ranges_find_if_not.h
   __algorithm/ranges_for_each.h
   __algorithm/ranges_for_each_n.h
+  __algorithm/ranges_generate.h
+  __algorithm/ranges_generate_n.h
+  __algorithm/ranges_includes.h
+  __algorithm/ranges_inplace_merge.h
+  __algorithm/ranges_is_heap.h
+  __algorithm/ranges_is_heap_until.h
   __algorithm/ranges_is_partitioned.h
   __algorithm/ranges_is_sorted.h
   __algorithm/ranges_is_sorted_until.h
@@ -105,22 +112,35 @@ set(files
   __algorithm/ranges_move_backward.h
   __algorithm/ranges_none_of.h
   __algorithm/ranges_nth_element.h
+  __algorithm/ranges_partial_sort_copy.h
+  __algorithm/ranges_partition.h
+  __algorithm/ranges_partition_copy.h
+  __algorithm/ranges_partition_point.h
   __algorithm/ranges_pop_heap.h
   __algorithm/ranges_push_heap.h
   __algorithm/ranges_remove.h
+  __algorithm/ranges_remove_copy.h
+  __algorithm/ranges_remove_copy_if.h
   __algorithm/ranges_remove_if.h
   __algorithm/ranges_replace.h
+  __algorithm/ranges_replace_copy.h
+  __algorithm/ranges_replace_copy_if.h
   __algorithm/ranges_replace_if.h
   __algorithm/ranges_reverse.h
   __algorithm/ranges_reverse_copy.h
   __algorithm/ranges_rotate_copy.h
   __algorithm/ranges_set_
diff erence.h
   __algorithm/ranges_set_intersection.h
+  __algorithm/ranges_set_union.h
+  __algorithm/ranges_shuffle.h
   __algorithm/ranges_sort.h
   __algorithm/ranges_sort_heap.h
+  __algorithm/ranges_stable_partition.h
   __algorithm/ranges_stable_sort.h
   __algorithm/ranges_swap_ranges.h
   __algorithm/ranges_transform.h
+  __algorithm/ranges_unique.h
+  __algorithm/ranges_unique_copy.h
   __algorithm/ranges_upper_bound.h
   __algorithm/remove.h
   __algorithm/remove_copy.h

diff  --git a/libcxx/include/__algorithm/ranges_equal_range.h b/libcxx/include/__algorithm/ranges_equal_range.h
new file mode 100644
index 000000000000..28d721530bda
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_equal_range.h
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM __project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
+#define _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
+
+#include <__algorithm/equal_range.h>
+#include <__algorithm/make_projected.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/subrange.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __equal_range {
+
+struct __fn {
+
+  template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Tp, class _Proj = identity,
+            indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  subrange<_Iter> operator()(_Iter __first, _Sent __last, const _Tp& __value, _Comp __comp = {},
+                             _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__value; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <forward_range _Range, class _Tp, class _Proj = identity,
+            indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_subrange_t<_Range> operator()(_Range&& __range, const _Tp& __value, _Comp __comp = {},
+                                         _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__value; (void)__comp; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __equal_range
+
+inline namespace __cpo {
+  inline constexpr auto equal_range = __equal_range::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H

diff  --git a/libcxx/include/__algorithm/ranges_generate.h b/libcxx/include/__algorithm/ranges_generate.h
new file mode 100644
index 000000000000..c23645e6d906
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_generate.h
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_H
+#define _LIBCPP___ALGORITHM_RANGES_GENERATE_H
+
+#include <__algorithm/generate.h>
+#include <__algorithm/make_projected.h>
+#include <__concepts/constructible.h>
+#include <__concepts/invocable.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __generate {
+
+struct __fn {
+
+  template <input_or_output_iterator _OutIter, sentinel_for<_OutIter> _Sent, copy_constructible _Func>
+  requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _OutIter operator()(_OutIter __first, _Sent __last, _Func __gen) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__gen;
+    return {};
+  }
+
+  template <class _Range, copy_constructible _Func>
+  requires invocable<_Func&> && output_range<_Range, invoke_result_t<_Func&>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, _Func __gen) const {
+    // TODO: implement
+    (void)__range; (void)__gen;
+    return {};
+  }
+
+};
+
+} // namespace __generate
+
+inline namespace __cpo {
+  inline constexpr auto generate = __generate::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_H

diff  --git a/libcxx/include/__algorithm/ranges_generate_n.h b/libcxx/include/__algorithm/ranges_generate_n.h
new file mode 100644
index 000000000000..bcf50e025ecc
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_generate_n.h
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
+#define _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
+
+#include <__algorithm/generate_n.h>
+#include <__algorithm/make_projected.h>
+#include <__concepts/constructible.h>
+#include <__concepts/invocable.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __generate_n {
+
+struct __fn {
+
+  template <input_or_output_iterator _OutIter, copy_constructible _Func>
+  requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _OutIter operator()(_OutIter __first, iter_
diff erence_t<_OutIter> __n, _Func __gen) const {
+    // TODO: implement
+    (void)__first; (void)__n; (void)__gen;
+    return {};
+  }
+
+};
+
+} // namespace __generate_n
+
+inline namespace __cpo {
+  inline constexpr auto generate_n = __generate_n::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H

diff  --git a/libcxx/include/__algorithm/ranges_includes.h b/libcxx/include/__algorithm/ranges_includes.h
new file mode 100644
index 000000000000..19c17870ed6f
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_includes.h
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
+#define _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/includes.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __includes {
+
+struct __fn {
+
+  template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1, input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
+            class _Proj1 = identity, class _Proj2 = identity,
+            indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Comp __comp = {},
+                  _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__first1; (void)__last1; (void)__first2; (void)__last2; (void)__comp; (void)__proj1; (void)__proj2;
+    return {};
+  }
+
+  template <input_range _Range1, input_range _Range2, class _Proj1 = identity, class _Proj2 = identity,
+            indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>,
+                                       projected<iterator_t<_Range2>, _Proj2>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Range1&& __range1, _Range2&& __range2, _Comp __comp = {},
+                  _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__range1; (void)__range2; (void)__comp; (void)__proj1; (void)__proj2;
+    return {};
+  }
+
+};
+
+} // namespace __includes
+
+inline namespace __cpo {
+  inline constexpr auto includes = __includes::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_INCLUDES_H

diff  --git a/libcxx/include/__algorithm/ranges_inplace_merge.h b/libcxx/include/__algorithm/ranges_inplace_merge.h
new file mode 100644
index 000000000000..a0867e486c3a
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_inplace_merge.h
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
+#define _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
+
+#include <__algorithm/inplace_merge.h>
+#include <__algorithm/make_projected.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__iterator/sortable.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __inplace_merge {
+
+struct __fn {
+
+  template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
+  requires sortable<_Iter, _Comp, _Proj>
+  _LIBCPP_HIDE_FROM_ABI
+  _Iter operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__middle; (void)__last; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <bidirectional_range _Range, class _Comp = ranges::less, class _Proj = identity>
+  requires sortable<iterator_t<_Range>, _Comp, _Proj>
+  _LIBCPP_HIDE_FROM_ABI
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, iterator_t<_Range> __middle,
+                                            _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__middle; (void)__comp; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __inplace_merge
+
+inline namespace __cpo {
+  inline constexpr auto inplace_merge = __inplace_merge::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H

diff  --git a/libcxx/include/__algorithm/ranges_is_heap.h b/libcxx/include/__algorithm/ranges_is_heap.h
new file mode 100644
index 000000000000..0f10fa4dcec9
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_is_heap.h
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
+#define _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
+
+#include <__algorithm/is_heap.h>
+#include <__algorithm/make_projected.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __is_heap {
+
+struct __fn {
+
+  template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <random_access_range _Range, class _Proj = identity,
+            indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__comp; (void)__proj;
+    return {};
+  }
+};
+
+} // namespace __is_heap
+
+inline namespace __cpo {
+  inline constexpr auto is_heap = __is_heap::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_is_heap_until.h b/libcxx/include/__algorithm/ranges_is_heap_until.h
new file mode 100644
index 000000000000..ad021d6f2525
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_is_heap_until.h
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
+#define _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
+
+#include <__algorithm/is_heap_until.h>
+#include <__algorithm/make_projected.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __is_heap_until {
+
+struct __fn {
+
+  template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <random_access_range _Range, class _Proj = identity,
+            indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__comp; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __is_heap_until
+
+inline namespace __cpo {
+  inline constexpr auto is_heap_until = __is_heap_until::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H

diff  --git a/libcxx/include/__algorithm/ranges_partial_sort_copy.h b/libcxx/include/__algorithm/ranges_partial_sort_copy.h
new file mode 100644
index 000000000000..55ad2ca4e686
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_partial_sort_copy.h
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
+#define _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/partial_sort_copy.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__iterator/sortable.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using partial_sort_copy_result = in_out_result<_InIter, _OutIter>;
+
+namespace __partial_sort_copy {
+
+struct __fn {
+
+  template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
+            random_access_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
+            class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
+  requires indirectly_copyable<_Iter1, _Iter2> && sortable<_Iter2, _Comp, _Proj2> &&
+           indirect_strict_weak_order<_Comp, projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  partial_sort_copy_result<_Iter1, _Iter2>
+  operator()(_Iter1 __first, _Sent1 __last, _Iter2 __result_first, _Sent2 __result_last,
+             _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result_first; (void)__result_last; (void)__comp; (void)__proj1; (void)__proj2;
+    return {};
+  }
+
+  template <input_range _Range1, random_access_range _Range2, class _Comp = ranges::less,
+            class _Proj1 = identity, class _Proj2 = identity>
+  requires indirectly_copyable<iterator_t<_Range1>, iterator_t<_Range2>> &&
+           sortable<iterator_t<_Range2>, _Comp, _Proj2> &&
+           indirect_strict_weak_order<_Comp, projected<iterator_t<_Range1>, _Proj1>,
+                                      projected<iterator_t<_Range2>, _Proj2>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>
+  operator()(_Range1&& __range, _Range2&& __result_range, _Comp __comp = {},
+             _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result_range; (void)__comp; (void)__proj1; (void)__proj2;
+    return {};
+  }
+
+};
+
+} // namespace __partial_sort_copy
+
+inline namespace __cpo {
+  inline constexpr auto partial_sort_copy = __partial_sort_copy::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h
new file mode 100644
index 000000000000..c145e7bdb4a2
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_partition.h
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_H
+#define _LIBCPP___ALGORITHM_RANGES_PARTITION_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/partition.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/permutable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/subrange.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __partition {
+
+struct __fn {
+
+  template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__pred; (void)__proj;
+    return {};
+  }
+
+  template <forward_range _Range, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  requires permutable<iterator_t<_Range>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__pred; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __partition
+
+inline namespace __cpo {
+  inline constexpr auto partition = __partition::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_H

diff  --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h
new file mode 100644
index 000000000000..f55089b94ea5
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
+#define _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
+
+#include <__algorithm/in_out_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/partition_copy.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter1, class _OutIter2>
+using partition_copy_result = in_out_out_result<_InIter, _OutIter1, _OutIter2>;
+
+namespace __partition_copy {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent,
+            weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
+            class _Proj = identity, indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+  requires indirectly_copyable<_InIter, _OutIter1> && indirectly_copyable<_InIter, _OutIter2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  partition_copy_result<_InIter, _OutIter1, _OutIter2>
+  operator()(_InIter __first, _Sent __last, _OutIter1 __out_true, _OutIter2 __out_false,
+             _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__out_true; (void)__out_false; (void)__pred; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
+            class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter1> && indirectly_copyable<iterator_t<_Range>, _OutIter2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  partition_copy_result<borrowed_iterator_t<_Range>, _OutIter1, _OutIter2>
+  operator()(_Range&& __range, _OutIter1 __out_true, _OutIter2 __out_false, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__out_true; (void)__out_false; (void)__pred; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __partition_copy
+
+inline namespace __cpo {
+  inline constexpr auto partition_copy = __partition_copy::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_partition_point.h b/libcxx/include/__algorithm/ranges_partition_point.h
new file mode 100644
index 000000000000..336b29f63284
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_partition_point.h
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
+#define _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/partition_point.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __partition_point {
+
+struct __fn {
+
+  template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__pred; (void)__proj;
+    return {};
+  }
+
+  template <forward_range _Range, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__pred; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __partition_point
+
+inline namespace __cpo {
+  inline constexpr auto partition_point = __partition_point::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H

diff  --git a/libcxx/include/__algorithm/ranges_remove_copy.h b/libcxx/include/__algorithm/ranges_remove_copy.h
new file mode 100644
index 000000000000..16e9009e7ef0
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_remove_copy.h
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
+#define _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/remove_copy.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using remove_copy_result = in_out_result<_InIter, _OutIter>;
+
+namespace __remove_copy {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter, class _Type,
+            class _Proj = identity>
+  requires indirectly_copyable<_InIter, _OutIter> &&
+           indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type*>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  remove_copy_result<_InIter, _OutIter>
+  operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result; (void)__value; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, weakly_incrementable _OutIter, class _Type, class _Proj = identity>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
+           indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  remove_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+  operator()(_Range&& __range, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result; (void)__value; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __remove_copy
+
+inline namespace __cpo {
+  inline constexpr auto remove_copy = __remove_copy::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_remove_copy_if.h b/libcxx/include/__algorithm/ranges_remove_copy_if.h
new file mode 100644
index 000000000000..4eafe425b8e3
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_remove_copy_if.h
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
+#define _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/remove_copy_if.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using remove_copy_if_result = in_out_result<_InIter, _OutIter>;
+
+namespace __remove_copy_if {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter,
+            class _Proj = identity, indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+  requires indirectly_copyable<_InIter, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  remove_copy_if_result<_InIter, _OutIter>
+  operator()(_InIter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result; (void)__pred; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, weakly_incrementable _OutIter, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  remove_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+  operator()(_Range&& __range, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result; (void)__pred; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __remove_copy_if
+
+inline namespace __cpo {
+  inline constexpr auto remove_copy_if = __remove_copy_if::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_replace_copy.h b/libcxx/include/__algorithm/ranges_replace_copy.h
new file mode 100644
index 000000000000..19ef635d6f15
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_replace_copy.h
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
+#define _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/replace_copy.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using replace_copy_result = in_out_result<_InIter, _OutIter>;
+
+namespace __replace_copy {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, class _Type1, class _Type2,
+            output_iterator<const _Type2&> _OutIter, class _Proj = identity>
+  requires indirectly_copyable<_InIter, _OutIter> &&
+           indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type1*>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  replace_copy_result<_InIter, _OutIter>
+  operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type1& __old_value, const _Type2& __new_value,
+               _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result; (void)__old_value; (void)__new_value; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, class _Type1, class _Type2, output_iterator<const _Type2&> _OutIter,
+            class _Proj = identity>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
+           indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  replace_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+  operator()(_Range&& __range, _OutIter __result, const _Type1& __old_value, const _Type2& __new_value,
+               _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result; (void)__old_value; (void)__new_value; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __replace_copy
+
+inline namespace __cpo {
+  inline constexpr auto replace_copy = __replace_copy::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_replace_copy_if.h b/libcxx/include/__algorithm/ranges_replace_copy_if.h
new file mode 100644
index 000000000000..2a908e2057af
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_replace_copy_if.h
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
+#define _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/replace_copy_if.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using replace_copy_if_result = in_out_result<_InIter, _OutIter>;
+
+namespace __replace_copy_if {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, class _Type, output_iterator<const _Type&> _OutIter,
+            class _Proj = identity, indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+  requires indirectly_copyable<_InIter, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  replace_copy_if_result<_InIter, _OutIter>
+  operator()(_InIter __first, _Sent __last, _OutIter __result, _Pred __pred, const _Type& __new_value,
+             _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result; (void)__pred; (void)__new_value; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, class _Type, output_iterator<const _Type&> _OutIter, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  replace_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+  operator()(_Range&& __range, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result; (void)__pred; (void)__new_value; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __replace_copy_if
+
+inline namespace __cpo {
+  inline constexpr auto replace_copy_if = __replace_copy_if::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_set_union.h b/libcxx/include/__algorithm/ranges_set_union.h
new file mode 100644
index 000000000000..39537503b98f
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_set_union.h
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
+#define _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
+
+#include <__algorithm/in_in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/set_union.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/mergeable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter1, class _InIter2, class _OutIter>
+using set_union_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
+
+namespace __set_union {
+
+struct __fn {
+
+  template <input_iterator _InIter1, sentinel_for<_InIter1> _Sent1,
+            input_iterator _InIter2, sentinel_for<_InIter2> _Sent2,
+            weakly_incrementable _OutIter, class _Comp = ranges::less,
+            class _Proj1 = identity, class _Proj2 = identity>
+  requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  set_union_result<_InIter1, _InIter2, _OutIter>
+  operator()(_InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Sent2 __last2, _OutIter __result, _Comp __comp = {},
+            _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__first1; (void)__last1; (void)__first2; (void)__last2; (void)__result; (void)__comp; (void)__proj1;
+    (void)__proj2;
+    return {};
+  }
+
+  template <input_range _Range1, input_range _Range2, weakly_incrementable _OutIter,
+            class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
+  requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  set_union_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
+  operator()(_Range1&& __range1, _Range2&& __range2, _OutIter __result, _Comp __comp = {},
+            _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    // TODO: implement
+    (void)__range1; (void)__range2; (void)__result; (void)__comp; (void)__proj1; (void)__proj2;
+    return {};
+  }
+
+};
+
+} // namespace __set_union
+
+inline namespace __cpo {
+  inline constexpr auto set_union = __set_union::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_SET_UNION_H

diff  --git a/libcxx/include/__algorithm/ranges_shuffle.h b/libcxx/include/__algorithm/ranges_shuffle.h
new file mode 100644
index 000000000000..bf9c28b4ce26
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_shuffle.h
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
+#define _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/shuffle.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/permutable.h>
+#include <__iterator/projected.h>
+#include <__random/uniform_random_bit_generator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__type_traits/remove_reference.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __shuffle {
+
+struct __fn {
+
+  template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Gen>
+  requires permutable<_Iter> && uniform_random_bit_generator<remove_reference_t<_Gen>>
+  _LIBCPP_HIDE_FROM_ABI
+  _Iter operator()(_Iter __first, _Sent __last, _Gen&& __gen) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__gen;
+    return {};
+  }
+
+  template<random_access_range _Range, class _Gen>
+  requires permutable<iterator_t<_Range>> && uniform_random_bit_generator<remove_reference_t<_Gen>>
+  _LIBCPP_HIDE_FROM_ABI
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, _Gen&& __gen) const {
+    // TODO: implement
+    (void)__range; (void)__gen;
+    return {};
+  }
+
+};
+
+} // namespace __shuffle
+
+inline namespace __cpo {
+  inline constexpr auto shuffle = __shuffle::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H

diff  --git a/libcxx/include/__algorithm/ranges_stable_partition.h b/libcxx/include/__algorithm/ranges_stable_partition.h
new file mode 100644
index 000000000000..178c953ebdae
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
+#define _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/stable_partition.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/permutable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/subrange.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __stable_partition {
+
+struct __fn {
+
+  template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
+  requires permutable<_Iter>
+  _LIBCPP_HIDE_FROM_ABI
+  subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__pred; (void)__proj;
+    return {};
+  }
+
+  template <bidirectional_range _Range, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  requires permutable<iterator_t<_Range>>
+  _LIBCPP_HIDE_FROM_ABI
+  borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__pred; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __stable_partition
+
+inline namespace __cpo {
+  inline constexpr auto stable_partition = __stable_partition::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H

diff  --git a/libcxx/include/__algorithm/ranges_unique.h b/libcxx/include/__algorithm/ranges_unique.h
new file mode 100644
index 000000000000..bdf755e9406e
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_unique.h
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
+#define _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
+
+#include <__algorithm/make_projected.h>
+#include <__algorithm/unique.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/permutable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/subrange.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __unique {
+
+struct __fn {
+
+  template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_equivalence_relation<projected<_Iter, _Proj>> _Comp = ranges::equal_to>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  subrange<_Iter> operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <forward_range _Range, class _Proj = identity,
+            indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
+  requires permutable<iterator_t<_Range>>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_subrange_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__comp; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __unique
+
+inline namespace __cpo {
+  inline constexpr auto unique = __unique::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_H

diff  --git a/libcxx/include/__algorithm/ranges_unique_copy.h b/libcxx/include/__algorithm/ranges_unique_copy.h
new file mode 100644
index 000000000000..56361aa8ae2f
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_unique_copy.h
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
+#define _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
+
+#include <__algorithm/in_out_result.h>
+#include <__algorithm/make_projected.h>
+#include <__algorithm/unique_copy.h>
+#include <__concepts/same_as.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+
+template <class _InIter, class _OutIter>
+using unique_copy_result = in_out_result<_InIter, _OutIter>;
+
+namespace __unique_copy {
+
+struct __fn {
+
+  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter, class _Proj = identity,
+            indirect_equivalence_relation<projected<_InIter, _Proj>> _Comp = ranges::equal_to>
+  requires indirectly_copyable<_InIter, _OutIter> &&
+            (forward_iterator<_InIter> ||
+            (input_iterator<_OutIter> && same_as<iter_value_t<_InIter>, iter_value_t<_OutIter>>) ||
+            indirectly_copyable_storable<_InIter, _OutIter>)
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  unique_copy_result<_InIter, _OutIter>
+  operator()(_InIter __first, _Sent __last, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__first; (void)__last; (void)__result; (void)__comp; (void)__proj;
+    return {};
+  }
+
+  template <input_range _Range, weakly_incrementable _OutIter, class _Proj = identity,
+            indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
+  requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
+            (forward_iterator<iterator_t<_Range>> ||
+            (input_iterator<_OutIter> && same_as<range_value_t<_Range>, iter_value_t<_OutIter>>) ||
+            indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+  operator()(_Range&& __range, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
+    // TODO: implement
+    (void)__range; (void)__result; (void)__comp; (void)__proj;
+    return {};
+  }
+
+};
+
+} // namespace __unique_copy
+
+inline namespace __cpo {
+  inline constexpr auto unique_copy = __unique_copy::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H

diff  --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 0912127f1b5d..8efeb1fc4926 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -318,6 +318,7 @@ module std [system] {
       module ranges_count                    { private header "__algorithm/ranges_count.h" }
       module ranges_count_if                 { private header "__algorithm/ranges_count_if.h" }
       module ranges_equal                    { private header "__algorithm/ranges_equal.h" }
+      module ranges_equal_range              { private header "__algorithm/ranges_equal_range.h" }
       module ranges_fill                     { private header "__algorithm/ranges_fill.h" }
       module ranges_fill_n                   { private header "__algorithm/ranges_fill_n.h" }
       module ranges_find                     { private header "__algorithm/ranges_find.h" }
@@ -326,6 +327,12 @@ module std [system] {
       module ranges_find_if_not              { private header "__algorithm/ranges_find_if_not.h" }
       module ranges_for_each                 { private header "__algorithm/ranges_for_each.h" }
       module ranges_for_each_n               { private header "__algorithm/ranges_for_each_n.h" }
+      module ranges_generate                 { private header "__algorithm/ranges_generate.h" }
+      module ranges_generate_n               { private header "__algorithm/ranges_generate_n.h" }
+      module ranges_includes                 { private header "__algorithm/ranges_includes.h" }
+      module ranges_inplace_merge            { private header "__algorithm/ranges_inplace_merge.h" }
+      module ranges_is_heap                  { private header "__algorithm/ranges_is_heap.h" }
+      module ranges_is_heap_until            { private header "__algorithm/ranges_is_heap_until.h" }
       module ranges_is_partitioned           { private header "__algorithm/ranges_is_partitioned.h" }
       module ranges_is_sorted                { private header "__algorithm/ranges_is_sorted.h" }
       module ranges_is_sorted_until          { private header "__algorithm/ranges_is_sorted_until.h" }
@@ -344,22 +351,35 @@ module std [system] {
       module ranges_move_backward            { private header "__algorithm/ranges_move_backward.h" }
       module ranges_none_of                  { private header "__algorithm/ranges_none_of.h" }
       module ranges_nth_element              { private header "__algorithm/ranges_nth_element.h" }
+      module ranges_partial_sort_copy        { private header "__algorithm/ranges_partial_sort_copy.h" }
+      module ranges_partition                { private header "__algorithm/ranges_partition.h" }
+      module ranges_partition_copy           { private header "__algorithm/ranges_partition_copy.h" }
+      module ranges_partition_point          { private header "__algorithm/ranges_partition_point.h" }
       module ranges_pop_heap                 { private header "__algorithm/ranges_pop_heap.h" }
       module ranges_push_heap                { private header "__algorithm/ranges_push_heap.h" }
       module ranges_remove                   { private header "__algorithm/ranges_remove.h" }
+      module ranges_remove_copy              { private header "__algorithm/ranges_remove_copy.h" }
+      module ranges_remove_copy_if           { private header "__algorithm/ranges_remove_copy_if.h" }
       module ranges_remove_if                { private header "__algorithm/ranges_remove_if.h" }
       module ranges_replace                  { private header "__algorithm/ranges_replace.h" }
+      module ranges_replace_copy             { private header "__algorithm/ranges_replace_copy.h" }
+      module ranges_replace_copy_if          { private header "__algorithm/ranges_replace_copy_if.h" }
       module ranges_replace_if               { private header "__algorithm/ranges_replace_if.h" }
       module ranges_reverse                  { private header "__algorithm/ranges_reverse.h" }
       module ranges_reverse_copy             { private header "__algorithm/ranges_reverse_copy.h" }
       module ranges_rotate_copy              { private header "__algorithm/ranges_rotate_copy.h" }
       module ranges_set_
diff erence           { private header "__algorithm/ranges_set_
diff erence.h" }
       module ranges_set_intersection         { private header "__algorithm/ranges_set_intersection.h" }
+      module ranges_set_union                { private header "__algorithm/ranges_set_union.h" }
+      module ranges_shuffle                  { private header "__algorithm/ranges_shuffle.h" }
       module ranges_sort                     { private header "__algorithm/ranges_sort.h" }
       module ranges_sort_heap                { private header "__algorithm/ranges_sort_heap.h" }
+      module ranges_stable_partition         { private header "__algorithm/ranges_stable_partition.h" }
       module ranges_stable_sort              { private header "__algorithm/ranges_stable_sort.h" }
       module ranges_swap_ranges              { private header "__algorithm/ranges_swap_ranges.h" }
       module ranges_transform                { private header "__algorithm/ranges_transform.h" }
+      module ranges_unique                   { private header "__algorithm/ranges_unique.h" }
+      module ranges_unique_copy              { private header "__algorithm/ranges_unique_copy.h" }
       module ranges_upper_bound              { private header "__algorithm/ranges_upper_bound.h" }
       module remove                          { private header "__algorithm/remove.h" }
       module remove_copy                     { private header "__algorithm/remove_copy.h" }

diff  --git a/libcxx/test/libcxx/private_headers.verify.cpp b/libcxx/test/libcxx/private_headers.verify.cpp
index 362bcf7893d9..5b68d00720ad 100644
--- a/libcxx/test/libcxx/private_headers.verify.cpp
+++ b/libcxx/test/libcxx/private_headers.verify.cpp
@@ -116,6 +116,7 @@ END-SCRIPT
 #include <__algorithm/ranges_count.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_count.h'}}
 #include <__algorithm/ranges_count_if.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_count_if.h'}}
 #include <__algorithm/ranges_equal.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_equal.h'}}
+#include <__algorithm/ranges_equal_range.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_equal_range.h'}}
 #include <__algorithm/ranges_fill.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_fill.h'}}
 #include <__algorithm/ranges_fill_n.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_fill_n.h'}}
 #include <__algorithm/ranges_find.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_find.h'}}
@@ -124,6 +125,12 @@ END-SCRIPT
 #include <__algorithm/ranges_find_if_not.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_find_if_not.h'}}
 #include <__algorithm/ranges_for_each.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_for_each.h'}}
 #include <__algorithm/ranges_for_each_n.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_for_each_n.h'}}
+#include <__algorithm/ranges_generate.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_generate.h'}}
+#include <__algorithm/ranges_generate_n.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_generate_n.h'}}
+#include <__algorithm/ranges_includes.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_includes.h'}}
+#include <__algorithm/ranges_inplace_merge.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_inplace_merge.h'}}
+#include <__algorithm/ranges_is_heap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_is_heap.h'}}
+#include <__algorithm/ranges_is_heap_until.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_is_heap_until.h'}}
 #include <__algorithm/ranges_is_partitioned.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_is_partitioned.h'}}
 #include <__algorithm/ranges_is_sorted.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_is_sorted.h'}}
 #include <__algorithm/ranges_is_sorted_until.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_is_sorted_until.h'}}
@@ -140,24 +147,41 @@ END-SCRIPT
 #include <__algorithm/ranges_mismatch.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_mismatch.h'}}
 #include <__algorithm/ranges_move.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_move.h'}}
 #include <__algorithm/ranges_move_backward.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_move_backward.h'}}
+#include <__algorithm/ranges_next_permutation.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_next_permutation.h'}}
 #include <__algorithm/ranges_none_of.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_none_of.h'}}
 #include <__algorithm/ranges_nth_element.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_nth_element.h'}}
+#include <__algorithm/ranges_partial_sort_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_partial_sort_copy.h'}}
+#include <__algorithm/ranges_partition.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_partition.h'}}
+#include <__algorithm/ranges_partition_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_partition_copy.h'}}
+#include <__algorithm/ranges_partition_point.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_partition_point.h'}}
 #include <__algorithm/ranges_pop_heap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_pop_heap.h'}}
+#include <__algorithm/ranges_prev_permutation.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_prev_permutation.h'}}
 #include <__algorithm/ranges_push_heap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_push_heap.h'}}
 #include <__algorithm/ranges_remove.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_remove.h'}}
+#include <__algorithm/ranges_remove_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_remove_copy.h'}}
+#include <__algorithm/ranges_remove_copy_if.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_remove_copy_if.h'}}
 #include <__algorithm/ranges_remove_if.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_remove_if.h'}}
 #include <__algorithm/ranges_replace.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_replace.h'}}
+#include <__algorithm/ranges_replace_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_replace_copy.h'}}
+#include <__algorithm/ranges_replace_copy_if.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_replace_copy_if.h'}}
 #include <__algorithm/ranges_replace_if.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_replace_if.h'}}
 #include <__algorithm/ranges_reverse.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_reverse.h'}}
 #include <__algorithm/ranges_reverse_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_reverse_copy.h'}}
+#include <__algorithm/ranges_rotate.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_rotate.h'}}
 #include <__algorithm/ranges_rotate_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_rotate_copy.h'}}
 #include <__algorithm/ranges_set_
diff erence.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_set_
diff erence.h'}}
 #include <__algorithm/ranges_set_intersection.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_set_intersection.h'}}
+#include <__algorithm/ranges_set_symmetric_
diff erence.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_set_symmetric_
diff erence.h'}}
+#include <__algorithm/ranges_set_union.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_set_union.h'}}
+#include <__algorithm/ranges_shuffle.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_shuffle.h'}}
 #include <__algorithm/ranges_sort.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_sort.h'}}
 #include <__algorithm/ranges_sort_heap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_sort_heap.h'}}
+#include <__algorithm/ranges_stable_partition.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_stable_partition.h'}}
 #include <__algorithm/ranges_stable_sort.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_stable_sort.h'}}
 #include <__algorithm/ranges_swap_ranges.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_swap_ranges.h'}}
 #include <__algorithm/ranges_transform.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_transform.h'}}
+#include <__algorithm/ranges_unique.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_unique.h'}}
+#include <__algorithm/ranges_unique_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_unique_copy.h'}}
 #include <__algorithm/ranges_upper_bound.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/ranges_upper_bound.h'}}
 #include <__algorithm/remove.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/remove.h'}}
 #include <__algorithm/remove_copy.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/remove_copy.h'}}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
new file mode 100644
index 000000000000..f8e19cd0e766
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
+//   requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
+//   constexpr O generate(O first, S last, F gen);                                                  // Since C++20
+//
+// template<class R, copy_constructible F>
+//   requires invocable<F&> && output_range<R, invoke_result_t<F&>>
+//   constexpr borrowed_iterator_t<R> generate(R&& r, F gen);                                       // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
new file mode 100644
index 000000000000..10abac910728
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_or_output_iterator O, copy_constructible F>
+//   requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
+//   constexpr O generate_n(O first, iter_
diff erence_t<O> n, F gen);                                // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
new file mode 100644
index 000000000000..1863bade5142
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<permutable I, sentinel_for<I> S, class Proj = identity,
+//          indirect_unary_predicate<projected<I, Proj>> Pred>
+//   constexpr subrange<I>
+//     partition(I first, S last, Pred pred, Proj proj = {});                                       // Since C++20
+//
+// template<forward_range R, class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   requires permutable<iterator_t<R>>
+//   constexpr borrowed_subrange_t<R>
+//     partition(R&& r, Pred pred, Proj proj = {});                                                 // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
new file mode 100644
index 000000000000..0ecb40592437
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I, sentinel_for<I> S,
+//          weakly_incrementable O1, weakly_incrementable O2,
+//          class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
+//   requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2>
+//   constexpr partition_copy_result<I, O1, O2>
+//     partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred,
+//                    Proj proj = {});                                                              // Since C++20
+//
+// template<input_range R, weakly_incrementable O1, weakly_incrementable O2,
+//          class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   requires indirectly_copyable<iterator_t<R>, O1> &&
+//            indirectly_copyable<iterator_t<R>, O2>
+//   constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2>
+//     partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {});                 // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
new file mode 100644
index 000000000000..97d1bc8ff225
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
+//          indirect_unary_predicate<projected<I, Proj>> Pred>
+//   constexpr I partition_point(I first, S last, Pred pred, Proj proj = {});                       // Since C++20
+//
+// template<forward_range R, class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   constexpr borrowed_iterator_t<R>
+//     partition_point(R&& r, Pred pred, Proj proj = {});                                           // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
new file mode 100644
index 000000000000..e5a9bcb08ac9
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
+//          indirect_unary_predicate<projected<I, Proj>> Pred>
+//   requires permutable<I>
+//   subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {});                      // Since C++20
+//
+// template<bidirectional_range R, class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   requires permutable<iterator_t<R>>
+//   borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {});                     // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_random_shuffle.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_random_shuffle.pass.cpp
new file mode 100644
index 000000000000..5277a805a6c9
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_random_shuffle.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<random_access_iterator I, sentinel_for<I> S, class Gen>
+//   requires permutable<I> &&
+//            uniform_random_bit_generator<remove_reference_t<Gen>>
+//   I shuffle(I first, S last, Gen&& g);                                                           // Since C++20
+//
+// template<random_access_range R, class Gen>
+//   requires permutable<iterator_t<R>> &&
+//            uniform_random_bit_generator<remove_reference_t<Gen>>
+//   borrowed_iterator_t<R> shuffle(R&& r, Gen&& g);                                                // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy.pass.cpp
new file mode 100644
index 000000000000..fb8a615f682d
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T,
+//          class Proj = identity>
+//   requires indirectly_copyable<I, O> &&
+//            indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
+//   constexpr remove_copy_result<I, O>
+//     remove_copy(I first, S last, O result, const T& value, Proj proj = {});                      // Since C++20
+//
+// template<input_range R, weakly_incrementable O, class T, class Proj = identity>
+//   requires indirectly_copyable<iterator_t<R>, O> &&
+//            indirect_binary_predicate<ranges::equal_to,
+//                                      projected<iterator_t<R>, Proj>, const T*>
+//   constexpr remove_copy_result<borrowed_iterator_t<R>, O>
+//     remove_copy(R&& r, O result, const T& value, Proj proj = {});                                // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp
new file mode 100644
index 000000000000..8e3e46e12192
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
+//          class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
+//   requires indirectly_copyable<I, O>
+//   constexpr remove_copy_if_result<I, O>
+//     remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {});                        // Since C++20
+//
+// template<input_range R, weakly_incrementable O, class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   requires indirectly_copyable<iterator_t<R>, O>
+//   constexpr remove_copy_if_result<borrowed_iterator_t<R>, O>
+//     remove_copy_if(R&& r, O result, Pred pred, Proj proj = {});                                  // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp
new file mode 100644
index 000000000000..b1a82e394774
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// template<input_iterator I, sentinel_for<I> S, class T1, class T2,
+//          output_iterator<const T2&> O, class Proj = identity>
+//   requires indirectly_copyable<I, O> &&
+//            indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
+//   constexpr replace_copy_result<I, O>
+//     replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value,
+//                  Proj proj = {});                                                                // Since C++20
+//
+// template<input_range R, class T1, class T2, output_iterator<const T2&> O,
+//          class Proj = identity>
+//   requires indirectly_copyable<iterator_t<R>, O> &&
+//            indirect_binary_predicate<ranges::equal_to,
+//                                      projected<iterator_t<R>, Proj>, const T1*>
+//   constexpr replace_copy_result<borrowed_iterator_t<R>, O>
+//     replace_copy(R&& r, O result, const T1& old_value, const T2& new_value,
+//                  Proj proj = {});                                                                // Since C++20
+
+// TODO: synopsis
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp
new file mode 100644
index 000000000000..d24853884b92
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O,
+//          class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
+//   requires indirectly_copyable<I, O>
+//   constexpr replace_copy_if_result<I, O>
+//     replace_copy_if(I first, S last, O result, Pred pred, const T& new_value,
+//                     Proj proj = {});                                                             // Since C++20
+//
+// template<input_range R, class T, output_iterator<const T&> O, class Proj = identity,
+//          indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
+//   requires indirectly_copyable<iterator_t<R>, O>
+//   constexpr replace_copy_if_result<borrowed_iterator_t<R>, O>
+//     replace_copy_if(R&& r, O result, Pred pred, const T& new_value,
+//                     Proj proj = {});                                                             // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique.pass.cpp
new file mode 100644
index 000000000000..216ae6a1b98e
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<permutable I, sentinel_for<I> S, class Proj = identity,
+//          indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
+//   constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {});                    // Since C++20
+//
+// template<forward_range R, class Proj = identity,
+//          indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
+//   requires permutable<iterator_t<R>>
+//   constexpr borrowed_subrange_t<R>
+//     unique(R&& r, C comp = {}, Proj proj = {});                                                  // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp
new file mode 100644
index 000000000000..8ccff619b811
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity,
+//          indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
+//   requires indirectly_copyable<I, O> &&
+//            (forward_iterator<I> ||
+//             (input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) ||
+//             indirectly_copyable_storable<I, O>)
+//   constexpr unique_copy_result<I, O>
+//     unique_copy(I first, S last, O result, C comp = {}, Proj proj = {});                         // Since C++20
+//
+// template<input_range R, weakly_incrementable O, class Proj = identity,
+//          indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
+//   requires indirectly_copyable<iterator_t<R>, O> &&
+//            (forward_iterator<iterator_t<R>> ||
+//             (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) ||
+//             indirectly_copyable_storable<iterator_t<R>, O>)
+//   constexpr unique_copy_result<borrowed_iterator_t<R>, O>
+//     unique_copy(R&& r, O result, C comp = {}, Proj proj = {});                                   // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/ranges_equal_range.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/ranges_equal_range.pass.cpp
new file mode 100644
index 000000000000..32f4954796f3
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/ranges_equal_range.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
+//          indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
+//   constexpr subrange<I>
+//     equal_range(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 borrowed_subrange_t<R>
+//     equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {});                          // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
new file mode 100644
index 000000000000..28b1c4af4ee9
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
+//              indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
+//       constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {});                   // Since C++20
+//
+//     template<random_access_range R, class Proj = identity,
+//              indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
+//       constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {});                             // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
new file mode 100644
index 000000000000..86da5ab54653
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
+//              indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
+//       constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {});                // Since C++20
+//
+//     template<random_access_range R, class Proj = identity,
+//              indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
+//       constexpr borrowed_iterator_t<R>
+//         is_heap_until(R&& r, Comp comp = {}, Proj proj = {});                                    // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
new file mode 100644
index 000000000000..fff2a6700455
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
+//          class Proj = identity>
+//   requires sortable<I, Comp, Proj>
+//   I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {});                    // Since C++20
+//
+// template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
+//   requires sortable<iterator_t<R>, Comp, Proj>
+//   borrowed_iterator_t<R>
+//     inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
+//                   Proj proj = {});                                                               // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/includes/ranges_includes.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/includes/ranges_includes.pass.cpp
new file mode 100644
index 000000000000..2415a19841cc
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/includes/ranges_includes.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
+//          class Proj1 = identity, class Proj2 = identity,
+//          indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp =
+//            ranges::less>
+//   constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {},
+//                           Proj1 proj1 = {}, Proj2 proj2 = {});                                   // Since C++20
+//
+// template<input_range R1, input_range R2, class Proj1 = identity,
+//          class Proj2 = identity,
+//          indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
+//                                     projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
+//   constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {},
+//                           Proj1 proj1 = {}, Proj2 proj2 = {});                                   // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp
new file mode 100644
index 000000000000..2c47d7bf6cea
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
+//          weakly_incrementable O, class Comp = ranges::less,
+//          class Proj1 = identity, class Proj2 = identity>
+//   requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
+//   constexpr set_union_result<I1, I2, O>
+//     set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {},
+//               Proj1 proj1 = {}, Proj2 proj2 = {});                                               // Since C++20
+//
+// template<input_range R1, input_range R2, weakly_incrementable O,
+//          class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
+//   requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
+//   constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
+//     set_union(R1&& r1, R2&& r2, O result, Comp comp = {},
+//               Proj1 proj1 = {}, Proj2 proj2 = {});                                               // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
new file mode 100644
index 000000000000..783d37464f7f
--- /dev/null
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+// <algorithm>
+
+// 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>
+//       requires indirectly_copyable<I1, I2> && sortable<I2, Comp, Proj2> &&
+//                indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>
+//       constexpr partial_sort_copy_result<I1, I2>
+//         partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last,
+//                           Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});                   // Since C++20
+//
+//     template<input_range R1, random_access_range R2, class Comp = ranges::less,
+//              class Proj1 = identity, class Proj2 = identity>
+//       requires indirectly_copyable<iterator_t<R1>, iterator_t<R2>> &&
+//                sortable<iterator_t<R2>, Comp, Proj2> &&
+//                indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>,
+//                                           projected<iterator_t<R2>, Proj2>>
+//       constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
+//         partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {},
+//                           Proj1 proj1 = {}, Proj2 proj2 = {});                                   // Since C++20
+
+#include <algorithm>
+#include <array>
+#include <concepts>
+#include <functional>
+#include <ranges>
+
+#include "almost_satisfies_types.h"
+#include "test_iterators.h"
+
+// TODO: SFINAE tests.
+
+constexpr bool test() {
+  // TODO: main tests.
+  // TODO: A custom comparator works.
+  // TODO: A custom projection works.
+
+  return true;
+}
+
+int main(int, char**) {
+  test();
+  static_assert(test());
+
+  return 0;
+}

diff  --git a/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp b/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
index 351625375ed4..e8c0349519d1 100644
--- a/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
+++ b/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
@@ -55,6 +55,7 @@ int *p;
 int a[10];
 auto odd = [](int x) { return x % 2 != 0; };
 auto triple = [](int x) { return 3*x; };
+//auto gen = [] { return 42; };
 //auto plus = [](int x, int y) { return x == y; };
 //std::mt19937 g;
 
@@ -83,8 +84,8 @@ static_assert(test(std::ranges::find_if, a, odd));
 static_assert(test(std::ranges::find_if_not, a, odd));
 static_assert(test(std::ranges::for_each, a, odd));
 static_assert(test(std::ranges::for_each_n, a, 10, odd));
-//static_assert(test(std::ranges::generate, a, 42));
-//static_assert(test(std::ranges::generate_n, a, 10, 42));
+//static_assert(test(std::ranges::generate, a, gen));
+//static_assert(test(std::ranges::generate_n, a, 10, gen));
 //static_assert(test(std::ranges::includes, a, a));
 //static_assert(test(std::ranges::inplace_merge, a, a+5));
 //static_assert(test(std::ranges::is_heap, a));


        


More information about the libcxx-commits mailing list