Browse Source

Upd libc++ to 1 Jun 2022 10c4eec2785a68880c287d36c262d5be3a72a128

[libc++][format] Fixes string-literal formatting.
[libc++] Removes __cpp_lib_monadic_optional.
[libcxx] Temporarily skip Arm configs
[libc++] Reduce the verbosity when running the libc++ Lit configuration
[libc++] Adds __format_string as nasty macro.
[libc++] Use __enable_if_t and is_integral in cstddef
[libc++] Adds missing includes.
[libc++] Minor emscripten changes from downstream
[libc++] Granularize more of <type_traits>
[libc++] Remove unused __functional includes
[libc++] Add various missing _LIBCPP_HIDE_FROM_ABI
[libc++] Use __libcpp_clz for a tighter __log2i function
[libc++] Enable ranges_robust_against* and niebloid tests for implemented ranges algorithms
[libc++] Implement ranges::is_sorted{, _until}
[libc++] Time tests during CI
[libc++] Implement ranges::{all, any, none}_of
[libc++] Remove temporary workaround for existing CMake caches
[libc++] Implement ranges::equal
[libc++] Remove conditional include
[libc++] Use Python subprocess instead of libc++'s own utilities
[libc++] Implement ranges::fill{, _n}
[libc++] Make sure that all headers can be included with modules enabled
[libc++] Rename the generic-singlethreaded CI job to generic-no-threads for consistency
[libc++] Implement ranges::reverse
[libc++] Replace modulus operations in std::seed_seq::generate with conditional checks.
[libc++] type_traits: use __is_core_convertible in __invokable_r.
[libc++] Remove duplicate tests for callable concepts
[libc++] Add ranges::max_element to the synopsis and ADL-proof the __min_element_impl calls
[libc++] Add auto to the list of required extensions in C++03
[libc++] Assume that push_macro and pop_macro are available
[libc++] Always enable the ranges concepts
[libc++] Granularize parts of <type_traits>
[libc++] Improve error messages for disabled modes
[libc++] Override the value of LIBCXX_CXX_ABI in the cache
[libc++] Granularize algorithm benchmarks
[libc++] Enable move semantics for vector in C++03
[libc++][format][5/6] Improve format_to_n.
mikhnenko 1 year ago
parent
commit
4e197a9762

+ 62 - 0
build/sysincl/stl-to-libcxx.yml

@@ -248,18 +248,25 @@
   - __algorithm/pop_heap.h:                       contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h
   - __algorithm/prev_permutation.h:               contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h
   - __algorithm/push_heap.h:                      contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h
+  - __algorithm/ranges_all_of.h:                  contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h
+  - __algorithm/ranges_any_of.h:                  contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h
   - __algorithm/ranges_copy.h:                    contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h
   - __algorithm/ranges_copy_backward.h:           contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h
   - __algorithm/ranges_copy_if.h:                 contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h
   - __algorithm/ranges_copy_n.h:                  contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h
   - __algorithm/ranges_count.h:                   contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h
   - __algorithm/ranges_count_if.h:                contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h
+  - __algorithm/ranges_equal.h:                   contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h
+  - __algorithm/ranges_fill.h:                    contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h
+  - __algorithm/ranges_fill_n.h:                  contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h
   - __algorithm/ranges_find.h:                    contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h
   - __algorithm/ranges_find_if.h:                 contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h
   - __algorithm/ranges_find_if_not.h:             contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h
   - __algorithm/ranges_for_each.h:                contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h
   - __algorithm/ranges_for_each_n.h:              contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h
   - __algorithm/ranges_is_partitioned.h:          contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h
+  - __algorithm/ranges_is_sorted.h:               contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h
+  - __algorithm/ranges_is_sorted_until.h:         contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h
   - __algorithm/ranges_max.h:                     contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h
   - __algorithm/ranges_max_element.h:             contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h
   - __algorithm/ranges_min.h:                     contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h
@@ -267,6 +274,8 @@
   - __algorithm/ranges_minmax.h:                  contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h
   - __algorithm/ranges_minmax_element.h:          contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h
   - __algorithm/ranges_mismatch.h:                contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h
+  - __algorithm/ranges_none_of.h:                 contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h
+  - __algorithm/ranges_reverse.h:                 contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h
   - __algorithm/ranges_swap_ranges.h:             contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h
   - __algorithm/ranges_transform.h:               contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h
   - __algorithm/remove.h:                         contrib/libs/cxxsupp/libcxx/include/__algorithm/remove.h
@@ -475,8 +484,61 @@
   - __support/xlocale/__strtonum_fallback.h:      contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h
   - __thread/poll_with_backoff.h:                 contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h
   - __thread/timed_backoff_policy.h:              contrib/libs/cxxsupp/libcxx/include/__thread/timed_backoff_policy.h
+  - __type_traits/add_const.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h
+  - __type_traits/add_cv.h:                       contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h
+  - __type_traits/add_lvalue_reference.h:         contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h
+  - __type_traits/add_pointer.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h
+  - __type_traits/add_rvalue_reference.h:         contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h
+  - __type_traits/add_volatile.h:                 contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h
+  - __type_traits/conditional.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h
+  - __type_traits/decay.h:                        contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h
+  - __type_traits/enable_if.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h
+  - __type_traits/extent.h:                       contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h
   - __type_traits/integral_constant.h:            contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h
+  - __type_traits/is_abstract.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h
+  - __type_traits/is_aggregate.h:                 contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h
+  - __type_traits/is_arithmetic.h:                contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h
+  - __type_traits/is_array.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h
+  - __type_traits/is_base_of.h:                   contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h
+  - __type_traits/is_bounded_array.h:             contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h
   - __type_traits/is_callable.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h
+  - __type_traits/is_class.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h
+  - __type_traits/is_compound.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h
+  - __type_traits/is_const.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h
+  - __type_traits/is_convertible.h:               contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h
+  - __type_traits/is_empty.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h
+  - __type_traits/is_enum.h:                      contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h
+  - __type_traits/is_final.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h
+  - __type_traits/is_floating_point.h:            contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h
+  - __type_traits/is_function.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h
+  - __type_traits/is_fundamental.h:               contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h
+  - __type_traits/is_integral.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h
+  - __type_traits/is_member_function_pointer.h:   contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h
+  - __type_traits/is_member_object_pointer.h:     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h
+  - __type_traits/is_member_pointer.h:            contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h
+  - __type_traits/is_null_pointer.h:              contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h
+  - __type_traits/is_object.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h
+  - __type_traits/is_pointer.h:                   contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h
+  - __type_traits/is_reference.h:                 contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h
+  - __type_traits/is_reference_wrapper.h:         contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h
+  - __type_traits/is_referenceable.h:             contrib/libs/cxxsupp/libcxx/include/__type_traits/is_referenceable.h
+  - __type_traits/is_same.h:                      contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h
+  - __type_traits/is_scalar.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h
+  - __type_traits/is_signed.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h
+  - __type_traits/is_unbounded_array.h:           contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h
+  - __type_traits/is_union.h:                     contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h
+  - __type_traits/is_unsigned.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h
+  - __type_traits/is_void.h:                      contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h
+  - __type_traits/is_volatile.h:                  contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h
+  - __type_traits/rank.h:                         contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h
+  - __type_traits/remove_all_extents.h:           contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h
+  - __type_traits/remove_const.h:                 contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h
+  - __type_traits/remove_cv.h:                    contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h
+  - __type_traits/remove_extent.h:                contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h
+  - __type_traits/remove_pointer.h:               contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h
+  - __type_traits/remove_reference.h:             contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h
+  - __type_traits/remove_volatile.h:              contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h
+  - __type_traits/type_identity.h:                contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h
   - __utility/as_const.h:                         contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h
   - __utility/auto_cast.h:                        contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h
   - __utility/cmp.h:                              contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h

+ 1 - 1
build/ymake.core.conf

@@ -9,7 +9,7 @@
 FAKEID=628318530716
 
 SANDBOX_FAKEID=${FAKEID}.7600000
-CPP_FAKEID=2023-10-18
+CPP_FAKEID=2023-10-24
 GO_FAKEID=11100371
 ANDROID_FAKEID=2023-05-17
 CLANG_TIDY_FAKEID=2023-06-06

+ 68 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h

@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_ALL_OF_H
+#define _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
+
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__iterator/concepts.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.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 __all_of {
+struct __fn {
+
+  template <class _Iter, class _Sent, class _Proj, class _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr static
+  bool __all_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+    for (; __first != __last; ++__first) {
+      if (!std::invoke(__pred, std::invoke(__proj, *__first)))
+        return false;
+    }
+    return true;
+  }
+
+  template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+    return __all_of_impl(std::move(__first), std::move(__last), __pred, __proj);
+  }
+
+  template <input_range _Range, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+    return __all_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
+  }
+};
+} // namespace __all_of
+
+inline namespace __cpo {
+  inline constexpr auto all_of = __all_of::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_ALL_OF_H

+ 68 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h

@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_ANY_OF_H
+#define _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
+
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__iterator/concepts.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.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 __any_of {
+struct __fn {
+
+  template <class _Iter, class _Sent, class _Proj, class _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr static
+  bool __any_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+    for (; __first != __last; ++__first) {
+      if (std::invoke(__pred, std::invoke(__proj, *__first)))
+        return true;
+    }
+    return false;
+  }
+
+  template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+            indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
+    return __any_of_impl(std::move(__first), std::move(__last), __pred, __proj);
+  }
+
+  template <input_range _Range, class _Proj = identity,
+            indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+    return __any_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
+  }
+};
+} // namespace __any_of
+
+inline namespace __cpo {
+  inline constexpr auto any_of = __any_of::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_ANY_OF_H

+ 115 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h

@@ -0,0 +1,115 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_H
+#define _LIBCPP___ALGORITHM_RANGES_EQUAL_H
+
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/distance.h>
+#include <__iterator/indirectly_comparable.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.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 {
+struct __fn {
+private:
+  template <class _Iter1, class _Sent1,
+            class _Iter2, class _Sent2,
+            class _Pred,
+            class _Proj1,
+            class _Proj2>
+  _LIBCPP_HIDE_FROM_ABI constexpr static
+  bool __equal_impl(_Iter1 __first1, _Sent1 __last1,
+                    _Iter2 __first2, _Sent2 __last2,
+                    _Pred& __pred,
+                    _Proj1& __proj1,
+                    _Proj2& __proj2) {
+    while (__first1 != __last1 && __first2 != __last2) {
+      if (!std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
+        return false;
+      ++__first1;
+      ++__first2;
+    }
+    return __first1 == __last1 && __first2 == __last2;
+  }
+
+public:
+
+  template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
+            input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
+            class _Pred = ranges::equal_to,
+            class _Proj1 = identity,
+            class _Proj2 = identity>
+    requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Iter1 __first1, _Sent1 __last1,
+                  _Iter2 __first2, _Sent2 __last2,
+                  _Pred __pred = {},
+                  _Proj1 __proj1 = {},
+                  _Proj2 __proj2 = {}) const {
+    if constexpr (sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>) {
+      if (__last1 - __first1 != __last2 - __first2)
+        return false;
+    }
+    return __equal_impl(std::move(__first1), std::move(__last1),
+                        std::move(__first2), std::move(__last2),
+                        __pred,
+                        __proj1,
+                        __proj2);
+  }
+
+  template <input_range _Range1,
+            input_range _Range2,
+            class _Pred = ranges::equal_to,
+            class _Proj1 = identity,
+            class _Proj2 = identity>
+    requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  bool operator()(_Range1&& __range1,
+                  _Range2&& __range2,
+                  _Pred __pred = {},
+                  _Proj1 __proj1 = {},
+                  _Proj2 __proj2 = {}) const {
+    if constexpr (sized_range<_Range1> && sized_range<_Range2>) {
+      if (ranges::distance(__range1) != ranges::distance(__range2))
+        return false;
+    }
+    return __equal_impl(ranges::begin(__range1), ranges::end(__range1),
+                        ranges::begin(__range2), ranges::end(__range2),
+                        __pred,
+                        __proj1,
+                        __proj2);
+    return false;
+  }
+};
+} // namespace __equal
+
+inline namespace __cpo {
+  inline constexpr auto equal = __equal::__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_H

+ 59 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h

@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_FILL_H
+#define _LIBCPP___ALGORITHM_RANGES_FILL_H
+
+#include <__algorithm/ranges_fill_n.h>
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.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 __fill {
+struct __fn {
+  template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
+    if constexpr(random_access_iterator<_Iter>) {
+      return ranges::fill_n(__first, __last - __first, __value);
+    } else {
+      for (; __first != __last; ++__first)
+        *__first = __value;
+      return __first;
+    }
+  }
+
+  template <class _Type, output_range<const _Type&> _Range>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const {
+    return (*this)(ranges::begin(__range), ranges::end(__range), __value);
+  }
+};
+} // namespace __fill
+
+inline namespace __cpo {
+  inline constexpr auto fill = __fill::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP___ALGORITHM_RANGES_FILL_H

+ 48 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h

@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_RANGES_FILL_N_H
+#define _LIBCPP___ALGORITHM_RANGES_FILL_N_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.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 __fill_n {
+struct __fn {
+  template <class _Type, output_iterator<const _Type&> _Iter>
+  _LIBCPP_HIDE_FROM_ABI constexpr
+  _Iter operator()(_Iter __first, iter_difference_t<_Iter> __n, const _Type& __value) const {
+    for (; __n != 0; --__n) {
+      *__first = __value;
+      ++__first;
+    }
+    return __first;
+  }
+};
+} // namespace __fill_n
+
+inline namespace __cpo {
+  inline constexpr auto fill_n = __fill_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_FILL_N_H

+ 61 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h

@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_SORTED_H
+#define _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
+
+#include <__algorithm/ranges_is_sorted_until.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.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_sorted {
+struct __fn {
+  template <forward_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 {
+    return ranges::__is_sorted_until_impl(std::move(__first), __last, __comp, __proj) == __last;
+  }
+
+  template <forward_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 {
+    auto __last = ranges::end(__range);
+    return ranges::__is_sorted_until_impl(ranges::begin(__range), __last, __comp, __proj) == __last;
+  }
+};
+} // namespace __is_sorted
+
+inline namespace __cpo {
+  inline constexpr auto is_sorted = __is_sorted::__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_SORTED_H

+ 76 - 0
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h

@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_SORTED_UNTIL_H
+#define _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
+
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.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 _Iter, class _Sent, class _Proj, class _Comp>
+_LIBCPP_HIDE_FROM_ABI constexpr
+_Iter __is_sorted_until_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+  if (__first == __last)
+    return __first;
+  auto __i = __first;
+  while (++__i != __last) {
+    if (std::invoke(__comp, std::invoke(__proj, *__i), std::invoke(__proj, *__first)))
+      return __i;
+    __first = __i;
+  }
+  return __i;
+}
+
+namespace __is_sorted_until {
+struct __fn {
+  template <forward_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 {
+    return ranges::__is_sorted_until_impl(std::move(__first), std::move(__last), __comp, __proj);
+  }
+
+  template <forward_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 {
+    return ranges::__is_sorted_until_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
+  }
+};
+} // namespace __is_sorted_until
+
+inline namespace __cpo {
+  inline constexpr auto is_sorted_until = __is_sorted_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_SORTED_UNTIL_H

+ 2 - 2
contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h

@@ -36,7 +36,7 @@ struct __fn {
   _LIBCPP_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
-    return __min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj);
+    return ranges::__min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj);
   }
 
   template <forward_range _Rp, class _Proj = identity,
@@ -44,7 +44,7 @@ struct __fn {
   _LIBCPP_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
-    return __min_element_impl(ranges::begin(__r), ranges::end(__r), __comp_lhs_rhs_swapped, __proj);
+    return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp_lhs_rhs_swapped, __proj);
   }
 };
 } // namespace __max_element

Some files were not shown because too many files changed in this diff