diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-02-26 00:51:39 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-02-26 00:51:39 +0000 |
commit | ad6fe7242a3a1d2ad0c44f014f4cbb5d681b5ac7 (patch) | |
tree | cc86cca49c006bd524619414aaf3ea95ea712566 /contrib/libs | |
parent | 38b28a98382a639bdc96fa961609b2b815572d7f (diff) | |
parent | 15bb28e76714e036e8c55cf06179b3a870aa6e69 (diff) | |
download | ydb-ad6fe7242a3a1d2ad0c44f014f4cbb5d681b5ac7.tar.gz |
Merge branch 'rightlib' into merge-libs-250226-0050
Diffstat (limited to 'contrib/libs')
516 files changed, 13642 insertions, 11646 deletions
diff --git a/contrib/libs/backtrace/.yandex_meta/override.nix b/contrib/libs/backtrace/.yandex_meta/override.nix index c633909160..a5ebbfe32c 100644 --- a/contrib/libs/backtrace/.yandex_meta/override.nix +++ b/contrib/libs/backtrace/.yandex_meta/override.nix @@ -1,11 +1,11 @@ pkgs: attrs: with pkgs; with attrs; rec { - version = "2025-01-30"; + version = "2025-02-10"; src = fetchFromGitHub { owner = "ianlancetaylor"; repo = "libbacktrace"; - rev = "78af4ffa26e15532847c1ba854ece7b3bacc6b1a"; - hash = "sha256-yx++/urCnaBt2QQsevSXjZ1aAHfBEznk5Dq3JscPyiQ="; + rev = "0034e33946824057b48c5e686a3aefc761b37384"; + hash = "sha256-JCut4afd8a2iXTdbjnyabdWX9JomcSh3qj/RScyVGSw="; }; patches = []; diff --git a/contrib/libs/backtrace/elf.c b/contrib/libs/backtrace/elf.c index 4c8e155573..c6a2b95f1b 100644 --- a/contrib/libs/backtrace/elf.c +++ b/contrib/libs/backtrace/elf.c @@ -5878,7 +5878,7 @@ elf_uncompress_lzma_block (const unsigned char *compressed, /* The byte at compressed[off] is ignored for some reason. */ - code = ((uint32_t)(compressed[off + 1] << 24) + code = (((uint32_t)compressed[off + 1] << 24) + ((uint32_t)compressed[off + 2] << 16) + ((uint32_t)compressed[off + 3] << 8) + (uint32_t)compressed[off + 4]); diff --git a/contrib/libs/backtrace/ya.make b/contrib/libs/backtrace/ya.make index b430051ade..b713cab465 100644 --- a/contrib/libs/backtrace/ya.make +++ b/contrib/libs/backtrace/ya.make @@ -6,9 +6,9 @@ LICENSE(BSD-3-Clause) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(2025-01-30) +VERSION(2025-02-10) -ORIGINAL_SOURCE(https://github.com/ianlancetaylor/libbacktrace/archive/78af4ffa26e15532847c1ba854ece7b3bacc6b1a.tar.gz) +ORIGINAL_SOURCE(https://github.com/ianlancetaylor/libbacktrace/archive/0034e33946824057b48c5e686a3aefc761b37384.tar.gz) ADDINCL( contrib/libs/backtrace diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym b/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym index 87c16c302e..23f291c8a4 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym @@ -1,7 +1,7 @@ {% extends '//builtin/run.ym' %} -{% block current_version %}239236b8c2154aa49e98bc7ed774a7d2712edf50{% endblock %} -{% block current_date %}2024-04-02{% endblock %} +{% block current_version %}8ab82a2dc308c27fbdd0a87b5be7dddc623f1b0e{% endblock %} +{% block current_date %}2024-07-08{% endblock %} {% block keep_sources %} .yandex_meta/scripts/sysincls.py @@ -126,10 +126,11 @@ ELSEIF (OS_LINUX OR OS_DARWIN) ELSEIF (OS_WINDOWS) SET(CXX_RT "msvcrt") SRCS( - src/support/win32/locale_win32.cpp - src/support/win32/support.cpp src/support/win32/atomic_win32.cpp + src/support/win32/compiler_rt_shims.cpp + src/support/win32/locale_win32.cpp src/support/win32/new_win32.cpp + src/support/win32/support.cpp src/support/win32/thread_win32.cpp ) IF (CLANG_CL) @@ -257,6 +258,7 @@ SRCS( src/condition_variable_destructor.cpp src/error_category.cpp src/exception.cpp + src/expected.cpp src/filesystem/directory_entry.cpp src/filesystem/directory_iterator.cpp src/filesystem/filesystem_clock.cpp @@ -308,9 +310,10 @@ ENDIF() IF (OS_LINUX) SRCS( - src/time_zone.cpp - src/tzdb.cpp - src/tzdb_list.cpp + src/experimental/chrono_exception.cpp + src/experimental/time_zone.cpp + src/experimental/tzdb.cpp + src/experimental/tzdb_list.cpp ) ENDIF() diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report index 22f6e355d5..69d79f2014 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report @@ -40,6 +40,7 @@ BELONGS ya.make Files with this license: include/__format/escaped_output_table.h [29:29] include/__format/extended_grapheme_cluster_table.h [29:29] + include/__format/indic_conjunct_break_table.h [29:29] include/__format/width_estimation_table.h [29:29] KEEP COPYRIGHT_SERVICE_LABEL 33fb5dcc2845a99d87d337644dac5e88 @@ -75,6 +76,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: + include/__atomic/atomic_ref.h [9:10] include/__fwd/mdspan.h [9:10] include/__mdspan/default_accessor.h [9:10] include/__mdspan/extents.h [9:10] diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report index f65377500e..e5e4fd87f4 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report @@ -49,7 +49,7 @@ BELONGS ya.make KEEP Unicode 2d55955e8a3f5a6d6611fd7116625ca2 BELONGS ya.make -FILE_INCLUDE include/any found in files: include/__format/escaped_output_table.h at line 32, include/__format/escaped_output_table.h at line 33, include/__format/escaped_output_table.h at line 34, include/__format/extended_grapheme_cluster_table.h at line 32, include/__format/extended_grapheme_cluster_table.h at line 33, include/__format/extended_grapheme_cluster_table.h at line 34, include/__format/width_estimation_table.h at line 32, include/__format/width_estimation_table.h at line 33, include/__format/width_estimation_table.h at line 34 +FILE_INCLUDE include/any found in files: include/__format/escaped_output_table.h at line 32, include/__format/escaped_output_table.h at line 33, include/__format/escaped_output_table.h at line 34, include/__format/extended_grapheme_cluster_table.h at line 32, include/__format/extended_grapheme_cluster_table.h at line 33, include/__format/extended_grapheme_cluster_table.h at line 34, include/__format/indic_conjunct_break_table.h at line 32, include/__format/indic_conjunct_break_table.h at line 33, include/__format/indic_conjunct_break_table.h at line 34, include/__format/width_estimation_table.h at line 32, include/__format/width_estimation_table.h at line 33, include/__format/width_estimation_table.h at line 34 Note: matched license text is too long. Read it in the source files. Scancode info: Original SPDX id: LicenseRef-scancode-unicode @@ -59,6 +59,7 @@ FILE_INCLUDE include/any found in files: include/__format/escaped_output_table.h Files with this license: include/__format/escaped_output_table.h [30:59] include/__format/extended_grapheme_cluster_table.h [30:59] + include/__format/indic_conjunct_break_table.h [30:59] include/__format/width_estimation_table.h [30:59] KEEP Unicode 3f1541867228ee7e8205edaf3a3e0083 @@ -72,6 +73,7 @@ BELONGS ya.make Files with this license: include/__format/escaped_output_table.h [19:27] include/__format/extended_grapheme_cluster_table.h [19:27] + include/__format/indic_conjunct_break_table.h [19:27] include/__format/width_estimation_table.h [19:27] KEEP NCSA 5a35b4c0d3b3923cac31a5a371332ca2 @@ -203,37 +205,7 @@ BELONGS ya.make include/__algorithm/partition_point.h [3:4] include/__algorithm/pop_heap.h [3:4] include/__algorithm/prev_permutation.h [3:4] - include/__algorithm/pstl_any_all_none_of.h [3:4] - include/__algorithm/pstl_backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/any_of.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/fill.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/find_if.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/for_each.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/libdispatch.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/merge.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/serial.h [4:5] - include/__algorithm/pstl_backends/cpu_backends/stable_sort.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/thread.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/transform.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h [3:4] - include/__algorithm/pstl_copy.h [3:4] - include/__algorithm/pstl_count.h [3:4] - include/__algorithm/pstl_equal.h [3:4] - include/__algorithm/pstl_fill.h [3:4] - include/__algorithm/pstl_find.h [3:4] - include/__algorithm/pstl_for_each.h [3:4] - include/__algorithm/pstl_frontend_dispatch.h [3:4] - include/__algorithm/pstl_generate.h [3:4] - include/__algorithm/pstl_is_partitioned.h [3:4] - include/__algorithm/pstl_merge.h [3:4] - include/__algorithm/pstl_move.h [3:4] - include/__algorithm/pstl_replace.h [3:4] - include/__algorithm/pstl_rotate_copy.h [3:4] - include/__algorithm/pstl_sort.h [3:4] - include/__algorithm/pstl_stable_sort.h [3:4] - include/__algorithm/pstl_transform.h [3:4] + include/__algorithm/pstl.h [3:4] include/__algorithm/push_heap.h [3:4] include/__algorithm/ranges_adjacent_find.h [3:4] include/__algorithm/ranges_all_of.h [3:4] @@ -370,6 +342,7 @@ BELONGS ya.make include/__atomic/atomic_flag.h [3:4] include/__atomic/atomic_init.h [3:4] include/__atomic/atomic_lock_free.h [3:4] + include/__atomic/atomic_ref.h [4:5] include/__atomic/atomic_sync.h [3:4] include/__atomic/check_memory_order.h [3:4] include/__atomic/contention_t.h [3:4] @@ -378,7 +351,7 @@ BELONGS ya.make include/__atomic/is_always_lock_free.h [3:4] include/__atomic/kill_dependency.h [3:4] include/__atomic/memory_order.h [3:4] - include/__availability [4:5] + include/__atomic/to_gcc_order.h [3:4] include/__bit/bit_cast.h [4:5] include/__bit/bit_ceil.h [3:4] include/__bit/bit_floor.h [3:4] @@ -410,11 +383,14 @@ BELONGS ya.make include/__chrono/convert_to_tm.h [4:5] include/__chrono/day.h [4:5] include/__chrono/duration.h [4:5] + include/__chrono/exception.h [4:5] include/__chrono/file_clock.h [4:5] include/__chrono/formatter.h [4:5] include/__chrono/hh_mm_ss.h [4:5] include/__chrono/high_resolution_clock.h [4:5] + include/__chrono/leap_second.h [4:5] include/__chrono/literals.h [4:5] + include/__chrono/local_info.h [4:5] include/__chrono/month.h [4:5] include/__chrono/month_weekday.h [4:5] include/__chrono/monthday.h [4:5] @@ -422,6 +398,7 @@ BELONGS ya.make include/__chrono/parser_std_format_spec.h [4:5] include/__chrono/statically_widen.h [4:5] include/__chrono/steady_clock.h [4:5] + include/__chrono/sys_info.h [4:5] include/__chrono/system_clock.h [4:5] include/__chrono/time_point.h [4:5] include/__chrono/time_zone.h [4:5] @@ -433,6 +410,7 @@ BELONGS ya.make include/__chrono/year_month.h [4:5] include/__chrono/year_month_day.h [4:5] include/__chrono/year_month_weekday.h [4:5] + include/__chrono/zoned_time.h [4:5] include/__compare/common_comparison_category.h [3:4] include/__compare/compare_partial_order_fallback.h [3:4] include/__compare/compare_strong_order_fallback.h [3:4] @@ -471,11 +449,17 @@ BELONGS ya.make include/__condition_variable/condition_variable.h [3:4] include/__config [4:5] include/__config_site.in [3:4] + include/__configuration/abi.h [4:5] + include/__configuration/availability.h [4:5] + include/__configuration/compiler.h [4:5] + include/__configuration/language.h [4:5] + include/__configuration/platform.h [4:5] include/__coroutine/coroutine_handle.h [3:4] include/__coroutine/coroutine_traits.h [3:4] include/__coroutine/noop_coroutine_handle.h [3:4] include/__coroutine/trivial_awaitables.h [3:4] include/__debug_utils/randomize_range.h [3:4] + include/__debug_utils/sanitizers.h [3:4] include/__debug_utils/strict_weak_ordering_check.h [3:4] include/__exception/exception.h [3:4] include/__exception/exception_ptr.h [3:4] @@ -527,6 +511,7 @@ BELONGS ya.make include/__format/formatter_pointer.h [4:5] include/__format/formatter_string.h [4:5] include/__format/formatter_tuple.h [4:5] + include/__format/indic_conjunct_break_table.h [4:5] include/__format/parser_std_format_spec.h [4:5] include/__format/range_default_formatter.h [4:5] include/__format/range_formatter.h [4:5] @@ -588,6 +573,7 @@ BELONGS ya.make include/__ios/fpos.h [4:5] include/__iterator/access.h [4:5] include/__iterator/advance.h [4:5] + include/__iterator/aliasing_iterator.h [3:4] include/__iterator/back_insert_iterator.h [4:5] include/__iterator/bounded_iter.h [4:5] include/__iterator/common_iterator.h [4:5] @@ -717,13 +703,31 @@ BELONGS ya.make include/__numeric/iota.h [4:5] include/__numeric/midpoint.h [4:5] include/__numeric/partial_sum.h [4:5] - include/__numeric/pstl_reduce.h [3:4] - include/__numeric/pstl_transform_reduce.h [3:4] + include/__numeric/pstl.h [3:4] include/__numeric/reduce.h [4:5] include/__numeric/saturation_arithmetic.h [4:5] include/__numeric/transform_exclusive_scan.h [4:5] include/__numeric/transform_inclusive_scan.h [4:5] include/__numeric/transform_reduce.h [4:5] + include/__ostream/basic_ostream.h [3:4] + include/__ostream/print.h [3:4] + include/__pstl/backend.h [3:4] + include/__pstl/backend_fwd.h [3:4] + include/__pstl/backends/default.h [3:4] + include/__pstl/backends/libdispatch.h [3:4] + include/__pstl/backends/serial.h [4:5] + include/__pstl/backends/std_thread.h [3:4] + include/__pstl/cpu_algos/any_of.h [3:4] + include/__pstl/cpu_algos/cpu_traits.h [3:4] + include/__pstl/cpu_algos/fill.h [3:4] + include/__pstl/cpu_algos/find_if.h [3:4] + include/__pstl/cpu_algos/for_each.h [3:4] + include/__pstl/cpu_algos/merge.h [3:4] + include/__pstl/cpu_algos/stable_sort.h [3:4] + include/__pstl/cpu_algos/transform.h [3:4] + include/__pstl/cpu_algos/transform_reduce.h [3:4] + include/__pstl/dispatch.h [3:4] + include/__pstl/handle_exception.h [3:4] include/__random/bernoulli_distribution.h [3:4] include/__random/binomial_distribution.h [3:4] include/__random/cauchy_distribution.h [3:4] @@ -860,7 +864,6 @@ BELONGS ya.make include/__type_traits/aligned_storage.h [3:4] include/__type_traits/aligned_union.h [3:4] include/__type_traits/alignment_of.h [3:4] - include/__type_traits/apply_cv.h [3:4] include/__type_traits/can_extract_key.h [3:4] include/__type_traits/common_reference.h [3:4] include/__type_traits/common_type.h [3:4] @@ -871,6 +874,7 @@ BELONGS ya.make include/__type_traits/datasizeof.h [3:4] include/__type_traits/decay.h [3:4] include/__type_traits/dependent_type.h [3:4] + include/__type_traits/desugars_to.h [3:4] include/__type_traits/disjunction.h [3:4] include/__type_traits/enable_if.h [3:4] include/__type_traits/extent.h [3:4] @@ -955,7 +959,6 @@ BELONGS ya.make include/__type_traits/nat.h [3:4] include/__type_traits/negation.h [3:4] include/__type_traits/noexcept_move_assign_container.h [3:4] - include/__type_traits/operation_traits.h [3:4] include/__type_traits/promote.h [3:4] include/__type_traits/rank.h [3:4] include/__type_traits/remove_all_extents.h [3:4] @@ -989,11 +992,13 @@ BELONGS ya.make include/__utility/in_place.h [3:4] include/__utility/integer_sequence.h [3:4] include/__utility/is_pointer_in_range.h [3:4] + include/__utility/is_valid_range.h [3:4] include/__utility/move.h [4:5] include/__utility/no_destroy.h [3:4] include/__utility/pair.h [3:4] include/__utility/piecewise_construct.h [3:4] include/__utility/priority_tag.h [3:4] + include/__utility/private_constructor_tag.h [4:5] include/__utility/rel_ops.h [3:4] include/__utility/small_buffer.h [3:4] include/__utility/swap.h [3:4] @@ -1157,7 +1162,16 @@ BELONGS ya.make src/condition_variable_destructor.cpp [3:4] src/error_category.cpp [3:4] src/exception.cpp [3:4] + src/expected.cpp [3:4] + src/experimental/chrono_exception.cpp [3:4] + src/experimental/include/tzdb/time_zone_private.h [4:5] + src/experimental/include/tzdb/types_private.h [4:5] + src/experimental/include/tzdb/tzdb_list_private.h [3:4] + src/experimental/include/tzdb/tzdb_private.h [3:4] src/experimental/keep.cpp [3:4] + src/experimental/time_zone.cpp [3:4] + src/experimental/tzdb.cpp [3:4] + src/experimental/tzdb_list.cpp [3:4] src/filesystem/directory_entry.cpp [3:4] src/filesystem/directory_iterator.cpp [3:4] src/filesystem/error.h [3:4] @@ -1190,11 +1204,6 @@ BELONGS ya.make src/include/ryu/ryu.h [4:5] src/include/sso_allocator.h [4:5] src/include/to_chars_floating_point.h [3:4] - src/include/tzdb/time_zone_link_private.h [4:5] - src/include/tzdb/time_zone_private.h [4:5] - src/include/tzdb/types_private.h [4:5] - src/include/tzdb/tzdb_list_private.h [3:4] - src/include/tzdb/tzdb_private.h [3:4] src/ios.cpp [3:4] src/ios.instantiations.cpp [3:4] src/iostream.cpp [3:4] @@ -1236,15 +1245,13 @@ BELONGS ya.make src/support/runtime/exception_pointer_unimplemented.ipp [4:5] src/support/runtime/stdexcept_default.ipp [3:4] src/support/runtime/stdexcept_vcruntime.ipp [3:4] + src/support/win32/compiler_rt_shims.cpp [3:4] src/support/win32/locale_win32.cpp [3:4] src/support/win32/support.cpp [3:4] src/support/win32/thread_win32.cpp [3:4] src/system_error.cpp [3:4] src/thread.cpp [3:4] - src/time_zone.cpp [3:4] src/typeinfo.cpp [3:4] - src/tzdb.cpp [3:4] - src/tzdb_list.cpp [3:4] src/valarray.cpp [3:4] src/variant.cpp [3:4] src/vector.cpp [3:4] @@ -1328,37 +1335,7 @@ BELONGS ya.make include/__algorithm/partition_point.h [3:4] include/__algorithm/pop_heap.h [3:4] include/__algorithm/prev_permutation.h [3:4] - include/__algorithm/pstl_any_all_none_of.h [3:4] - include/__algorithm/pstl_backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/any_of.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/backend.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/fill.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/find_if.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/for_each.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/libdispatch.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/merge.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/serial.h [4:5] - include/__algorithm/pstl_backends/cpu_backends/stable_sort.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/thread.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/transform.h [3:4] - include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h [3:4] - include/__algorithm/pstl_copy.h [3:4] - include/__algorithm/pstl_count.h [3:4] - include/__algorithm/pstl_equal.h [3:4] - include/__algorithm/pstl_fill.h [3:4] - include/__algorithm/pstl_find.h [3:4] - include/__algorithm/pstl_for_each.h [3:4] - include/__algorithm/pstl_frontend_dispatch.h [3:4] - include/__algorithm/pstl_generate.h [3:4] - include/__algorithm/pstl_is_partitioned.h [3:4] - include/__algorithm/pstl_merge.h [3:4] - include/__algorithm/pstl_move.h [3:4] - include/__algorithm/pstl_replace.h [3:4] - include/__algorithm/pstl_rotate_copy.h [3:4] - include/__algorithm/pstl_sort.h [3:4] - include/__algorithm/pstl_stable_sort.h [3:4] - include/__algorithm/pstl_transform.h [3:4] + include/__algorithm/pstl.h [3:4] include/__algorithm/push_heap.h [3:4] include/__algorithm/ranges_adjacent_find.h [3:4] include/__algorithm/ranges_all_of.h [3:4] @@ -1495,6 +1472,7 @@ BELONGS ya.make include/__atomic/atomic_flag.h [3:4] include/__atomic/atomic_init.h [3:4] include/__atomic/atomic_lock_free.h [3:4] + include/__atomic/atomic_ref.h [4:5] include/__atomic/atomic_sync.h [3:4] include/__atomic/check_memory_order.h [3:4] include/__atomic/contention_t.h [3:4] @@ -1503,7 +1481,7 @@ BELONGS ya.make include/__atomic/is_always_lock_free.h [3:4] include/__atomic/kill_dependency.h [3:4] include/__atomic/memory_order.h [3:4] - include/__availability [4:5] + include/__atomic/to_gcc_order.h [3:4] include/__bit/bit_cast.h [4:5] include/__bit/bit_ceil.h [3:4] include/__bit/bit_floor.h [3:4] @@ -1535,11 +1513,14 @@ BELONGS ya.make include/__chrono/convert_to_tm.h [4:5] include/__chrono/day.h [4:5] include/__chrono/duration.h [4:5] + include/__chrono/exception.h [4:5] include/__chrono/file_clock.h [4:5] include/__chrono/formatter.h [4:5] include/__chrono/hh_mm_ss.h [4:5] include/__chrono/high_resolution_clock.h [4:5] + include/__chrono/leap_second.h [4:5] include/__chrono/literals.h [4:5] + include/__chrono/local_info.h [4:5] include/__chrono/month.h [4:5] include/__chrono/month_weekday.h [4:5] include/__chrono/monthday.h [4:5] @@ -1547,6 +1528,7 @@ BELONGS ya.make include/__chrono/parser_std_format_spec.h [4:5] include/__chrono/statically_widen.h [4:5] include/__chrono/steady_clock.h [4:5] + include/__chrono/sys_info.h [4:5] include/__chrono/system_clock.h [4:5] include/__chrono/time_point.h [4:5] include/__chrono/time_zone.h [4:5] @@ -1558,6 +1540,7 @@ BELONGS ya.make include/__chrono/year_month.h [4:5] include/__chrono/year_month_day.h [4:5] include/__chrono/year_month_weekday.h [4:5] + include/__chrono/zoned_time.h [4:5] include/__compare/common_comparison_category.h [3:4] include/__compare/compare_partial_order_fallback.h [3:4] include/__compare/compare_strong_order_fallback.h [3:4] @@ -1596,11 +1579,17 @@ BELONGS ya.make include/__condition_variable/condition_variable.h [3:4] include/__config [4:5] include/__config_site.in [3:4] + include/__configuration/abi.h [4:5] + include/__configuration/availability.h [4:5] + include/__configuration/compiler.h [4:5] + include/__configuration/language.h [4:5] + include/__configuration/platform.h [4:5] include/__coroutine/coroutine_handle.h [3:4] include/__coroutine/coroutine_traits.h [3:4] include/__coroutine/noop_coroutine_handle.h [3:4] include/__coroutine/trivial_awaitables.h [3:4] include/__debug_utils/randomize_range.h [3:4] + include/__debug_utils/sanitizers.h [3:4] include/__debug_utils/strict_weak_ordering_check.h [3:4] include/__exception/exception.h [3:4] include/__exception/exception_ptr.h [3:4] @@ -1652,6 +1641,7 @@ BELONGS ya.make include/__format/formatter_pointer.h [4:5] include/__format/formatter_string.h [4:5] include/__format/formatter_tuple.h [4:5] + include/__format/indic_conjunct_break_table.h [4:5] include/__format/parser_std_format_spec.h [4:5] include/__format/range_default_formatter.h [4:5] include/__format/range_formatter.h [4:5] @@ -1713,6 +1703,7 @@ BELONGS ya.make include/__ios/fpos.h [4:5] include/__iterator/access.h [4:5] include/__iterator/advance.h [4:5] + include/__iterator/aliasing_iterator.h [3:4] include/__iterator/back_insert_iterator.h [4:5] include/__iterator/bounded_iter.h [4:5] include/__iterator/common_iterator.h [4:5] @@ -1842,13 +1833,31 @@ BELONGS ya.make include/__numeric/iota.h [4:5] include/__numeric/midpoint.h [4:5] include/__numeric/partial_sum.h [4:5] - include/__numeric/pstl_reduce.h [3:4] - include/__numeric/pstl_transform_reduce.h [3:4] + include/__numeric/pstl.h [3:4] include/__numeric/reduce.h [4:5] include/__numeric/saturation_arithmetic.h [4:5] include/__numeric/transform_exclusive_scan.h [4:5] include/__numeric/transform_inclusive_scan.h [4:5] include/__numeric/transform_reduce.h [4:5] + include/__ostream/basic_ostream.h [3:4] + include/__ostream/print.h [3:4] + include/__pstl/backend.h [3:4] + include/__pstl/backend_fwd.h [3:4] + include/__pstl/backends/default.h [3:4] + include/__pstl/backends/libdispatch.h [3:4] + include/__pstl/backends/serial.h [4:5] + include/__pstl/backends/std_thread.h [3:4] + include/__pstl/cpu_algos/any_of.h [3:4] + include/__pstl/cpu_algos/cpu_traits.h [3:4] + include/__pstl/cpu_algos/fill.h [3:4] + include/__pstl/cpu_algos/find_if.h [3:4] + include/__pstl/cpu_algos/for_each.h [3:4] + include/__pstl/cpu_algos/merge.h [3:4] + include/__pstl/cpu_algos/stable_sort.h [3:4] + include/__pstl/cpu_algos/transform.h [3:4] + include/__pstl/cpu_algos/transform_reduce.h [3:4] + include/__pstl/dispatch.h [3:4] + include/__pstl/handle_exception.h [3:4] include/__random/bernoulli_distribution.h [3:4] include/__random/binomial_distribution.h [3:4] include/__random/cauchy_distribution.h [3:4] @@ -1985,7 +1994,6 @@ BELONGS ya.make include/__type_traits/aligned_storage.h [3:4] include/__type_traits/aligned_union.h [3:4] include/__type_traits/alignment_of.h [3:4] - include/__type_traits/apply_cv.h [3:4] include/__type_traits/can_extract_key.h [3:4] include/__type_traits/common_reference.h [3:4] include/__type_traits/common_type.h [3:4] @@ -1996,6 +2004,7 @@ BELONGS ya.make include/__type_traits/datasizeof.h [3:4] include/__type_traits/decay.h [3:4] include/__type_traits/dependent_type.h [3:4] + include/__type_traits/desugars_to.h [3:4] include/__type_traits/disjunction.h [3:4] include/__type_traits/enable_if.h [3:4] include/__type_traits/extent.h [3:4] @@ -2080,7 +2089,6 @@ BELONGS ya.make include/__type_traits/nat.h [3:4] include/__type_traits/negation.h [3:4] include/__type_traits/noexcept_move_assign_container.h [3:4] - include/__type_traits/operation_traits.h [3:4] include/__type_traits/promote.h [3:4] include/__type_traits/rank.h [3:4] include/__type_traits/remove_all_extents.h [3:4] @@ -2114,11 +2122,13 @@ BELONGS ya.make include/__utility/in_place.h [3:4] include/__utility/integer_sequence.h [3:4] include/__utility/is_pointer_in_range.h [3:4] + include/__utility/is_valid_range.h [3:4] include/__utility/move.h [4:5] include/__utility/no_destroy.h [3:4] include/__utility/pair.h [3:4] include/__utility/piecewise_construct.h [3:4] include/__utility/priority_tag.h [3:4] + include/__utility/private_constructor_tag.h [4:5] include/__utility/rel_ops.h [3:4] include/__utility/small_buffer.h [3:4] include/__utility/swap.h [3:4] @@ -2282,7 +2292,16 @@ BELONGS ya.make src/condition_variable_destructor.cpp [3:4] src/error_category.cpp [3:4] src/exception.cpp [3:4] + src/expected.cpp [3:4] + src/experimental/chrono_exception.cpp [3:4] + src/experimental/include/tzdb/time_zone_private.h [4:5] + src/experimental/include/tzdb/types_private.h [4:5] + src/experimental/include/tzdb/tzdb_list_private.h [3:4] + src/experimental/include/tzdb/tzdb_private.h [3:4] src/experimental/keep.cpp [3:4] + src/experimental/time_zone.cpp [3:4] + src/experimental/tzdb.cpp [3:4] + src/experimental/tzdb_list.cpp [3:4] src/filesystem/directory_entry.cpp [3:4] src/filesystem/directory_iterator.cpp [3:4] src/filesystem/error.h [3:4] @@ -2315,11 +2334,6 @@ BELONGS ya.make src/include/ryu/ryu.h [4:5] src/include/sso_allocator.h [4:5] src/include/to_chars_floating_point.h [3:4] - src/include/tzdb/time_zone_link_private.h [4:5] - src/include/tzdb/time_zone_private.h [4:5] - src/include/tzdb/types_private.h [4:5] - src/include/tzdb/tzdb_list_private.h [3:4] - src/include/tzdb/tzdb_private.h [3:4] src/ios.cpp [3:4] src/ios.instantiations.cpp [3:4] src/iostream.cpp [3:4] @@ -2361,15 +2375,13 @@ BELONGS ya.make src/support/runtime/exception_pointer_unimplemented.ipp [4:5] src/support/runtime/stdexcept_default.ipp [3:4] src/support/runtime/stdexcept_vcruntime.ipp [3:4] + src/support/win32/compiler_rt_shims.cpp [3:4] src/support/win32/locale_win32.cpp [3:4] src/support/win32/support.cpp [3:4] src/support/win32/thread_win32.cpp [3:4] src/system_error.cpp [3:4] src/thread.cpp [3:4] - src/time_zone.cpp [3:4] src/typeinfo.cpp [3:4] - src/tzdb.cpp [3:4] - src/tzdb_list.cpp [3:4] src/valarray.cpp [3:4] src/variant.cpp [3:4] src/vector.cpp [3:4] @@ -2386,7 +2398,7 @@ BELONGS ya.make Match type : NOTICE Links : http://www.linfo.org/publicdomain.html, https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/public-domain.LICENSE Files with this license: - src/tzdb.cpp [26:27] + src/experimental/tzdb.cpp [25:26] KEEP Apache-2.0 WITH LLVM-exception 8494a9caed330d9a4f40e19cce7dc770 BELONGS ya.make @@ -2512,37 +2524,7 @@ BELONGS ya.make include/__algorithm/partition_point.h [5:5] include/__algorithm/pop_heap.h [5:5] include/__algorithm/prev_permutation.h [5:5] - include/__algorithm/pstl_any_all_none_of.h [5:5] - include/__algorithm/pstl_backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/any_of.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/fill.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/find_if.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/for_each.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/libdispatch.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/merge.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/serial.h [6:6] - include/__algorithm/pstl_backends/cpu_backends/stable_sort.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/thread.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/transform.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h [5:5] - include/__algorithm/pstl_copy.h [5:5] - include/__algorithm/pstl_count.h [5:5] - include/__algorithm/pstl_equal.h [5:5] - include/__algorithm/pstl_fill.h [5:5] - include/__algorithm/pstl_find.h [5:5] - include/__algorithm/pstl_for_each.h [5:5] - include/__algorithm/pstl_frontend_dispatch.h [5:5] - include/__algorithm/pstl_generate.h [5:5] - include/__algorithm/pstl_is_partitioned.h [5:5] - include/__algorithm/pstl_merge.h [5:5] - include/__algorithm/pstl_move.h [5:5] - include/__algorithm/pstl_replace.h [5:5] - include/__algorithm/pstl_rotate_copy.h [5:5] - include/__algorithm/pstl_sort.h [5:5] - include/__algorithm/pstl_stable_sort.h [5:5] - include/__algorithm/pstl_transform.h [5:5] + include/__algorithm/pstl.h [5:5] include/__algorithm/push_heap.h [5:5] include/__algorithm/ranges_adjacent_find.h [5:5] include/__algorithm/ranges_all_of.h [5:5] @@ -2679,6 +2661,7 @@ BELONGS ya.make include/__atomic/atomic_flag.h [5:5] include/__atomic/atomic_init.h [5:5] include/__atomic/atomic_lock_free.h [5:5] + include/__atomic/atomic_ref.h [6:6] include/__atomic/atomic_sync.h [5:5] include/__atomic/check_memory_order.h [5:5] include/__atomic/contention_t.h [5:5] @@ -2687,7 +2670,7 @@ BELONGS ya.make include/__atomic/is_always_lock_free.h [5:5] include/__atomic/kill_dependency.h [5:5] include/__atomic/memory_order.h [5:5] - include/__availability [6:6] + include/__atomic/to_gcc_order.h [5:5] include/__bit/bit_cast.h [6:6] include/__bit/bit_ceil.h [5:5] include/__bit/bit_floor.h [5:5] @@ -2719,11 +2702,14 @@ BELONGS ya.make include/__chrono/convert_to_tm.h [6:6] include/__chrono/day.h [6:6] include/__chrono/duration.h [6:6] + include/__chrono/exception.h [6:6] include/__chrono/file_clock.h [6:6] include/__chrono/formatter.h [6:6] include/__chrono/hh_mm_ss.h [6:6] include/__chrono/high_resolution_clock.h [6:6] + include/__chrono/leap_second.h [6:6] include/__chrono/literals.h [6:6] + include/__chrono/local_info.h [6:6] include/__chrono/month.h [6:6] include/__chrono/month_weekday.h [6:6] include/__chrono/monthday.h [6:6] @@ -2731,6 +2717,7 @@ BELONGS ya.make include/__chrono/parser_std_format_spec.h [6:6] include/__chrono/statically_widen.h [6:6] include/__chrono/steady_clock.h [6:6] + include/__chrono/sys_info.h [6:6] include/__chrono/system_clock.h [6:6] include/__chrono/time_point.h [6:6] include/__chrono/time_zone.h [6:6] @@ -2742,6 +2729,7 @@ BELONGS ya.make include/__chrono/year_month.h [6:6] include/__chrono/year_month_day.h [6:6] include/__chrono/year_month_weekday.h [6:6] + include/__chrono/zoned_time.h [6:6] include/__compare/common_comparison_category.h [5:5] include/__compare/compare_partial_order_fallback.h [5:5] include/__compare/compare_strong_order_fallback.h [5:5] @@ -2780,11 +2768,17 @@ BELONGS ya.make include/__condition_variable/condition_variable.h [5:5] include/__config [6:6] include/__config_site.in [5:5] + include/__configuration/abi.h [6:6] + include/__configuration/availability.h [6:6] + include/__configuration/compiler.h [6:6] + include/__configuration/language.h [6:6] + include/__configuration/platform.h [6:6] include/__coroutine/coroutine_handle.h [5:5] include/__coroutine/coroutine_traits.h [5:5] include/__coroutine/noop_coroutine_handle.h [5:5] include/__coroutine/trivial_awaitables.h [5:5] include/__debug_utils/randomize_range.h [5:5] + include/__debug_utils/sanitizers.h [5:5] include/__debug_utils/strict_weak_ordering_check.h [5:5] include/__exception/exception.h [5:5] include/__exception/exception_ptr.h [5:5] @@ -2836,6 +2830,7 @@ BELONGS ya.make include/__format/formatter_pointer.h [6:6] include/__format/formatter_string.h [6:6] include/__format/formatter_tuple.h [6:6] + include/__format/indic_conjunct_break_table.h [6:6] include/__format/parser_std_format_spec.h [6:6] include/__format/range_default_formatter.h [6:6] include/__format/range_formatter.h [6:6] @@ -2897,6 +2892,7 @@ BELONGS ya.make include/__ios/fpos.h [6:6] include/__iterator/access.h [6:6] include/__iterator/advance.h [6:6] + include/__iterator/aliasing_iterator.h [5:5] include/__iterator/back_insert_iterator.h [6:6] include/__iterator/bounded_iter.h [6:6] include/__iterator/common_iterator.h [6:6] @@ -3026,13 +3022,31 @@ BELONGS ya.make include/__numeric/iota.h [6:6] include/__numeric/midpoint.h [6:6] include/__numeric/partial_sum.h [6:6] - include/__numeric/pstl_reduce.h [5:5] - include/__numeric/pstl_transform_reduce.h [5:5] + include/__numeric/pstl.h [5:5] include/__numeric/reduce.h [6:6] include/__numeric/saturation_arithmetic.h [6:6] include/__numeric/transform_exclusive_scan.h [6:6] include/__numeric/transform_inclusive_scan.h [6:6] include/__numeric/transform_reduce.h [6:6] + include/__ostream/basic_ostream.h [5:5] + include/__ostream/print.h [5:5] + include/__pstl/backend.h [5:5] + include/__pstl/backend_fwd.h [5:5] + include/__pstl/backends/default.h [5:5] + include/__pstl/backends/libdispatch.h [5:5] + include/__pstl/backends/serial.h [6:6] + include/__pstl/backends/std_thread.h [5:5] + include/__pstl/cpu_algos/any_of.h [5:5] + include/__pstl/cpu_algos/cpu_traits.h [5:5] + include/__pstl/cpu_algos/fill.h [5:5] + include/__pstl/cpu_algos/find_if.h [5:5] + include/__pstl/cpu_algos/for_each.h [5:5] + include/__pstl/cpu_algos/merge.h [5:5] + include/__pstl/cpu_algos/stable_sort.h [5:5] + include/__pstl/cpu_algos/transform.h [5:5] + include/__pstl/cpu_algos/transform_reduce.h [5:5] + include/__pstl/dispatch.h [5:5] + include/__pstl/handle_exception.h [5:5] include/__random/bernoulli_distribution.h [5:5] include/__random/binomial_distribution.h [5:5] include/__random/cauchy_distribution.h [5:5] @@ -3169,7 +3183,6 @@ BELONGS ya.make include/__type_traits/aligned_storage.h [5:5] include/__type_traits/aligned_union.h [5:5] include/__type_traits/alignment_of.h [5:5] - include/__type_traits/apply_cv.h [5:5] include/__type_traits/can_extract_key.h [5:5] include/__type_traits/common_reference.h [5:5] include/__type_traits/common_type.h [5:5] @@ -3180,6 +3193,7 @@ BELONGS ya.make include/__type_traits/datasizeof.h [5:5] include/__type_traits/decay.h [5:5] include/__type_traits/dependent_type.h [5:5] + include/__type_traits/desugars_to.h [5:5] include/__type_traits/disjunction.h [5:5] include/__type_traits/enable_if.h [5:5] include/__type_traits/extent.h [5:5] @@ -3264,7 +3278,6 @@ BELONGS ya.make include/__type_traits/nat.h [5:5] include/__type_traits/negation.h [5:5] include/__type_traits/noexcept_move_assign_container.h [5:5] - include/__type_traits/operation_traits.h [5:5] include/__type_traits/promote.h [5:5] include/__type_traits/rank.h [5:5] include/__type_traits/remove_all_extents.h [5:5] @@ -3298,11 +3311,13 @@ BELONGS ya.make include/__utility/in_place.h [5:5] include/__utility/integer_sequence.h [5:5] include/__utility/is_pointer_in_range.h [5:5] + include/__utility/is_valid_range.h [5:5] include/__utility/move.h [6:6] include/__utility/no_destroy.h [5:5] include/__utility/pair.h [5:5] include/__utility/piecewise_construct.h [5:5] include/__utility/priority_tag.h [5:5] + include/__utility/private_constructor_tag.h [6:6] include/__utility/rel_ops.h [5:5] include/__utility/small_buffer.h [5:5] include/__utility/swap.h [5:5] @@ -3467,7 +3482,16 @@ BELONGS ya.make src/condition_variable_destructor.cpp [5:5] src/error_category.cpp [5:5] src/exception.cpp [5:5] + src/expected.cpp [5:5] + src/experimental/chrono_exception.cpp [5:5] + src/experimental/include/tzdb/time_zone_private.h [6:6] + src/experimental/include/tzdb/types_private.h [6:6] + src/experimental/include/tzdb/tzdb_list_private.h [5:5] + src/experimental/include/tzdb/tzdb_private.h [5:5] src/experimental/keep.cpp [5:5] + src/experimental/time_zone.cpp [5:5] + src/experimental/tzdb.cpp [5:5] + src/experimental/tzdb_list.cpp [5:5] src/filesystem/directory_entry.cpp [5:5] src/filesystem/directory_iterator.cpp [5:5] src/filesystem/error.h [5:5] @@ -3510,11 +3534,6 @@ BELONGS ya.make src/include/sso_allocator.h [6:6] src/include/to_chars_floating_point.h [5:5] src/include/to_chars_floating_point.h [10:10] - src/include/tzdb/time_zone_link_private.h [6:6] - src/include/tzdb/time_zone_private.h [6:6] - src/include/tzdb/types_private.h [6:6] - src/include/tzdb/tzdb_list_private.h [5:5] - src/include/tzdb/tzdb_private.h [5:5] src/ios.cpp [5:5] src/ios.instantiations.cpp [5:5] src/iostream.cpp [5:5] @@ -3559,15 +3578,13 @@ BELONGS ya.make src/support/runtime/exception_pointer_unimplemented.ipp [6:6] src/support/runtime/stdexcept_default.ipp [5:5] src/support/runtime/stdexcept_vcruntime.ipp [5:5] + src/support/win32/compiler_rt_shims.cpp [5:5] src/support/win32/locale_win32.cpp [5:5] src/support/win32/support.cpp [5:5] src/support/win32/thread_win32.cpp [5:5] src/system_error.cpp [5:5] src/thread.cpp [5:5] - src/time_zone.cpp [5:5] src/typeinfo.cpp [5:5] - src/tzdb.cpp [5:5] - src/tzdb_list.cpp [5:5] src/valarray.cpp [5:5] src/variant.cpp [5:5] src/vector.cpp [5:5] @@ -3651,37 +3668,7 @@ BELONGS ya.make include/__algorithm/partition_point.h [5:5] include/__algorithm/pop_heap.h [5:5] include/__algorithm/prev_permutation.h [5:5] - include/__algorithm/pstl_any_all_none_of.h [5:5] - include/__algorithm/pstl_backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/any_of.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/backend.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/fill.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/find_if.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/for_each.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/libdispatch.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/merge.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/serial.h [6:6] - include/__algorithm/pstl_backends/cpu_backends/stable_sort.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/thread.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/transform.h [5:5] - include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h [5:5] - include/__algorithm/pstl_copy.h [5:5] - include/__algorithm/pstl_count.h [5:5] - include/__algorithm/pstl_equal.h [5:5] - include/__algorithm/pstl_fill.h [5:5] - include/__algorithm/pstl_find.h [5:5] - include/__algorithm/pstl_for_each.h [5:5] - include/__algorithm/pstl_frontend_dispatch.h [5:5] - include/__algorithm/pstl_generate.h [5:5] - include/__algorithm/pstl_is_partitioned.h [5:5] - include/__algorithm/pstl_merge.h [5:5] - include/__algorithm/pstl_move.h [5:5] - include/__algorithm/pstl_replace.h [5:5] - include/__algorithm/pstl_rotate_copy.h [5:5] - include/__algorithm/pstl_sort.h [5:5] - include/__algorithm/pstl_stable_sort.h [5:5] - include/__algorithm/pstl_transform.h [5:5] + include/__algorithm/pstl.h [5:5] include/__algorithm/push_heap.h [5:5] include/__algorithm/ranges_adjacent_find.h [5:5] include/__algorithm/ranges_all_of.h [5:5] @@ -3818,6 +3805,7 @@ BELONGS ya.make include/__atomic/atomic_flag.h [5:5] include/__atomic/atomic_init.h [5:5] include/__atomic/atomic_lock_free.h [5:5] + include/__atomic/atomic_ref.h [6:6] include/__atomic/atomic_sync.h [5:5] include/__atomic/check_memory_order.h [5:5] include/__atomic/contention_t.h [5:5] @@ -3826,7 +3814,7 @@ BELONGS ya.make include/__atomic/is_always_lock_free.h [5:5] include/__atomic/kill_dependency.h [5:5] include/__atomic/memory_order.h [5:5] - include/__availability [6:6] + include/__atomic/to_gcc_order.h [5:5] include/__bit/bit_cast.h [6:6] include/__bit/bit_ceil.h [5:5] include/__bit/bit_floor.h [5:5] @@ -3858,11 +3846,14 @@ BELONGS ya.make include/__chrono/convert_to_tm.h [6:6] include/__chrono/day.h [6:6] include/__chrono/duration.h [6:6] + include/__chrono/exception.h [6:6] include/__chrono/file_clock.h [6:6] include/__chrono/formatter.h [6:6] include/__chrono/hh_mm_ss.h [6:6] include/__chrono/high_resolution_clock.h [6:6] + include/__chrono/leap_second.h [6:6] include/__chrono/literals.h [6:6] + include/__chrono/local_info.h [6:6] include/__chrono/month.h [6:6] include/__chrono/month_weekday.h [6:6] include/__chrono/monthday.h [6:6] @@ -3870,6 +3861,7 @@ BELONGS ya.make include/__chrono/parser_std_format_spec.h [6:6] include/__chrono/statically_widen.h [6:6] include/__chrono/steady_clock.h [6:6] + include/__chrono/sys_info.h [6:6] include/__chrono/system_clock.h [6:6] include/__chrono/time_point.h [6:6] include/__chrono/time_zone.h [6:6] @@ -3881,6 +3873,7 @@ BELONGS ya.make include/__chrono/year_month.h [6:6] include/__chrono/year_month_day.h [6:6] include/__chrono/year_month_weekday.h [6:6] + include/__chrono/zoned_time.h [6:6] include/__compare/common_comparison_category.h [5:5] include/__compare/compare_partial_order_fallback.h [5:5] include/__compare/compare_strong_order_fallback.h [5:5] @@ -3919,11 +3912,17 @@ BELONGS ya.make include/__condition_variable/condition_variable.h [5:5] include/__config [6:6] include/__config_site.in [5:5] + include/__configuration/abi.h [6:6] + include/__configuration/availability.h [6:6] + include/__configuration/compiler.h [6:6] + include/__configuration/language.h [6:6] + include/__configuration/platform.h [6:6] include/__coroutine/coroutine_handle.h [5:5] include/__coroutine/coroutine_traits.h [5:5] include/__coroutine/noop_coroutine_handle.h [5:5] include/__coroutine/trivial_awaitables.h [5:5] include/__debug_utils/randomize_range.h [5:5] + include/__debug_utils/sanitizers.h [5:5] include/__debug_utils/strict_weak_ordering_check.h [5:5] include/__exception/exception.h [5:5] include/__exception/exception_ptr.h [5:5] @@ -3975,6 +3974,7 @@ BELONGS ya.make include/__format/formatter_pointer.h [6:6] include/__format/formatter_string.h [6:6] include/__format/formatter_tuple.h [6:6] + include/__format/indic_conjunct_break_table.h [6:6] include/__format/parser_std_format_spec.h [6:6] include/__format/range_default_formatter.h [6:6] include/__format/range_formatter.h [6:6] @@ -4036,6 +4036,7 @@ BELONGS ya.make include/__ios/fpos.h [6:6] include/__iterator/access.h [6:6] include/__iterator/advance.h [6:6] + include/__iterator/aliasing_iterator.h [5:5] include/__iterator/back_insert_iterator.h [6:6] include/__iterator/bounded_iter.h [6:6] include/__iterator/common_iterator.h [6:6] @@ -4165,13 +4166,31 @@ BELONGS ya.make include/__numeric/iota.h [6:6] include/__numeric/midpoint.h [6:6] include/__numeric/partial_sum.h [6:6] - include/__numeric/pstl_reduce.h [5:5] - include/__numeric/pstl_transform_reduce.h [5:5] + include/__numeric/pstl.h [5:5] include/__numeric/reduce.h [6:6] include/__numeric/saturation_arithmetic.h [6:6] include/__numeric/transform_exclusive_scan.h [6:6] include/__numeric/transform_inclusive_scan.h [6:6] include/__numeric/transform_reduce.h [6:6] + include/__ostream/basic_ostream.h [5:5] + include/__ostream/print.h [5:5] + include/__pstl/backend.h [5:5] + include/__pstl/backend_fwd.h [5:5] + include/__pstl/backends/default.h [5:5] + include/__pstl/backends/libdispatch.h [5:5] + include/__pstl/backends/serial.h [6:6] + include/__pstl/backends/std_thread.h [5:5] + include/__pstl/cpu_algos/any_of.h [5:5] + include/__pstl/cpu_algos/cpu_traits.h [5:5] + include/__pstl/cpu_algos/fill.h [5:5] + include/__pstl/cpu_algos/find_if.h [5:5] + include/__pstl/cpu_algos/for_each.h [5:5] + include/__pstl/cpu_algos/merge.h [5:5] + include/__pstl/cpu_algos/stable_sort.h [5:5] + include/__pstl/cpu_algos/transform.h [5:5] + include/__pstl/cpu_algos/transform_reduce.h [5:5] + include/__pstl/dispatch.h [5:5] + include/__pstl/handle_exception.h [5:5] include/__random/bernoulli_distribution.h [5:5] include/__random/binomial_distribution.h [5:5] include/__random/cauchy_distribution.h [5:5] @@ -4308,7 +4327,6 @@ BELONGS ya.make include/__type_traits/aligned_storage.h [5:5] include/__type_traits/aligned_union.h [5:5] include/__type_traits/alignment_of.h [5:5] - include/__type_traits/apply_cv.h [5:5] include/__type_traits/can_extract_key.h [5:5] include/__type_traits/common_reference.h [5:5] include/__type_traits/common_type.h [5:5] @@ -4319,6 +4337,7 @@ BELONGS ya.make include/__type_traits/datasizeof.h [5:5] include/__type_traits/decay.h [5:5] include/__type_traits/dependent_type.h [5:5] + include/__type_traits/desugars_to.h [5:5] include/__type_traits/disjunction.h [5:5] include/__type_traits/enable_if.h [5:5] include/__type_traits/extent.h [5:5] @@ -4403,7 +4422,6 @@ BELONGS ya.make include/__type_traits/nat.h [5:5] include/__type_traits/negation.h [5:5] include/__type_traits/noexcept_move_assign_container.h [5:5] - include/__type_traits/operation_traits.h [5:5] include/__type_traits/promote.h [5:5] include/__type_traits/rank.h [5:5] include/__type_traits/remove_all_extents.h [5:5] @@ -4437,11 +4455,13 @@ BELONGS ya.make include/__utility/in_place.h [5:5] include/__utility/integer_sequence.h [5:5] include/__utility/is_pointer_in_range.h [5:5] + include/__utility/is_valid_range.h [5:5] include/__utility/move.h [6:6] include/__utility/no_destroy.h [5:5] include/__utility/pair.h [5:5] include/__utility/piecewise_construct.h [5:5] include/__utility/priority_tag.h [5:5] + include/__utility/private_constructor_tag.h [6:6] include/__utility/rel_ops.h [5:5] include/__utility/small_buffer.h [5:5] include/__utility/swap.h [5:5] @@ -4606,7 +4626,16 @@ BELONGS ya.make src/condition_variable_destructor.cpp [5:5] src/error_category.cpp [5:5] src/exception.cpp [5:5] + src/expected.cpp [5:5] + src/experimental/chrono_exception.cpp [5:5] + src/experimental/include/tzdb/time_zone_private.h [6:6] + src/experimental/include/tzdb/types_private.h [6:6] + src/experimental/include/tzdb/tzdb_list_private.h [5:5] + src/experimental/include/tzdb/tzdb_private.h [5:5] src/experimental/keep.cpp [5:5] + src/experimental/time_zone.cpp [5:5] + src/experimental/tzdb.cpp [5:5] + src/experimental/tzdb_list.cpp [5:5] src/filesystem/directory_entry.cpp [5:5] src/filesystem/directory_iterator.cpp [5:5] src/filesystem/error.h [5:5] @@ -4649,11 +4678,6 @@ BELONGS ya.make src/include/sso_allocator.h [6:6] src/include/to_chars_floating_point.h [5:5] src/include/to_chars_floating_point.h [10:10] - src/include/tzdb/time_zone_link_private.h [6:6] - src/include/tzdb/time_zone_private.h [6:6] - src/include/tzdb/types_private.h [6:6] - src/include/tzdb/tzdb_list_private.h [5:5] - src/include/tzdb/tzdb_private.h [5:5] src/ios.cpp [5:5] src/ios.instantiations.cpp [5:5] src/iostream.cpp [5:5] @@ -4698,15 +4722,13 @@ BELONGS ya.make src/support/runtime/exception_pointer_unimplemented.ipp [6:6] src/support/runtime/stdexcept_default.ipp [5:5] src/support/runtime/stdexcept_vcruntime.ipp [5:5] + src/support/win32/compiler_rt_shims.cpp [5:5] src/support/win32/locale_win32.cpp [5:5] src/support/win32/support.cpp [5:5] src/support/win32/thread_win32.cpp [5:5] src/system_error.cpp [5:5] src/thread.cpp [5:5] - src/time_zone.cpp [5:5] src/typeinfo.cpp [5:5] - src/tzdb.cpp [5:5] - src/tzdb_list.cpp [5:5] src/valarray.cpp [5:5] src/variant.cpp [5:5] src/vector.cpp [5:5] @@ -4724,6 +4746,7 @@ BELONGS ya.make Files with this license: include/__format/escaped_output_table.h [14:14] include/__format/extended_grapheme_cluster_table.h [14:14] + include/__format/indic_conjunct_break_table.h [14:14] include/__format/width_estimation_table.h [14:14] KEEP Apache-2.0 WITH LLVM-exception c1e6c6536fcc444f916047679115c618 diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt b/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt index c0f49ab3af..6ffcfd8898 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt @@ -701,7 +701,7 @@ public: template < class _ValueType, class _Tp = decay_t<_ValueType>, class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value); template <class _ValueType, @@ -715,7 +715,7 @@ public: class... _Args, class _Tp = decay_t<_ValueType>, class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args); _LIBCPP_HIDE_FROM_ABI ~any() { this->reset(); } @@ -747,7 +747,7 @@ public: class... _Args, class _Tp = decay_t<_ValueType>, class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...); // 6.3.3 any modifiers diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h index 7819e2cf49..6f15456e3a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h @@ -26,7 +26,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _Iter, class _Sent, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) { if (__first == __last) return __first; @@ -40,13 +40,13 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) { } template <class _ForwardIterator, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { return std::__adjacent_find(std::move(__first), std::move(__last), __pred); } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last) { return std::adjacent_find(std::move(__first), std::move(__last), __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h index 237f8495c6..ec84eea759 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (!__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/any_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/any_of.h index 8ba7aae2b2..b5ff778c41 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/any_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/any_of.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h index 7a77d7b544..6065fc3727 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h @@ -22,14 +22,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { __first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp); return __first != __last && !__comp(__value, *__first); } template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { return std::binary_search(__first, __last, __value, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h index 003bf70dd4..1a5a3d0744 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& +[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v, _LIBCPP_LIFETIMEBOUND const _Tp& __lo, _LIBCPP_LIFETIMEBOUND const _Tp& __hi, @@ -31,7 +31,7 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v, } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& +[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v, _LIBCPP_LIFETIMEBOUND const _Tp& __lo, _LIBCPP_LIFETIMEBOUND const _Tp& __hi) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h index 3902f75603..a0fa88d6d2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h @@ -10,8 +10,7 @@ #define _LIBCPP___ALGORITHM_COMP_H #include <__config> -#include <__type_traits/integral_constant.h> -#include <__type_traits/operation_traits.h> +#include <__type_traits/desugars_to.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -27,7 +26,7 @@ struct __equal_to { }; template <class _Tp, class _Up> -struct __desugars_to<__equal_tag, __equal_to, _Tp, _Up> : true_type {}; +inline const bool __desugars_to_v<__equal_tag, __equal_to, _Tp, _Up> = true; // The definition is required because __less is part of the ABI, but it's empty // because all comparisons should be transparent. @@ -42,6 +41,9 @@ struct __less<void, void> { } }; +template <class _Tp> +inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___ALGORITHM_COMP_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h index aa9350c38c..c367fbb91a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h @@ -41,9 +41,9 @@ struct __debug_less { } template <class _LHS, class _RHS> - _LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()( - std::declval<_LHS&>(), std::declval<_RHS&>())) - __do_compare_assert(int, _LHS& __l, _RHS& __r) { + _LIBCPP_CONSTEXPR_SINCE_CXX14 inline + _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(std::declval<_LHS&>(), std::declval<_RHS&>())) + __do_compare_assert(int, _LHS& __l, _RHS& __r) { _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering"); (void)__l; (void)__r; diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h index 12a26c6d6a..8a98451a8f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h @@ -21,7 +21,6 @@ #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_constructible.h> #include <__type_traits/is_trivially_assignable.h> -#include <__type_traits/is_trivially_copyable.h> #include <__type_traits/is_volatile.h> #include <__utility/move.h> #include <__utility/pair.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/count.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/count.h index 23a7d3c4dc..1cfe7f631a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/count.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/count.h @@ -79,7 +79,7 @@ __count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __l } template <class _InputIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator> count(_InputIterator __first, _InputIterator __last, const _Tp& __value) { __identity __proj; return std::__count<_ClassicAlgPolicy>(__first, __last, __value, __proj); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/count_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/count_if.h index 04f52b894f..25782069d0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/count_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/count_if.h @@ -20,9 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - typename iterator_traits<_InputIterator>::difference_type - count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 +typename iterator_traits<_InputIterator>::difference_type +count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { typename iterator_traits<_InputIterator>::difference_type __r(0); for (; __first != __last; ++__first) if (__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h index c76a16b47f..bfc8f72f6e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h @@ -18,12 +18,11 @@ #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> #include <__string/constexpr_c_functions.h> +#include <__type_traits/desugars_to.h> #include <__type_traits/enable_if.h> -#include <__type_traits/integral_constant.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_equality_comparable.h> #include <__type_traits/is_volatile.h> -#include <__type_traits/operation_traits.h> #include <__utility/move.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -47,7 +46,7 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 boo template <class _Tp, class _Up, class _BinaryPredicate, - __enable_if_t<__desugars_to<__equal_tag, _BinaryPredicate, _Tp, _Up>::value && !is_volatile<_Tp>::value && + __enable_if_t<__desugars_to_v<__equal_tag, _BinaryPredicate, _Tp, _Up> && !is_volatile<_Tp>::value && !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value, int> = 0> _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool @@ -56,14 +55,14 @@ __equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) } template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { return std::__equal_iter_impl( std::__unwrap_iter(__first1), std::__unwrap_iter(__last1), std::__unwrap_iter(__first2), __pred); } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { return std::equal(__first1, __last1, __first2, __equal_to()); } @@ -87,7 +86,7 @@ template <class _Tp, class _Pred, class _Proj1, class _Proj2, - __enable_if_t<__desugars_to<__equal_tag, _Pred, _Tp, _Up>::value && __is_identity<_Proj1>::value && + __enable_if_t<__desugars_to_v<__equal_tag, _Pred, _Tp, _Up> && __is_identity<_Proj1>::value && __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value, int> = 0> @@ -97,7 +96,7 @@ __equal_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, } template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, @@ -120,7 +119,7 @@ equal(_InputIterator1 __first1, } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { return std::equal(__first1, __last1, __first2, __last2, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h index 2b086abf17..09bbf8f006 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h @@ -60,7 +60,7 @@ __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp } template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value, "The comparator has to be callable"); static_assert(is_copy_constructible<_ForwardIterator>::value, "Iterator has to be copy constructible"); @@ -73,7 +73,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { return std::equal_range(std::move(__first), std::move(__last), __value, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h index 7d7631b6e9..7f58dbb13a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h @@ -43,7 +43,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // generic implementation template <class _Iter, class _Sent, class _Tp, class _Proj> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter -__find_impl(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) { +__find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) { for (; __first != __last; ++__first) if (std::__invoke(__proj, *__first) == __value) break; @@ -57,8 +57,7 @@ template <class _Tp, __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value && sizeof(_Tp) == 1, int> = 0> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* -__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) { if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first)) return __ret; return __last; @@ -71,8 +70,7 @@ template <class _Tp, __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value && sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t), int> = 0> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* -__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) { if (auto __ret = std::__constexpr_wmemchr(__first, __value, __last - __first)) return __ret; return __last; @@ -89,10 +87,10 @@ template <class _Tp, is_signed<_Tp>::value == is_signed<_Up>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* -__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj& __proj) { +__find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj& __proj) { if (__value < numeric_limits<_Tp>::min() || __value > numeric_limits<_Tp>::max()) return __last; - return std::__find_impl(__first, __last, _Tp(__value), __proj); + return std::__find(__first, __last, _Tp(__value), __proj); } // __bit_iterator implementation @@ -134,7 +132,7 @@ __find_bool(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) template <class _Cp, bool _IsConst, class _Tp, class _Proj, __enable_if_t<__is_identity<_Proj>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cp, _IsConst> -__find_impl(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value, _Proj&) { +__find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value, _Proj&) { if (static_cast<bool>(__value)) return std::__find_bool<true>(__first, static_cast<typename _Cp::size_type>(__last - __first)); return std::__find_bool<false>(__first, static_cast<typename _Cp::size_type>(__last - __first)); @@ -150,7 +148,7 @@ template <class _SegmentedIterator, class _Proj, __enable_if_t<__is_segmented_iterator<_SegmentedIterator>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator -__find_impl(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) { +__find(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) { return std::__find_segment_if(std::move(__first), std::move(__last), __find_segment<_Tp>(__value), __proj); } @@ -163,17 +161,17 @@ struct __find_segment { template <class _InputIterator, class _Proj> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _InputIterator operator()(_InputIterator __first, _InputIterator __last, _Proj& __proj) const { - return std::__find_impl(__first, __last, __value_, __proj); + return std::__find(__first, __last, __value_, __proj); } }; // public API template <class _InputIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp& __value) { __identity __proj; return std::__rewrap_iter( - __first, std::__find_impl(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __value, __proj)); + __first, std::__find(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __value, __proj)); } _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h index 4c26891666..7e08e79535 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h @@ -205,7 +205,7 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Fo } template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_end( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_end( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, @@ -215,7 +215,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 } template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { return std::find_end(__first1, __last1, __first2, __last2, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_first_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_first_of.h index 14271cccc4..6b99f562f8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_first_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_first_of.h @@ -35,7 +35,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator1 __find_fir } template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, @@ -45,7 +45,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 } template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { return std::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if.h index 09a39f6463..22092d352b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if_not.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if_not.h index bf29ebb7cd..cc2001967f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if_not.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if_not.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (!__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fold.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fold.h index 1a9d76b50d..255658f523 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fold.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fold.h @@ -78,8 +78,7 @@ concept __indirectly_binary_left_foldable = struct __fold_left_with_iter { template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, __indirectly_binary_left_foldable<_Tp, _Ip> _Fp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto - operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) { using _Up = decay_t<invoke_result_t<_Fp&, _Tp, iter_reference_t<_Ip>>>; if (__first == __last) { @@ -95,7 +94,7 @@ struct __fold_left_with_iter { } template <input_range _Rp, class _Tp, __indirectly_binary_left_foldable<_Tp, iterator_t<_Rp>> _Fp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Rp&& __r, _Tp __init, _Fp __f) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Rp&& __r, _Tp __init, _Fp __f) { auto __result = operator()(ranges::begin(__r), ranges::end(__r), std::move(__init), std::ref(__f)); using _Up = decay_t<invoke_result_t<_Fp&, _Tp, range_reference_t<_Rp>>>; @@ -107,13 +106,12 @@ inline constexpr auto fold_left_with_iter = __fold_left_with_iter(); struct __fold_left { template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, __indirectly_binary_left_foldable<_Tp, _Ip> _Fp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto - operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) { return fold_left_with_iter(std::move(__first), std::move(__last), std::move(__init), std::ref(__f)).value; } template <input_range _Rp, class _Tp, __indirectly_binary_left_foldable<_Tp, iterator_t<_Rp>> _Fp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Rp&& __r, _Tp __init, _Fp __f) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Rp&& __r, _Tp __init, _Fp __f) { return fold_left_with_iter(ranges::begin(__r), ranges::end(__r), std::move(__init), std::ref(__f)).value; } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h index 05d45365eb..62af03c374 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h @@ -47,7 +47,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __includes( } template <class _InputIterator1, class _InputIterator2, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, @@ -67,7 +67,7 @@ includes(_InputIterator1 __first1, } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { return std::includes(std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h index 0d2d43c2c3..c589b804a5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h @@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _RandomAccessIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::__is_heap_until(__first, __last, static_cast<__comp_ref_type<_Compare> >(__comp)) == __last; } template <class _RandomAccessIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::is_heap(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h index 1eae3b86b9..a174f2453c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h @@ -46,13 +46,13 @@ __is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Co } template <class _RandomAccessIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::__is_heap_until(__first, __last, static_cast<__comp_ref_type<_Compare> >(__comp)); } template <class _RandomAccessIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::__is_heap_until(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_partitioned.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_partitioned.h index 71feed3320..1f7c8b0b26 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_partitioned.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_partitioned.h @@ -18,7 +18,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (!__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h index 4226151222..2ddfb32a21 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h @@ -113,7 +113,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation_impl( // 2+1 iterators, predicate. Not used by range algorithms. template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation( +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation( _ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2, _BinaryPredicate&& __pred) { // Shorten sequences as much as possible by lopping of any equal prefix. for (; __first1 != __last1; ++__first1, (void)++__first2) { @@ -247,7 +247,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation( // 2+1 iterators, predicate template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { static_assert(__is_callable<_BinaryPredicate, decltype(*__first1), decltype(*__first2)>::value, "The predicate has to be callable"); @@ -257,7 +257,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool i // 2+1 iterators template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { return std::is_permutation(__first1, __last1, __first2, __equal_to()); } @@ -266,7 +266,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt // 2+2 iterators template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { return std::__is_permutation<_ClassicAlgPolicy>( std::move(__first1), @@ -280,7 +280,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 // 2+2 iterators, predicate template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation( _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h index 1874cace88..3befb1ac9c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h @@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { return std::__is_sorted_until<__comp_ref_type<_Compare> >(__first, __last, __comp) == __last; } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last) { return std::is_sorted(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h index 7450440df2..53a49f00de 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h @@ -35,13 +35,13 @@ __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __ } template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { return std::__is_sorted_until<__comp_ref_type<_Compare> >(__first, __last, __comp); } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) { return std::is_sorted_until(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h index 3efd8e24bf..edc29e269c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h @@ -37,7 +37,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __lexicographical_compa } template <class _InputIterator1, class _InputIterator2, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool lexicographical_compare( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool lexicographical_compare( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, @@ -47,7 +47,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool lexicographical_compare( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool lexicographical_compare( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { return std::lexicographical_compare(__first1, __last1, __first2, __last2, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h index 50ebdc647a..a5872e90cf 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h @@ -90,7 +90,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_slow_pa } template <class _InputIterator1, class _InputIterator2, class _Cmp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way( +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp __comp) -> decltype(__comp(*__first1, *__first2)) { static_assert(__comparison_category<decltype(__comp(*__first1, *__first2))>, @@ -110,7 +110,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compa } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way( +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { return std::lexicographical_compare_three_way( std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::compare_three_way()); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h index 8f57f3592c..8fd355a7cf 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h @@ -47,7 +47,7 @@ __lower_bound(_Iter __first, _Sent __last, const _Type& __value, _Comp& __comp, } template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value, "The comparator has to be callable"); auto __proj = std::__identity(); @@ -55,7 +55,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { return std::lower_bound(__first, __last, __value, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h index bb7bc7e8c0..5245e523f3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h @@ -36,8 +36,8 @@ struct _ProjectedPred { : __pred(__pred_arg), __proj(__proj_arg) {} template <class _Tp> - typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>())) >:: - type _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI + typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>()))>::type + _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI operator()(_Tp&& __v) const { return std::__invoke(__pred, std::__invoke(__proj, std::forward<_Tp>(__v))); } @@ -45,8 +45,8 @@ struct _ProjectedPred { template <class _T1, class _T2> typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T1>())), - decltype(std::__invoke(std::declval<_Proj&>(), - std::declval<_T2>())) >::type _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI + decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T2>()))>::type _LIBCPP_CONSTEXPR + _LIBCPP_HIDE_FROM_ABI operator()(_T1&& __lhs, _T2&& __rhs) const { return std::__invoke( __pred, std::__invoke(__proj, std::forward<_T1>(__lhs)), std::__invoke(__proj, std::forward<_T2>(__rhs))); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h index 8171677f15..d4c99f6f36 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h @@ -25,13 +25,13 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) { return __comp(__a, __b) ? __b : __a; } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) { return std::max(__a, __b, __less<>()); } @@ -39,13 +39,13 @@ max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) #ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp max(initializer_list<_Tp> __t, _Compare __comp) { return *std::__max_element<__comp_ref_type<_Compare> >(__t.begin(), __t.end(), __comp); } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp max(initializer_list<_Tp> __t) { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp max(initializer_list<_Tp> __t) { return *std::max_element(__t.begin(), __t.end(), __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h index f1d4f1cd09..c036726cbc 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h @@ -35,13 +35,13 @@ __max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp } template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { return std::__max_element<__comp_ref_type<_Compare> >(__first, __last, __comp); } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator max_element(_ForwardIterator __first, _ForwardIterator __last) { return std::max_element(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h index 919508486f..1bafad8a46 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h @@ -25,13 +25,13 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) { return __comp(__b, __a) ? __b : __a; } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) { return std::min(__a, __b, __less<>()); } @@ -39,13 +39,13 @@ min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) #ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp min(initializer_list<_Tp> __t, _Compare __comp) { return *std::__min_element<__comp_ref_type<_Compare> >(__t.begin(), __t.end(), __comp); } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp min(initializer_list<_Tp> __t) { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp min(initializer_list<_Tp> __t) { return *std::min_element(__t.begin(), __t.end(), __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h index c576d66560..65f3594d63 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h @@ -48,7 +48,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter __min_element(_Iter __ } template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { static_assert( __has_forward_iterator_category<_ForwardIterator>::value, "std::min_element requires a ForwardIterator"); @@ -59,7 +59,7 @@ min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator min_element(_ForwardIterator __first, _ForwardIterator __last) { return std::min_element(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h index 5227b88571..9feda2b4c0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h @@ -24,13 +24,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<const _Tp&, const _Tp&> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<const _Tp&, const _Tp&> minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) { return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) : pair<const _Tp&, const _Tp&>(__a, __b); } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<const _Tp&, const _Tp&> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<const _Tp&, const _Tp&> minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) { return std::minmax(__a, __b, __less<>()); } @@ -38,7 +38,7 @@ minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __ #ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp> minmax(initializer_list<_Tp> __t, _Compare __comp) { static_assert(__is_callable<_Compare, _Tp, _Tp>::value, "The comparator has to be callable"); __identity __proj; @@ -47,7 +47,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp) { } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp> minmax(initializer_list<_Tp> __t) { return std::minmax(__t, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h index ff8cda321c..43cb23347c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h @@ -79,7 +79,7 @@ __minmax_element_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) } template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_ForwardIterator, _ForwardIterator> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { static_assert( __has_forward_iterator_category<_ForwardIterator>::value, "std::minmax_element requires a ForwardIterator"); @@ -90,9 +90,8 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - pair<_ForwardIterator, _ForwardIterator> - minmax_element(_ForwardIterator __first, _ForwardIterator __last) { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_ForwardIterator, _ForwardIterator> +minmax_element(_ForwardIterator __first, _ForwardIterator __last) { return std::minmax_element(__first, __last, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h index 8abb273ac1..632bec0240 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h @@ -16,11 +16,12 @@ #include <__algorithm/unwrap_iter.h> #include <__config> #include <__functional/identity.h> +#include <__iterator/aliasing_iterator.h> +#include <__type_traits/desugars_to.h> #include <__type_traits/invoke.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_equality_comparable.h> #include <__type_traits/is_integral.h> -#include <__type_traits/operation_traits.h> #include <__utility/move.h> #include <__utility/pair.h> #include <__utility/unreachable.h> @@ -55,18 +56,13 @@ __mismatch(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Pred& __pred, _Pro #if _LIBCPP_VECTORIZE_ALGORITHMS -template <class _Tp, - class _Pred, - class _Proj1, - class _Proj2, - __enable_if_t<is_integral<_Tp>::value && __desugars_to<__equal_tag, _Pred, _Tp, _Tp>::value && - __is_identity<_Proj1>::value && __is_identity<_Proj2>::value, - int> = 0> -_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*> -__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) { +template <class _Iter> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter, _Iter> +__mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) { + using __value_type = __iter_value_type<_Iter>; constexpr size_t __unroll_count = 4; - constexpr size_t __vec_size = __native_vector_size<_Tp>; - using __vec = __simd_vector<_Tp, __vec_size>; + constexpr size_t __vec_size = __native_vector_size<__value_type>; + using __vec = __simd_vector<__value_type, __vec_size>; if (!__libcpp_is_constant_evaluated()) { auto __orig_first1 = __first1; @@ -116,13 +112,45 @@ __mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __ } // else loop over the elements individually } - return std::__mismatch_loop(__first1, __last1, __first2, __pred, __proj1, __proj2); + __equal_to __pred; + __identity __proj; + return std::__mismatch_loop(__first1, __last1, __first2, __pred, __proj, __proj); } +template <class _Tp, + class _Pred, + class _Proj1, + class _Proj2, + __enable_if_t<is_integral<_Tp>::value && __desugars_to_v<__equal_tag, _Pred, _Tp, _Tp> && + __is_identity<_Proj1>::value && __is_identity<_Proj2>::value, + int> = 0> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*> +__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred&, _Proj1&, _Proj2&) { + return std::__mismatch_vectorized(__first1, __last1, __first2); +} + +template <class _Tp, + class _Pred, + class _Proj1, + class _Proj2, + __enable_if_t<!is_integral<_Tp>::value && __desugars_to_v<__equal_tag, _Pred, _Tp, _Tp> && + __is_identity<_Proj1>::value && __is_identity<_Proj2>::value && + __can_map_to_integer_v<_Tp> && __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value, + int> = 0> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*> +__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) { + if (__libcpp_is_constant_evaluated()) { + return std::__mismatch_loop(__first1, __last1, __first2, __pred, __proj1, __proj2); + } else { + using _Iter = __aliasing_iterator<_Tp*, __get_as_integer_type_t<_Tp>>; + auto __ret = std::__mismatch_vectorized(_Iter(__first1), _Iter(__last1), _Iter(__first2)); + return {__ret.first.__base(), __ret.second.__base()}; + } +} #endif // _LIBCPP_VECTORIZE_ALGORITHMS template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { __identity __proj; auto __res = std::__mismatch( @@ -131,14 +159,14 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { return std::mismatch(__first1, __last1, __first2, __equal_to()); } #if _LIBCPP_STD_VER >= 14 template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2> -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter2> __mismatch( +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter2> __mismatch( _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))) @@ -150,14 +178,14 @@ template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, c } template <class _Tp, class _Pred, class _Proj1, class _Proj2> -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*> __mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) { auto __len = std::min(__last1 - __first1, __last2 - __first2); return std::__mismatch(__first1, __first1 + __len, __first2, __pred, __proj1, __proj2); } template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, @@ -176,7 +204,7 @@ mismatch(_InputIterator1 __first1, } template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { return std::mismatch(__first1, __last1, __first2, __last2, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/none_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/none_of.h index ce59187a3a..50841ba17c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/none_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/none_of.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) if (__pred(*__first)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl.h new file mode 100644 index 0000000000..0bb052b3f9 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl.h @@ -0,0 +1,663 @@ +//===----------------------------------------------------------------------===// +// +// 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_PSTL_H +#define _LIBCPP___ALGORITHM_PSTL_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +# include <__functional/operations.h> +# include <__iterator/cpp17_iterator_concepts.h> +# include <__iterator/iterator_traits.h> +# include <__pstl/backend.h> +# include <__pstl/dispatch.h> +# include <__pstl/handle_exception.h> +# include <__type_traits/enable_if.h> +# include <__type_traits/is_execution_policy.h> +# include <__type_traits/remove_cvref.h> +# include <__utility/forward.h> +# include <__utility/move.h> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Predicate, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool +any_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "any_of requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__any_of, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Pred, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool +all_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "all_of requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__all_of, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Pred, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool +none_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "none_of requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__none_of, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator +copy(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __result) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "copy(first, last, result) requires [first, last) to be ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardOutIterator, "copy(first, last, result) requires result to be a ForwardIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(*__first), "copy(first, last, result) requires result to be an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__copy, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__result)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _Size, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator +copy_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _ForwardOutIterator __result) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "copy_n(first, n, result) requires first to be a ForwardIterator"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardOutIterator, "copy_n(first, n, result) requires result to be a ForwardIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(*__first), "copy_n(first, n, result) requires result to be an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__copy_n, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__n), std::move(__result)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Predicate, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> +count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "count_if(first, last, pred) requires [first, last) to be ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__count_if, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> +count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "count(first, last, val) requires [first, last) to be ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__count, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Pred, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI bool +equal(_ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Pred __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__equal_3leg, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI bool +equal(_ExecutionPolicy&& __policy, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__equal_3leg, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + equal_to{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Pred, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI bool +equal(_ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _Pred __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__equal, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI bool +equal(_ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "equal requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "equal requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__equal, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + equal_to{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +fill(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "fill requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__fill, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Size, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +fill_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, const _Tp& __value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "fill_n requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__fill_n, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__n), __value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Predicate, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardIterator +find_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__find_if, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Predicate, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardIterator +find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find_if_not requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__find_if_not, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardIterator +find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "find requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__find, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Function, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +for_each(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Function __func) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "for_each requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__for_each, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__func)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Size, + class _Function, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +for_each_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __size, _Function __func) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "for_each_n requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__for_each_n, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__size), std::move(__func)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Generator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +generate(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator __gen) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "generate requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__generate, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__gen)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Size, + class _Generator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +generate_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _Generator __gen) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "generate_n requires a ForwardIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__generate_n, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__n), std::move(__gen)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Predicate, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool +is_partitioned(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "is_partitioned requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__is_partitioned, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _ForwardOutIterator, + class _Comp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator +merge(_ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _ForwardOutIterator __result, + _Comp __comp) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "merge requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "merge requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(*__first1), "merge requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(*__first2), "merge requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__merge, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + std::move(__result), + std::move(__comp)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _ForwardOutIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator +merge(_ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _ForwardOutIterator __result) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "merge requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "merge requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(*__first1), "merge requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(*__first2), "merge requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__merge, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + std::move(__result), + less{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator +move(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __result) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "move requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "move requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(std::move(*__first)), "move requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__move, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__result)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Pred, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +replace_if(_ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _Pred __pred, + const _Tp& __new_value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "replace_if requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__replace_if, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__pred), __new_value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +replace(_ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + const _Tp& __old_value, + const _Tp& __new_value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "replace requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__replace, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __old_value, __new_value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _Pred, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void replace_copy_if( + _ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __result, + _Pred __pred, + const _Tp& __new_value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "replace_copy_if requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "replace_copy_if requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(*__first), "replace_copy_if requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, const _Tp&, "replace_copy requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__replace_copy_if, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + std::move(__result), + std::move(__pred), + __new_value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void replace_copy( + _ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __result, + const _Tp& __old_value, + const _Tp& __new_value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "replace_copy requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "replace_copy requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(*__first), "replace_copy requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, const _Tp&, "replace_copy requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__replace_copy, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + std::move(__result), + __old_value, + __new_value); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator rotate_copy( + _ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __middle, + _ForwardIterator __last, + _ForwardOutIterator __result) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "rotate_copy requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "rotate_copy requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(*__first), "rotate_copy requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__rotate_copy, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__middle), + std::move(__last), + std::move(__result)); +} + +template <class _ExecutionPolicy, + class _RandomAccessIterator, + class _Comp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) { + _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(_RandomAccessIterator, "sort requires RandomAccessIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__sort, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__comp)); +} + +template <class _ExecutionPolicy, + class _RandomAccessIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last) { + _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(_RandomAccessIterator, "sort requires RandomAccessIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__sort, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), less{}); +} + +template <class _ExecutionPolicy, + class _RandomAccessIterator, + class _Comp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +stable_sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) { + _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(_RandomAccessIterator, "stable_sort requires RandomAccessIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__stable_sort, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__comp)); +} + +template <class _ExecutionPolicy, + class _RandomAccessIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI void +stable_sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last) { + _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(_RandomAccessIterator, "stable_sort requires RandomAccessIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__stable_sort, __pstl::__current_configuration, _RawPolicy>; + __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), less{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _ForwardOutIterator, + class _UnaryOperation, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform( + _ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __result, + _UnaryOperation __op) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "transform requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "transform requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(__op(*__first)), "transform requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__transform, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + std::move(__result), + std::move(__op)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _ForwardOutIterator, + class _BinaryOperation, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform( + _ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardOutIterator __result, + _BinaryOperation __op) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "transform requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "transform requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator, "transform requires an OutputIterator"); + _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR( + _ForwardOutIterator, decltype(__op(*__first1, *__first2)), "transform requires an OutputIterator"); + using _Implementation = __pstl::__dispatch<__pstl::__transform_binary, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__result), + std::move(__op)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_PSTL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h deleted file mode 100644 index 4b1e0e61b5..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h +++ /dev/null @@ -1,152 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_ANY_ALL_NONE_OF_H -#define _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H - -#include <__algorithm/pstl_find.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_any_of(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> __any_of( - _ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Predicate&& __pred) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_any_of, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) -> optional<bool> { - auto __res = std::__find_if(__policy, __g_first, __g_last, __g_pred); - if (!__res) - return nullopt; - return *__res != __g_last; - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool -any_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__any_of(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_all_of(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> -__all_of(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Pred&& __pred) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_all_of, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Pred __g_pred) -> optional<bool> { - auto __res = std::__any_of(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __value) { - return !__g_pred(__value); - }); - if (!__res) - return nullopt; - return !*__res; - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool -all_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__all_of(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_none_of(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> -__none_of(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Pred&& __pred) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_none_of, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Pred __g_pred) -> optional<bool> { - auto __res = std::__any_of(__policy, __g_first, __g_last, __g_pred); - if (!__res) - return nullopt; - return !*__res; - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool -none_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__none_of(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h deleted file mode 100644 index 3af03ce2fb..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h +++ /dev/null @@ -1,232 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKEND_H -#define _LIBCPP___ALGORITHM_PSTL_BACKEND_H - -#include <__algorithm/pstl_backends/cpu_backend.h> -#include <__config> -#include <execution> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -/* -TODO: Documentation of how backends work - -A PSTL parallel backend is a tag type to which the following functions are associated, at minimum: - - template <class _ExecutionPolicy, class _Iterator, class _Func> - optional<__empty> __pstl_for_each(_Backend, _ExecutionPolicy&&, _Iterator __first, _Iterator __last, _Func __f); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<_Iterator> __pstl_find_if(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _RandomAccessIterator, class _Comp> - optional<__empty> - __pstl_stable_sort(_Backend, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp); - - template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _Comp> - optional<_ForwardOutIterator> __pstl_merge(_Backend, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2, - _ForwardOutIterator __result, - _Comp __comp); - - template <class _ExecutionPolicy, class _InIterator, class _OutIterator, class _UnaryOperation> - optional<_OutIterator> - __pstl_transform(_Backend, _InIterator __first, _InIterator __last, _OutIterator __result, _UnaryOperation __op); - - template <class _ExecutionPolicy, class _InIterator1, class _InIterator2, class _OutIterator, class _BinaryOperation> - optional<_OutIterator> __pstl_transform(_InIterator1 __first1, - _InIterator2 __first2, - _InIterator1 __last1, - _OutIterator __result, - _BinaryOperation __op); - - template <class _ExecutionPolicy, - class _Iterator1, - class _Iterator2, - class _Tp, - class _BinaryOperation1, - class _BinaryOperation2> - optional<_Tp> __pstl_transform_reduce(_Backend, - _Iterator1 __first1, - _Iterator1 __last1, - _Iterator2 __first2, - _Iterator2 __last2, - _Tp __init, - _BinaryOperation1 __reduce, - _BinaryOperation2 __transform); - - template <class _ExecutionPolicy, class _Iterator, class _Tp, class _BinaryOperation, class _UnaryOperation> - optional<_Tp> __pstl_transform_reduce(_Backend, - _Iterator __first, - _Iterator __last, - _Tp __init, - _BinaryOperation __reduce, - _UnaryOperation __transform); - -// TODO: Complete this list - -The following functions are optional but can be provided. If provided, they are used by the corresponding -algorithms, otherwise they are implemented in terms of other algorithms. If none of the optional algorithms are -implemented, all the algorithms will eventually forward to the basis algorithms listed above: - - template <class _ExecutionPolicy, class _Iterator, class _Size, class _Func> - optional<__empty> __pstl_for_each_n(_Backend, _Iterator __first, _Size __n, _Func __f); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<bool> __pstl_any_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<bool> __pstl_all_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<bool> __pstl_none_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Tp> - optional<_Iterator> __pstl_find(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<_Iterator> __pstl_find_if_not(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Tp> - optional<__empty> __pstl_fill(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value); - - template <class _ExecutionPolicy, class _Iterator, class _SizeT, class _Tp> - optional<__empty> __pstl_fill_n(_Backend, _Iterator __first, _SizeT __n, const _Tp& __value); - - template <class _ExecutionPolicy, class _Iterator, class _Generator> - optional<__empty> __pstl_generate(_Backend, _Iterator __first, _Iterator __last, _Generator __gen); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<__empty> __pstl_is_partitioned(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Size, class _Generator> - optional<__empty> __pstl_generator_n(_Backend, _Iterator __first, _Size __n, _Generator __gen); - - template <class _ExecutionPolicy, class _terator1, class _Iterator2, class _OutIterator, class _Comp> - optional<_OutIterator> __pstl_merge(_Backend, - _Iterator1 __first1, - _Iterator1 __last1, - _Iterator2 __first2, - _Iterator2 __last2, - _OutIterator __result, - _Comp __comp); - - template <class _ExecutionPolicy, class _Iterator, class _OutIterator> - optional<_OutIterator> __pstl_move(_Backend, _Iterator __first, _Iterator __last, _OutIterator __result); - - template <class _ExecutionPolicy, class _Iterator, class _Tp, class _BinaryOperation> - optional<_Tp> __pstl_reduce(_Backend, _Iterator __first, _Iterator __last, _Tp __init, _BinaryOperation __op); - - temlate <class _ExecutionPolicy, class _Iterator> - optional<__iter_value_type<_Iterator>> __pstl_reduce(_Backend, _Iterator __first, _Iterator __last); - - template <class _ExecutionPolicy, class _Iterator, class _Tp> - optional<__iter_diff_t<_Iterator>> __pstl_count(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value); - - template <class _ExecutionPolicy, class _Iterator, class _Predicate> - optional<__iter_diff_t<_Iterator>> __pstl_count_if(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred); - - template <class _ExecutionPolicy, class _Iterator, class _Tp> - optional<__empty> - __pstl_replace(_Backend, _Iterator __first, _Iterator __last, const _Tp& __old_value, const _Tp& __new_value); - - template <class _ExecutionPolicy, class _Iterator, class _Pred, class _Tp> - optional<__empty> - __pstl_replace_if(_Backend, _Iterator __first, _Iterator __last, _Pred __pred, const _Tp& __new_value); - - template <class _ExecutionPolicy, class _Iterator, class _OutIterator, class _Tp> - optional<__empty> __pstl_replace_copy(_Backend, - _Iterator __first, - _Iterator __last, - _OutIterator __result, - const _Tp& __old_value, - const _Tp& __new_value); - - template <class _ExecutionPolicy, class _Iterator, class _OutIterator, class _Pred, class _Tp> - optional<__empty> __pstl_replace_copy_if(_Backend, - _Iterator __first, - _Iterator __last, - _OutIterator __result, - _Pred __pred, - const _Tp& __new_value); - - template <class _ExecutionPolicy, class _Iterator, class _OutIterator> - optional<_Iterator> __pstl_rotate_copy( - _Backend, _Iterator __first, _Iterator __middle, _Iterator __last, _OutIterator __result); - - template <class _ExecutionPolicy, class _Iterator, class _Comp> - optional<__empty> __pstl_sort(_Backend, _Iterator __first, _Iterator __last, _Comp __comp); - - template <class _ExecutionPolicy, class _Iterator1, class _Iterator2, class _Comp> - optional<bool> __pstl_equal(_Backend, _Iterator1 first1, _Iterator1 last1, _Iterator2 first2, _Comp __comp); - -// TODO: Complete this list - -Exception handling -================== - -PSTL backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from their -implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions are turned -into a program termination at the front-end level. When a backend returns a disengaged `optional` to the frontend, the -frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to the user. -*/ - -template <class _ExecutionPolicy> -struct __select_backend; - -template <> -struct __select_backend<std::execution::sequenced_policy> { - using type = __cpu_backend_tag; -}; - -# if _LIBCPP_STD_VER >= 20 -template <> -struct __select_backend<std::execution::unsequenced_policy> { - using type = __cpu_backend_tag; -}; -# endif - -# if defined(_LIBCPP_PSTL_CPU_BACKEND_SERIAL) || defined(_LIBCPP_PSTL_CPU_BACKEND_THREAD) || \ - defined(_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH) -template <> -struct __select_backend<std::execution::parallel_policy> { - using type = __cpu_backend_tag; -}; - -template <> -struct __select_backend<std::execution::parallel_unsequenced_policy> { - using type = __cpu_backend_tag; -}; - -# else - -// ...New vendors can add parallel backends here... - -# error "Invalid choice of a PSTL parallel backend" -# endif - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKEND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h deleted file mode 100644 index 6980ded189..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h +++ /dev/null @@ -1,68 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKEND_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_H - -#include <__config> - -/* - - // _Functor takes a subrange for [__first, __last) that should be executed in serial - template <class _RandomAccessIterator, class _Functor> - optional<__empty> __parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func); - - template <class _Iterator, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduction> - optional<_Tp> - __parallel_transform_reduce(_Iterator __first, _Iterator __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduction); - - // Cancel the execution of other jobs - they aren't needed anymore - void __cancel_execution(); - - template <class _RandomAccessIterator1, - class _RandomAccessIterator2, - class _RandomAccessIterator3, - class _Compare, - class _LeafMerge> - optional<void> __parallel_merge( - _RandomAccessIterator1 __first1, - _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, - _RandomAccessIterator2 __last2, - _RandomAccessIterator3 __outit, - _Compare __comp, - _LeafMerge __leaf_merge); - - template <class _RandomAccessIterator, class _Comp, class _LeafSort> - void __parallel_stable_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Comp __comp, - _LeafSort __leaf_sort); - - TODO: Document the parallel backend - -Exception handling -================== - -CPU backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from their -implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions are turned -into a program termination at the front-end level. When a backend returns a disengaged `optional` to the frontend, the -frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to the user. -*/ - -#include <__algorithm/pstl_backends/cpu_backends/any_of.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__algorithm/pstl_backends/cpu_backends/fill.h> -#include <__algorithm/pstl_backends/cpu_backends/find_if.h> -#include <__algorithm/pstl_backends/cpu_backends/for_each.h> -#include <__algorithm/pstl_backends/cpu_backends/merge.h> -#include <__algorithm/pstl_backends/cpu_backends/stable_sort.h> -#include <__algorithm/pstl_backends/cpu_backends/transform.h> -#include <__algorithm/pstl_backends/cpu_backends/transform_reduce.h> - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h deleted file mode 100644 index ea2210a4a7..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H - -#include <__config> -#include <cstddef> - -#if defined(_LIBCPP_PSTL_CPU_BACKEND_SERIAL) -# include <__algorithm/pstl_backends/cpu_backends/serial.h> -#elif defined(_LIBCPP_PSTL_CPU_BACKEND_THREAD) -# include <__algorithm/pstl_backends/cpu_backends/thread.h> -#elif defined(_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH) -# include <__algorithm/pstl_backends/cpu_backends/libdispatch.h> -#else -# error "Invalid CPU backend choice" -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -struct __cpu_backend_tag {}; - -inline constexpr size_t __lane_size = 64; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h deleted file mode 100644 index 64babe9fd2..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_FILL_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FILL_H - -#include <__algorithm/fill.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__type_traits/is_execution_policy.h> -#include <__utility/empty.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Index, class _DifferenceType, class _Tp> -_LIBCPP_HIDE_FROM_ABI _Index __simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept { - _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED - _PSTL_PRAGMA_SIMD - for (_DifferenceType __i = 0; __i < __n; ++__i) - __first[__i] = __value; - return __first + __n; -} - -template <class _ExecutionPolicy, class _ForwardIterator, class _Tp> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__pstl_fill(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return __par_backend::__parallel_for( - __first, __last, [&__value](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { - [[maybe_unused]] auto __res = std::__pstl_fill<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, __brick_first, __brick_last, __value); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - }); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - std::__simd_fill_n(__first, __last - __first, __value); - return __empty{}; - } else { - std::fill(__first, __last, __value); - return __empty{}; - } -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FILL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h deleted file mode 100644 index 81fd4526b8..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H - -#include <__algorithm/for_each.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__type_traits/is_execution_policy.h> -#include <__utility/empty.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Iterator, class _DifferenceType, class _Function> -_LIBCPP_HIDE_FROM_ABI _Iterator __simd_walk(_Iterator __first, _DifferenceType __n, _Function __f) noexcept { - _PSTL_PRAGMA_SIMD - for (_DifferenceType __i = 0; __i < __n; ++__i) - __f(__first[__i]); - - return __first + __n; -} - -template <class _ExecutionPolicy, class _ForwardIterator, class _Functor> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__pstl_for_each(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Functor __func) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return std::__par_backend::__parallel_for( - __first, __last, [__func](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { - [[maybe_unused]] auto __res = std::__pstl_for_each<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, __brick_first, __brick_last, __func); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - }); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - std::__simd_walk(__first, __last - __first, __func); - return __empty{}; - } else { - std::for_each(__first, __last, __func); - return __empty{}; - } -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h deleted file mode 100644 index e885e7f225..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h +++ /dev/null @@ -1,347 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H - -#include <__algorithm/inplace_merge.h> -#include <__algorithm/lower_bound.h> -#include <__algorithm/max.h> -#include <__algorithm/merge.h> -#include <__algorithm/upper_bound.h> -#include <__atomic/atomic.h> -#include <__config> -#include <__exception/terminate.h> -#include <__iterator/iterator_traits.h> -#include <__iterator/move_iterator.h> -#include <__memory/allocator.h> -#include <__memory/construct_at.h> -#include <__memory/unique_ptr.h> -#include <__numeric/reduce.h> -#include <__utility/empty.h> -#include <__utility/exception_guard.h> -#include <__utility/move.h> -#include <__utility/pair.h> -#include <cstddef> -#include <new> -#include <optional> - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace __par_backend { -inline namespace __libdispatch { - -// ::dispatch_apply is marked as __attribute__((nothrow)) because it doesn't let exceptions propagate, and neither do -// we. -// TODO: Do we want to add [[_Clang::__callback__(__func, __context, __)]]? -_LIBCPP_EXPORTED_FROM_ABI void -__dispatch_apply(size_t __chunk_count, void* __context, void (*__func)(void* __context, size_t __chunk)) noexcept; - -template <class _Func> -_LIBCPP_HIDE_FROM_ABI void __dispatch_apply(size_t __chunk_count, _Func __func) noexcept { - __libdispatch::__dispatch_apply(__chunk_count, &__func, [](void* __context, size_t __chunk) { - (*static_cast<_Func*>(__context))(__chunk); - }); -} - -struct __chunk_partitions { - ptrdiff_t __chunk_count_; // includes the first chunk - ptrdiff_t __chunk_size_; - ptrdiff_t __first_chunk_size_; -}; - -[[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI __chunk_partitions __partition_chunks(ptrdiff_t __size) noexcept; - -template <class _RandomAccessIterator, class _Functor> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__dispatch_parallel_for(__chunk_partitions __partitions, _RandomAccessIterator __first, _Functor __func) { - // Perform the chunked execution. - __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) { - auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_; - auto __index = - __chunk == 0 - ? 0 - : (__chunk * __partitions.__chunk_size_) + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_); - __func(__first + __index, __first + __index + __this_chunk_size); - }); - - return __empty{}; -} - -template <class _RandomAccessIterator, class _Functor> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func) { - return __libdispatch::__dispatch_parallel_for( - __libdispatch::__partition_chunks(__last - __first), std::move(__first), std::move(__func)); -} - -template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIteratorOut> -struct __merge_range { - __merge_range(_RandomAccessIterator1 __mid1, _RandomAccessIterator2 __mid2, _RandomAccessIteratorOut __result) - : __mid1_(__mid1), __mid2_(__mid2), __result_(__result) {} - - _RandomAccessIterator1 __mid1_; - _RandomAccessIterator2 __mid2_; - _RandomAccessIteratorOut __result_; -}; - -template <typename _RandomAccessIterator1, - typename _RandomAccessIterator2, - typename _RandomAccessIterator3, - typename _Compare, - typename _LeafMerge> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_merge( - _RandomAccessIterator1 __first1, - _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, - _RandomAccessIterator2 __last2, - _RandomAccessIterator3 __result, - _Compare __comp, - _LeafMerge __leaf_merge) noexcept { - __chunk_partitions __partitions = - __libdispatch::__partition_chunks(std::max<ptrdiff_t>(__last1 - __first1, __last2 - __first2)); - - if (__partitions.__chunk_count_ == 0) - return __empty{}; - - if (__partitions.__chunk_count_ == 1) { - __leaf_merge(__first1, __last1, __first2, __last2, __result, __comp); - return __empty{}; - } - - using __merge_range_t = __merge_range<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3>; - auto const __n_ranges = __partitions.__chunk_count_ + 1; - - // TODO: use __uninitialized_buffer - auto __destroy = [=](__merge_range_t* __ptr) { - std::destroy_n(__ptr, __n_ranges); - std::allocator<__merge_range_t>().deallocate(__ptr, __n_ranges); - }; - - unique_ptr<__merge_range_t[], decltype(__destroy)> __ranges( - [&]() -> __merge_range_t* { -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -# endif - return std::allocator<__merge_range_t>().allocate(__n_ranges); -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (const std::bad_alloc&) { - return nullptr; - } -# endif - }(), - __destroy); - - if (!__ranges) - return nullopt; - - // TODO: Improve the case where the smaller range is merged into just a few (or even one) chunks of the larger case - __merge_range_t* __r = __ranges.get(); - std::__construct_at(__r++, __first1, __first2, __result); - - bool __iterate_first_range = __last1 - __first1 > __last2 - __first2; - - auto __compute_chunk = [&](size_t __chunk_size) -> __merge_range_t { - auto [__mid1, __mid2] = [&] { - if (__iterate_first_range) { - auto __m1 = __first1 + __chunk_size; - auto __m2 = std::lower_bound(__first2, __last2, __m1[-1], __comp); - return std::make_pair(__m1, __m2); - } else { - auto __m2 = __first2 + __chunk_size; - auto __m1 = std::lower_bound(__first1, __last1, __m2[-1], __comp); - return std::make_pair(__m1, __m2); - } - }(); - - __result += (__mid1 - __first1) + (__mid2 - __first2); - __first1 = __mid1; - __first2 = __mid2; - return {std::move(__mid1), std::move(__mid2), __result}; - }; - - // handle first chunk - std::__construct_at(__r++, __compute_chunk(__partitions.__first_chunk_size_)); - - // handle 2 -> N - 1 chunks - for (ptrdiff_t __i = 0; __i != __partitions.__chunk_count_ - 2; ++__i) - std::__construct_at(__r++, __compute_chunk(__partitions.__chunk_size_)); - - // handle last chunk - std::__construct_at(__r, __last1, __last2, __result); - - __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __index) { - auto __first_iters = __ranges[__index]; - auto __last_iters = __ranges[__index + 1]; - __leaf_merge( - __first_iters.__mid1_, - __last_iters.__mid1_, - __first_iters.__mid2_, - __last_iters.__mid2_, - __first_iters.__result_, - __comp); - }); - - return __empty{}; -} - -template <class _RandomAccessIterator, class _Transform, class _Value, class _Combiner, class _Reduction> -_LIBCPP_HIDE_FROM_ABI optional<_Value> __parallel_transform_reduce( - _RandomAccessIterator __first, - _RandomAccessIterator __last, - _Transform __transform, - _Value __init, - _Combiner __combiner, - _Reduction __reduction) { - if (__first == __last) - return __init; - - auto __partitions = __libdispatch::__partition_chunks(__last - __first); - - auto __destroy = [__count = __partitions.__chunk_count_](_Value* __ptr) { - std::destroy_n(__ptr, __count); - std::allocator<_Value>().deallocate(__ptr, __count); - }; - - // TODO: use __uninitialized_buffer - // TODO: allocate one element per worker instead of one element per chunk - unique_ptr<_Value[], decltype(__destroy)> __values( - std::allocator<_Value>().allocate(__partitions.__chunk_count_), __destroy); - - // __dispatch_apply is noexcept - __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) { - auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_; - auto __index = - __chunk == 0 - ? 0 - : (__chunk * __partitions.__chunk_size_) + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_); - if (__this_chunk_size != 1) { - std::__construct_at( - __values.get() + __chunk, - __reduction(__first + __index + 2, - __first + __index + __this_chunk_size, - __combiner(__transform(__first + __index), __transform(__first + __index + 1)))); - } else { - std::__construct_at(__values.get() + __chunk, __transform(__first + __index)); - } - }); - - return std::reduce( - std::make_move_iterator(__values.get()), - std::make_move_iterator(__values.get() + __partitions.__chunk_count_), - std::move(__init), - __combiner); -} - -template <class _RandomAccessIterator, class _Comp, class _LeafSort> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_stable_sort( - _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp, _LeafSort __leaf_sort) { - const auto __size = __last - __first; - auto __partitions = __libdispatch::__partition_chunks(__size); - - if (__partitions.__chunk_count_ == 0) - return __empty{}; - - if (__partitions.__chunk_count_ == 1) { - __leaf_sort(__first, __last, __comp); - return __empty{}; - } - - using _Value = __iter_value_type<_RandomAccessIterator>; - - auto __destroy = [__size](_Value* __ptr) { - std::destroy_n(__ptr, __size); - std::allocator<_Value>().deallocate(__ptr, __size); - }; - - // TODO: use __uninitialized_buffer - unique_ptr<_Value[], decltype(__destroy)> __values(std::allocator<_Value>().allocate(__size), __destroy); - - // Initialize all elements to a moved-from state - // TODO: Don't do this - this can be done in the first merge - see https://llvm.org/PR63928 - std::__construct_at(__values.get(), std::move(*__first)); - for (__iter_diff_t<_RandomAccessIterator> __i = 1; __i != __size; ++__i) { - std::__construct_at(__values.get() + __i, std::move(__values.get()[__i - 1])); - } - *__first = std::move(__values.get()[__size - 1]); - - __libdispatch::__dispatch_parallel_for( - __partitions, - __first, - [&__leaf_sort, &__comp](_RandomAccessIterator __chunk_first, _RandomAccessIterator __chunk_last) { - __leaf_sort(std::move(__chunk_first), std::move(__chunk_last), __comp); - }); - - bool __objects_are_in_buffer = false; - do { - const auto __old_chunk_size = __partitions.__chunk_size_; - if (__partitions.__chunk_count_ % 2 == 1) { - auto __inplace_merge_chunks = [&__comp, &__partitions](auto __first_chunk_begin) { - std::inplace_merge( - __first_chunk_begin, - __first_chunk_begin + __partitions.__first_chunk_size_, - __first_chunk_begin + __partitions.__first_chunk_size_ + __partitions.__chunk_size_, - __comp); - }; - if (__objects_are_in_buffer) - __inplace_merge_chunks(__values.get()); - else - __inplace_merge_chunks(__first); - __partitions.__first_chunk_size_ += 2 * __partitions.__chunk_size_; - } else { - __partitions.__first_chunk_size_ += __partitions.__chunk_size_; - } - - __partitions.__chunk_size_ *= 2; - __partitions.__chunk_count_ /= 2; - - auto __merge_chunks = [__partitions, __old_chunk_size, &__comp](auto __from_first, auto __to_first) { - __libdispatch::__dispatch_parallel_for( - __partitions, - __from_first, - [__old_chunk_size, &__from_first, &__to_first, &__comp](auto __chunk_first, auto __chunk_last) { - std::merge(std::make_move_iterator(__chunk_first), - std::make_move_iterator(__chunk_last - __old_chunk_size), - std::make_move_iterator(__chunk_last - __old_chunk_size), - std::make_move_iterator(__chunk_last), - __to_first + (__chunk_first - __from_first), - __comp); - }); - }; - - if (__objects_are_in_buffer) - __merge_chunks(__values.get(), __first); - else - __merge_chunks(__first, __values.get()); - __objects_are_in_buffer = !__objects_are_in_buffer; - } while (__partitions.__chunk_count_ > 1); - - if (__objects_are_in_buffer) { - std::move(__values.get(), __values.get() + __size, __first); - } - - return __empty{}; -} - -_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {} - -} // namespace __libdispatch -} // namespace __par_backend - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h deleted file mode 100644 index b0db70f58b..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h +++ /dev/null @@ -1,85 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H - -#include <__algorithm/merge.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__type_traits/is_execution_policy.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_PUSH_MACROS -# include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _Comp> -_LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> __pstl_merge( - __cpu_backend_tag, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2, - _ForwardOutIterator __result, - _Comp __comp) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && - __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && - __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { - auto __res = __par_backend::__parallel_merge( - __first1, - __last1, - __first2, - __last2, - __result, - __comp, - [](_ForwardIterator1 __g_first1, - _ForwardIterator1 __g_last1, - _ForwardIterator2 __g_first2, - _ForwardIterator2 __g_last2, - _ForwardOutIterator __g_result, - _Comp __g_comp) { - [[maybe_unused]] auto __g_res = std::__pstl_merge<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, - std::move(__g_first1), - std::move(__g_last1), - std::move(__g_first2), - std::move(__g_last2), - std::move(__g_result), - std::move(__g_comp)); - _LIBCPP_ASSERT_INTERNAL(__g_res, "unsed/sed should never try to allocate!"); - }); - if (!__res) - return nullopt; - return __result + (__last1 - __first1) + (__last2 - __first2); - } else { - return std::merge(__first1, __last1, __first2, __last2, __result, __comp); - } -} - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h deleted file mode 100644 index afcc7ffb26..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H - -#include <__config> -#include <__utility/empty.h> -#include <__utility/move.h> -#include <cstddef> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_PUSH_MACROS -# include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace __par_backend { -inline namespace __serial_cpu_backend { - -template <class _RandomAccessIterator, class _Fp> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Fp __f) { - __f(__first, __last); - return __empty{}; -} - -template <class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce> -_LIBCPP_HIDE_FROM_ABI optional<_Tp> -__parallel_transform_reduce(_Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce) { - return __reduce(std::move(__first), std::move(__last), std::move(__init)); -} - -template <class _RandomAccessIterator, class _Compare, class _LeafSort> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_stable_sort( - _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort) { - __leaf_sort(__first, __last, __comp); - return __empty{}; -} - -_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {} - -template <class _RandomAccessIterator1, - class _RandomAccessIterator2, - class _RandomAccessIterator3, - class _Compare, - class _LeafMerge> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_merge( - _RandomAccessIterator1 __first1, - _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, - _RandomAccessIterator2 __last2, - _RandomAccessIterator3 __outit, - _Compare __comp, - _LeafMerge __leaf_merge) { - __leaf_merge(__first1, __last1, __first2, __last2, __outit, __comp); - return __empty{}; -} - -// TODO: Complete this list - -} // namespace __serial_cpu_backend -} // namespace __par_backend - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h deleted file mode 100644 index 34c423586c..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h +++ /dev/null @@ -1,45 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H - -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__algorithm/stable_sort.h> -#include <__config> -#include <__type_traits/is_execution_policy.h> -#include <__utility/empty.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, class _RandomAccessIterator, class _Comp> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__pstl_stable_sort(__cpu_backend_tag, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy>) { - return __par_backend::__parallel_stable_sort( - __first, __last, __comp, [](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) { - std::stable_sort(__g_first, __g_last, __g_comp); - }); - } else { - std::stable_sort(__first, __last, __comp); - return __empty{}; - } -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h deleted file mode 100644 index eb11a961b7..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h +++ /dev/null @@ -1,84 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H - -#include <__assert> -#include <__config> -#include <__utility/empty.h> -#include <__utility/move.h> -#include <cstddef> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -// This backend implementation is for testing purposes only and not meant for production use. This will be replaced -// by a proper implementation once the PSTL implementation is somewhat stable. - -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace __par_backend { -inline namespace __thread_cpu_backend { - -template <class _RandomAccessIterator, class _Fp> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Fp __f) { - __f(__first, __last); - return __empty{}; -} - -template <class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce> -_LIBCPP_HIDE_FROM_ABI optional<_Tp> -__parallel_transform_reduce(_Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce) { - return __reduce(std::move(__first), std::move(__last), std::move(__init)); -} - -template <class _RandomAccessIterator, class _Compare, class _LeafSort> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_stable_sort( - _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort) { - __leaf_sort(__first, __last, __comp); - return __empty{}; -} - -_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {} - -template <class _RandomAccessIterator1, - class _RandomAccessIterator2, - class _RandomAccessIterator3, - class _Compare, - class _LeafMerge> -_LIBCPP_HIDE_FROM_ABI optional<__empty> __parallel_merge( - _RandomAccessIterator1 __first1, - _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, - _RandomAccessIterator2 __last2, - _RandomAccessIterator3 __outit, - _Compare __comp, - _LeafMerge __leaf_merge) { - __leaf_merge(__first1, __last1, __first2, __last2, __outit, __comp); - return __empty{}; -} - -} // namespace __thread_cpu_backend -} // namespace __par_backend - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h deleted file mode 100644 index fdf1a2e78d..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h +++ /dev/null @@ -1,138 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H - -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__algorithm/transform.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_PUSH_MACROS -# include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function> -_LIBCPP_HIDE_FROM_ABI _Iterator2 -__simd_walk(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept { - _PSTL_PRAGMA_SIMD - for (_DifferenceType __i = 0; __i < __n; ++__i) - __f(__first1[__i], __first2[__i]); - return __first2 + __n; -} - -template <class _ExecutionPolicy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation> -_LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> __pstl_transform( - __cpu_backend_tag, - _ForwardIterator __first, - _ForwardIterator __last, - _ForwardOutIterator __result, - _UnaryOperation __op) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value && - __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { - std::__par_backend::__parallel_for( - __first, __last, [__op, __first, __result](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { - auto __res = std::__pstl_transform<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, __brick_first, __brick_last, __result + (__brick_first - __first), __op); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - return *std::move(__res); - }); - return __result + (__last - __first); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value && - __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { - return std::__simd_walk( - __first, - __last - __first, - __result, - [&](__iter_reference<_ForwardIterator> __in_value, __iter_reference<_ForwardOutIterator> __out_value) { - __out_value = __op(__in_value); - }); - } else { - return std::transform(__first, __last, __result, __op); - } -} - -template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function> -_LIBCPP_HIDE_FROM_ABI _Iterator3 __simd_walk( - _Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept { - _PSTL_PRAGMA_SIMD - for (_DifferenceType __i = 0; __i < __n; ++__i) - __f(__first1[__i], __first2[__i], __first3[__i]); - return __first3 + __n; -} -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _BinaryOperation, - enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0> -_LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> __pstl_transform( - __cpu_backend_tag, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardOutIterator __result, - _BinaryOperation __op) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && - __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && - __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { - auto __res = std::__par_backend::__parallel_for( - __first1, - __last1, - [__op, __first1, __first2, __result](_ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last) { - return std::__pstl_transform<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, - __brick_first, - __brick_last, - __first2 + (__brick_first - __first1), - __result + (__brick_first - __first1), - __op); - }); - if (!__res) - return nullopt; - return __result + (__last1 - __first1); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && - __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && - __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { - return std::__simd_walk( - __first1, - __last1 - __first1, - __first2, - __result, - [&](__iter_reference<_ForwardIterator1> __in1, - __iter_reference<_ForwardIterator2> __in2, - __iter_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in1, __in2); }); - } else { - return std::transform(__first1, __last1, __first2, __result, __op); - } -} - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h deleted file mode 100644 index 14a0d76741..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h +++ /dev/null @@ -1,202 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H - -#include <__algorithm/pstl_backends/cpu_backends/backend.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__numeric/transform_reduce.h> -#include <__type_traits/is_arithmetic.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/operation_traits.h> -#include <__utility/move.h> -#include <new> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <typename _DifferenceType, - typename _Tp, - typename _BinaryOperation, - typename _UnaryOperation, - typename _UnaryResult = invoke_result_t<_UnaryOperation, _DifferenceType>, - __enable_if_t<__desugars_to<__plus_tag, _BinaryOperation, _Tp, _UnaryResult>::value && is_arithmetic_v<_Tp> && - is_arithmetic_v<_UnaryResult>, - int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp -__simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept { - _PSTL_PRAGMA_SIMD_REDUCTION(+ : __init) - for (_DifferenceType __i = 0; __i < __n; ++__i) - __init += __f(__i); - return __init; -} - -template <typename _Size, - typename _Tp, - typename _BinaryOperation, - typename _UnaryOperation, - typename _UnaryResult = invoke_result_t<_UnaryOperation, _Size>, - __enable_if_t<!(__desugars_to<__plus_tag, _BinaryOperation, _Tp, _UnaryResult>::value && - is_arithmetic_v<_Tp> && is_arithmetic_v<_UnaryResult>), - int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp -__simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept { - const _Size __block_size = __lane_size / sizeof(_Tp); - if (__n > 2 * __block_size && __block_size > 1) { - alignas(__lane_size) char __lane_buffer[__lane_size]; - _Tp* __lane = reinterpret_cast<_Tp*>(__lane_buffer); - - // initializer - _PSTL_PRAGMA_SIMD - for (_Size __i = 0; __i < __block_size; ++__i) { - ::new (__lane + __i) _Tp(__binary_op(__f(__i), __f(__block_size + __i))); - } - // main loop - _Size __i = 2 * __block_size; - const _Size __last_iteration = __block_size * (__n / __block_size); - for (; __i < __last_iteration; __i += __block_size) { - _PSTL_PRAGMA_SIMD - for (_Size __j = 0; __j < __block_size; ++__j) { - __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__i + __j)); - } - } - // remainder - _PSTL_PRAGMA_SIMD - for (_Size __j = 0; __j < __n - __last_iteration; ++__j) { - __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__last_iteration + __j)); - } - // combiner - for (_Size __j = 0; __j < __block_size; ++__j) { - __init = __binary_op(std::move(__init), std::move(__lane[__j])); - } - // destroyer - _PSTL_PRAGMA_SIMD - for (_Size __j = 0; __j < __block_size; ++__j) { - __lane[__j].~_Tp(); - } - } else { - for (_Size __i = 0; __i < __n; ++__i) { - __init = __binary_op(std::move(__init), __f(__i)); - } - } - return __init; -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Tp, - class _BinaryOperation1, - class _BinaryOperation2> -_LIBCPP_HIDE_FROM_ABI optional<_Tp> __pstl_transform_reduce( - __cpu_backend_tag, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _Tp __init, - _BinaryOperation1 __reduce, - _BinaryOperation2 __transform) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && - __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) { - return __par_backend::__parallel_transform_reduce( - __first1, - std::move(__last1), - [__first1, __first2, __transform](_ForwardIterator1 __iter) { - return __transform(*__iter, *(__first2 + (__iter - __first1))); - }, - std::move(__init), - std::move(__reduce), - [__first1, __first2, __reduce, __transform]( - _ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last, _Tp __brick_init) { - return *std::__pstl_transform_reduce<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, - __brick_first, - std::move(__brick_last), - __first2 + (__brick_first - __first1), - std::move(__brick_init), - std::move(__reduce), - std::move(__transform)); - }); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && - __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) { - return std::__simd_transform_reduce( - __last1 - __first1, std::move(__init), std::move(__reduce), [&](__iter_diff_t<_ForwardIterator1> __i) { - return __transform(__first1[__i], __first2[__i]); - }); - } else { - return std::transform_reduce( - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__init), - std::move(__reduce), - std::move(__transform)); - } -} - -template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation> -_LIBCPP_HIDE_FROM_ABI optional<_Tp> __pstl_transform_reduce( - __cpu_backend_tag, - _ForwardIterator __first, - _ForwardIterator __last, - _Tp __init, - _BinaryOperation __reduce, - _UnaryOperation __transform) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return __par_backend::__parallel_transform_reduce( - std::move(__first), - std::move(__last), - [__transform](_ForwardIterator __iter) { return __transform(*__iter); }, - std::move(__init), - __reduce, - [__transform, __reduce](auto __brick_first, auto __brick_last, _Tp __brick_init) { - auto __res = std::__pstl_transform_reduce<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, - std::move(__brick_first), - std::move(__brick_last), - std::move(__brick_init), - std::move(__reduce), - std::move(__transform)); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - return *std::move(__res); - }); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return std::__simd_transform_reduce( - __last - __first, - std::move(__init), - std::move(__reduce), - [=, &__transform](__iter_diff_t<_ForwardIterator> __i) { return __transform(__first[__i]); }); - } else { - return std::transform_reduce( - std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform)); - } -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h deleted file mode 100644 index 1069dcec0e..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h +++ /dev/null @@ -1,121 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_COPY_H -#define _LIBCPP___ALGORITHM_PSTL_COPY_H - -#include <__algorithm/copy_n.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__algorithm/pstl_transform.h> -#include <__config> -#include <__functional/identity.h> -#include <__iterator/concepts.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_constant_evaluated.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/is_trivially_copyable.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -// TODO: Use the std::copy/move shenanigans to forward to std::memmove - -template <class> -void __pstl_copy(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> -__copy(_ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_copy, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _ForwardOutIterator __g_result) { - return std::__transform(__policy, __g_first, __g_last, __g_result, __identity()); - }, - std::move(__first), - std::move(__last), - std::move(__result)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator -copy(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __result) { - auto __res = std::__copy(__policy, std::move(__first), std::move(__last), std::move(__result)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_copy_n(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Size, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> __copy_n( - _ExecutionPolicy&& __policy, _ForwardIterator&& __first, _Size&& __n, _ForwardOutIterator&& __result) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_copy_n, _RawPolicy), - [&__policy]( - _ForwardIterator __g_first, _Size __g_n, _ForwardOutIterator __g_result) -> optional<_ForwardIterator> { - if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) - return std::__copy(__policy, std::move(__g_first), std::move(__g_first + __g_n), std::move(__g_result)); - else - return std::copy_n(__g_first, __g_n, __g_result); - }, - std::move(__first), - std::move(__n), - std::move(__result)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Size, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator -copy_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _ForwardOutIterator __result) { - auto __res = std::__copy_n(__policy, std::move(__first), std::move(__n), std::move(__result)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_COPY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h deleted file mode 100644 index 2781f6bfd3..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h +++ /dev/null @@ -1,121 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_COUNT_H -#define _LIBCPP___ALGORITHM_PSTL_COUNT_H - -#include <__algorithm/count.h> -#include <__algorithm/for_each.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_for_each.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__atomic/atomic.h> -#include <__config> -#include <__functional/operations.h> -#include <__iterator/iterator_traits.h> -#include <__numeric/pstl_transform_reduce.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_count_if(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>> __count_if( - _ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Predicate&& __pred) noexcept { - using __diff_t = __iter_diff_t<_ForwardIterator>; - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_count_if, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) -> optional<__diff_t> { - return std::__transform_reduce( - __policy, - std::move(__g_first), - std::move(__g_last), - __diff_t(), - std::plus{}, - [&](__iter_reference<_ForwardIterator> __element) -> bool { return __g_pred(__element); }); - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> -count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - auto __res = std::__count_if(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_count(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>> -__count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_count, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) - -> optional<__iter_diff_t<_ForwardIterator>> { - return std::count_if(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __v) { - return __v == __g_value; - }); - }, - std::move(__first), - std::move(__last), - __value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> -count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { - auto __res = std::__count(__policy, std::move(__first), std::move(__last), __value); - if (!__res) - std::__throw_bad_alloc(); - return *__res; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_COUNT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_equal.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_equal.h deleted file mode 100644 index d235c0f4f4..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_equal.h +++ /dev/null @@ -1,175 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_EQUAL_H -#define _LIBCPP___ALGORITHM_PSTL_EQUAL_H - -#include <__algorithm/equal.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__functional/operations.h> -#include <__iterator/iterator_traits.h> -#include <__numeric/pstl_transform_reduce.h> -#include <__utility/move.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_equal(); - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> -__equal(_ExecutionPolicy&& __policy, - _ForwardIterator1&& __first1, - _ForwardIterator1&& __last1, - _ForwardIterator2&& __first2, - _Pred&& __pred) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_equal, _RawPolicy), - [&__policy]( - _ForwardIterator1 __g_first1, _ForwardIterator1 __g_last1, _ForwardIterator2 __g_first2, _Pred __g_pred) { - return std::__transform_reduce( - __policy, - std::move(__g_first1), - std::move(__g_last1), - std::move(__g_first2), - true, - std::logical_and{}, - std::move(__g_pred)); - }, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI bool -equal(_ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _Pred __pred) { - auto __res = std::__equal(__policy, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *__res; -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0> -_LIBCPP_HIDE_FROM_ABI bool -equal(_ExecutionPolicy&& __policy, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { - return std::equal(__policy, std::move(__first1), std::move(__last1), std::move(__first2), std::equal_to{}); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> -__equal(_ExecutionPolicy&& __policy, - _ForwardIterator1&& __first1, - _ForwardIterator1&& __last1, - _ForwardIterator2&& __first2, - _ForwardIterator2&& __last2, - _Pred&& __pred) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_equal, _RawPolicy), - [&__policy](_ForwardIterator1 __g_first1, - _ForwardIterator1 __g_last1, - _ForwardIterator2 __g_first2, - _ForwardIterator2 __g_last2, - _Pred __g_pred) -> optional<bool> { - if constexpr (__has_random_access_iterator_category<_ForwardIterator1>::value && - __has_random_access_iterator_category<_ForwardIterator2>::value) { - if (__g_last1 - __g_first1 != __g_last2 - __g_first2) - return false; - return std::__equal( - __policy, std::move(__g_first1), std::move(__g_last1), std::move(__g_first2), std::move(__g_pred)); - } else { - (void)__policy; // Avoid unused lambda capture warning - return std::equal( - std::move(__g_first1), - std::move(__g_last1), - std::move(__g_first2), - std::move(__g_last2), - std::move(__g_pred)); - } - }, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__last2), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Pred, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI bool -equal(_ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2, - _Pred __pred) { - auto __res = std::__equal( - __policy, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *__res; -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0> -_LIBCPP_HIDE_FROM_ABI bool -equal(_ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2) { - return std::equal( - __policy, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::equal_to{}); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_EQUAL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h deleted file mode 100644 index 488b49a0fe..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h +++ /dev/null @@ -1,116 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_FILL_H -#define _LIBCPP___ALGORITHM_PSTL_FILL_H - -#include <__algorithm/fill_n.h> -#include <__algorithm/pstl_for_each.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__iterator/iterator_traits.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_fill(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI optional<__empty> -__fill(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) noexcept { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_fill, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) { - return std::__for_each(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __element) { - __element = __g_value; - }); - }, - std::move(__first), - std::move(__last), - __value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -fill(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - if (!std::__fill(__policy, std::move(__first), std::move(__last), __value)) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_fill_n(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _SizeT, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__fill_n(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _SizeT&& __n, const _Tp& __value) noexcept { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_fill_n, _RawPolicy), - [&](_ForwardIterator __g_first, _SizeT __g_n, const _Tp& __g_value) { - if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) - std::fill(__policy, __g_first, __g_first + __g_n, __g_value); - else - std::fill_n(__g_first, __g_n, __g_value); - return optional<__empty>{__empty{}}; - }, - std::move(__first), - std::move(__n), - __value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _SizeT, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -fill_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _SizeT __n, const _Tp& __value) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - if (!std::__fill_n(__policy, std::move(__first), std::move(__n), __value)) - std::__throw_bad_alloc(); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_FILL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h deleted file mode 100644 index 5b694db68a..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h +++ /dev/null @@ -1,141 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_FIND_H -#define _LIBCPP___ALGORITHM_PSTL_FIND_H - -#include <__algorithm/comp.h> -#include <__algorithm/find.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_ForwardIterator>> -__find_if(_ExecutionPolicy&&, _ForwardIterator&& __first, _ForwardIterator&& __last, _Predicate&& __pred) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_find_if<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardIterator -find_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__find_if(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_find_if_not(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_ForwardIterator>> -__find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Predicate&& __pred) { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_find_if_not, _RawPolicy), - [&](_ForwardIterator&& __g_first, _ForwardIterator&& __g_last, _Predicate&& __g_pred) - -> optional<__remove_cvref_t<_ForwardIterator>> { - return std::__find_if( - __policy, __g_first, __g_last, [&](__iter_reference<__remove_cvref_t<_ForwardIterator>> __value) { - return !__g_pred(__value); - }); - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardIterator -find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__find_if_not(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class> -void __pstl_find(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_ForwardIterator>> -__find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_find, _RawPolicy), - [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) -> optional<_ForwardIterator> { - return std::find_if( - __policy, __g_first, __g_last, [&](__iter_reference<__remove_cvref_t<_ForwardIterator>> __element) { - return __element == __g_value; - }); - }, - std::move(__first), - std::move(__last), - __value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardIterator -find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__find(__policy, std::move(__first), std::move(__last), __value); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_FIND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h deleted file mode 100644 index bb7b5a61a6..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h +++ /dev/null @@ -1,108 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_FOR_EACH_H -#define _LIBCPP___ALGORITHM_PSTL_FOR_EACH_H - -#include <__algorithm/for_each.h> -#include <__algorithm/for_each_n.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__type_traits/void_t.h> -#include <__utility/empty.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Function, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__for_each(_ExecutionPolicy&&, _ForwardIterator&& __first, _ForwardIterator&& __last, _Function&& __func) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_for_each<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__func)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Function, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -for_each(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Function __func) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - if (!std::__for_each(__policy, std::move(__first), std::move(__last), std::move(__func))) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_for_each_n(); // declaration needed for the frontend dispatch below - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Size, - class _Function, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__for_each_n(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _Size&& __size, _Function&& __func) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_for_each_n, _RawPolicy), - [&](_ForwardIterator __g_first, _Size __g_size, _Function __g_func) -> optional<__empty> { - if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - std::for_each(__policy, std::move(__g_first), __g_first + __g_size, std::move(__g_func)); - return __empty{}; - } else { - std::for_each_n(std::move(__g_first), __g_size, std::move(__g_func)); - return __empty{}; - } - }, - std::move(__first), - std::move(__size), - std::move(__func)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Size, - class _Function, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -for_each_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __size, _Function __func) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - auto __res = std::__for_each_n(__policy, std::move(__first), std::move(__size), std::move(__func)); - if (!__res) - std::__throw_bad_alloc(); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_FOR_EACH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h deleted file mode 100644 index 6fa1107491..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h +++ /dev/null @@ -1,44 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_FRONTEND_DISPATCH -#define _LIBCPP___ALGORITHM_PSTL_FRONTEND_DISPATCH - -#include <__config> -#include <__type_traits/is_callable.h> -#include <__utility/forward.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -# define _LIBCPP_PSTL_CUSTOMIZATION_POINT(name, policy) \ - [](auto&&... __args) -> decltype(std::name<policy>( \ - typename __select_backend<policy>::type{}, std::forward<decltype(__args)>(__args)...)) { \ - return std::name<policy>(typename __select_backend<policy>::type{}, std::forward<decltype(__args)>(__args)...); \ - } - -template <class _SpecializedImpl, class _GenericImpl, class... _Args> -_LIBCPP_HIDE_FROM_ABI decltype(auto) -__pstl_frontend_dispatch(_SpecializedImpl __specialized_impl, _GenericImpl __generic_impl, _Args&&... __args) { - if constexpr (__is_callable<_SpecializedImpl, _Args...>::value) { - return __specialized_impl(std::forward<_Args>(__args)...); - } else { - return __generic_impl(std::forward<_Args>(__args)...); - } -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_FRONTEND_DISPATCH diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h deleted file mode 100644 index 7133c6f4f4..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h +++ /dev/null @@ -1,114 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_GENERATE_H -#define _LIBCPP___ALGORITHM_PSTL_GENERATE_H - -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_for_each.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__iterator/iterator_traits.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_generate(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Generator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__generate(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Generator&& __gen) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_generate, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Generator __g_gen) { - return std::__for_each( - __policy, std::move(__g_first), std::move(__g_last), [&](__iter_reference<_ForwardIterator> __element) { - __element = __g_gen(); - }); - }, - std::move(__first), - std::move(__last), - std::move(__gen)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Generator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -generate(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator __gen) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - if (!std::__generate(__policy, std::move(__first), std::move(__last), std::move(__gen))) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_generate_n(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Size, - class _Generator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__generate_n(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _Size&& __n, _Generator&& __gen) { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_generate_n, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _Size __g_n, _Generator __g_gen) { - return std::__for_each_n( - __policy, std::move(__g_first), std::move(__g_n), [&](__iter_reference<_ForwardIterator> __element) { - __element = __g_gen(); - }); - }, - std::move(__first), - __n, - std::move(__gen)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Size, - class _Generator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -generate_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _Generator __gen) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - if (!std::__generate_n(__policy, std::move(__first), std::move(__n), std::move(__gen))) - std::__throw_bad_alloc(); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_GENERATE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h deleted file mode 100644 index b654302122..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h +++ /dev/null @@ -1,77 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_IS_PARITTIONED -#define _LIBCPP___ALGORITHM_PSTL_IS_PARITTIONED - -#include <__algorithm/pstl_any_all_none_of.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_find.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_is_partitioned(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> __is_partitioned( - _ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last, _Predicate&& __pred) { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_is_partitioned, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) { - __g_first = std::find_if_not(__policy, __g_first, __g_last, __g_pred); - if (__g_first == __g_last) - return true; - ++__g_first; - return std::none_of(__policy, __g_first, __g_last, __g_pred); - }, - std::move(__first), - std::move(__last), - std::move(__pred)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Predicate, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool -is_partitioned(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - auto __res = std::__is_partitioned(__policy, std::move(__first), std::move(__last), std::move(__pred)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_IS_PARITTIONED diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h deleted file mode 100644 index 3d262db6bc..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h +++ /dev/null @@ -1,92 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_MERGE_H -#define _LIBCPP___ALGORITHM_PSTL_MERGE_H - -#include <__algorithm/pstl_backend.h> -#include <__config> -#include <__functional/operations.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _Comp = std::less<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> -__merge(_ExecutionPolicy&&, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2, - _ForwardOutIterator __result, - _Comp __comp = {}) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_merge<_RawPolicy>( - _Backend{}, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__last2), - std::move(__result), - std::move(__comp)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _Comp = std::less<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator -merge(_ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardIterator2 __last2, - _ForwardOutIterator __result, - _Comp __comp = {}) { - auto __res = std::__merge( - __policy, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__last2), - std::move(__result), - std::move(__comp)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_MERGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_move.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_move.h deleted file mode 100644 index d8441f1a6c..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_move.h +++ /dev/null @@ -1,84 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_MOVE_H -#define _LIBCPP___ALGORITHM_PSTL_MOVE_H - -#include <__algorithm/copy_n.h> -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__algorithm/pstl_transform.h> -#include <__config> -#include <__functional/identity.h> -#include <__iterator/iterator_traits.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_constant_evaluated.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/is_trivially_copyable.h> -#include <__type_traits/remove_cvref.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -// TODO: Use the std::copy/move shenanigans to forward to std::memmove -// Investigate whether we want to still forward to std::transform(policy) -// in that case for the execution::par part, or whether we actually want -// to run everything serially in that case. - -template <class> -void __pstl_move(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> -__move(_ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_move, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _ForwardOutIterator __g_result) { - return std::__transform(__policy, __g_first, __g_last, __g_result, [](auto&& __v) { return std::move(__v); }); - }, - std::move(__first), - std::move(__last), - std::move(__result)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator -move(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __result) { - auto __res = std::__move(__policy, std::move(__first), std::move(__last), std::move(__result)); - if (!__res) - std::__throw_bad_alloc(); - return *__res; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_MOVE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h deleted file mode 100644 index b1caf3fd4a..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h +++ /dev/null @@ -1,247 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_REPLACE_H -#define _LIBCPP___ALGORITHM_PSTL_REPLACE_H - -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_for_each.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__algorithm/pstl_transform.h> -#include <__config> -#include <__iterator/iterator_traits.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_replace_if(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__replace_if(_ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _Pred&& __pred, - const _Tp& __new_value) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_if, _RawPolicy), - [&__policy]( - _ForwardIterator&& __g_first, _ForwardIterator&& __g_last, _Pred&& __g_pred, const _Tp& __g_new_value) { - std::for_each(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __element) { - if (__g_pred(__element)) - __element = __g_new_value; - }); - return optional<__empty>{__empty{}}; - }, - std::move(__first), - std::move(__last), - std::move(__pred), - __new_value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Pred, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -replace_if(_ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _Pred __pred, - const _Tp& __new_value) { - auto __res = std::__replace_if(__policy, std::move(__first), std::move(__last), std::move(__pred), __new_value); - if (!__res) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_replace(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> -__replace(_ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - const _Tp& __old_value, - const _Tp& __new_value) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace, _RawPolicy), - [&__policy]( - _ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_old_value, const _Tp& __g_new_value) { - return std::__replace_if( - __policy, - std::move(__g_first), - std::move(__g_last), - [&](__iter_reference<_ForwardIterator> __element) { return __element == __g_old_value; }, - __g_new_value); - }, - std::move(__first), - std::move(__last), - __old_value, - __new_value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -replace(_ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - const _Tp& __old_value, - const _Tp& __new_value) { - if (!std::__replace(__policy, std::move(__first), std::move(__last), __old_value, __new_value)) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_replace_copy_if(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Pred, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> __replace_copy_if( - _ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result, - _Pred&& __pred, - const _Tp& __new_value) { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_copy_if, _RawPolicy), - [&__policy](_ForwardIterator __g_first, - _ForwardIterator __g_last, - _ForwardOutIterator __g_result, - _Pred __g_pred, - const _Tp& __g_new_value) -> optional<__empty> { - if (!std::__transform( - __policy, __g_first, __g_last, __g_result, [&](__iter_reference<_ForwardIterator> __element) { - return __g_pred(__element) ? __g_new_value : __element; - })) - return nullopt; - return __empty{}; - }, - std::move(__first), - std::move(__last), - std::move(__result), - std::move(__pred), - __new_value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Pred, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void replace_copy_if( - _ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _ForwardOutIterator __result, - _Pred __pred, - const _Tp& __new_value) { - if (!std::__replace_copy_if( - __policy, std::move(__first), std::move(__last), std::move(__result), std::move(__pred), __new_value)) - std::__throw_bad_alloc(); -} - -template <class> -void __pstl_replace_copy(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> __replace_copy( - _ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result, - const _Tp& __old_value, - const _Tp& __new_value) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_copy, _RawPolicy), - [&__policy](_ForwardIterator __g_first, - _ForwardIterator __g_last, - _ForwardOutIterator __g_result, - const _Tp& __g_old_value, - const _Tp& __g_new_value) { - return std::__replace_copy_if( - __policy, - std::move(__g_first), - std::move(__g_last), - std::move(__g_result), - [&](__iter_reference<_ForwardIterator> __element) { return __element == __g_old_value; }, - __g_new_value); - }, - std::move(__first), - std::move(__last), - std::move(__result), - __old_value, - __new_value); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _Tp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void replace_copy( - _ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _ForwardOutIterator __result, - const _Tp& __old_value, - const _Tp& __new_value) { - if (!std::__replace_copy( - __policy, std::move(__first), std::move(__last), std::move(__result), __old_value, __new_value)) - std::__throw_bad_alloc(); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_REPLACE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_rotate_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_rotate_copy.h deleted file mode 100644 index 346aab1d4a..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_rotate_copy.h +++ /dev/null @@ -1,85 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_ROTATE_COPY_H -#define _LIBCPP___ALGORITHM_PSTL_ROTATE_COPY_H - -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_copy.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__type_traits/is_execution_policy.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_rotate_copy(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> -__rotate_copy(_ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __middle, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_rotate_copy, _RawPolicy), - [&__policy](_ForwardIterator __g_first, - _ForwardIterator __g_middle, - _ForwardIterator __g_last, - _ForwardOutIterator __g_result) -> optional<_ForwardOutIterator> { - auto __result_mid = - std::__copy(__policy, _ForwardIterator(__g_middle), std::move(__g_last), std::move(__g_result)); - if (!__result_mid) - return nullopt; - return std::__copy(__policy, std::move(__g_first), std::move(__g_middle), *std::move(__result_mid)); - }, - std::move(__first), - std::move(__middle), - std::move(__last), - std::move(__result)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator rotate_copy( - _ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __middle, - _ForwardIterator __last, - _ForwardOutIterator __result) { - auto __res = - std::__rotate_copy(__policy, std::move(__first), std::move(__middle), std::move(__last), std::move(__result)); - if (!__res) - std::__throw_bad_alloc(); - return *__res; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_ROTATE_COPY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h deleted file mode 100644 index a931f76811..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h +++ /dev/null @@ -1,82 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_SORT_H -#define _LIBCPP___ALGORITHM_PSTL_SORT_H - -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__algorithm/pstl_stable_sort.h> -#include <__config> -#include <__functional/operations.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/empty.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_sort(); - -template <class _ExecutionPolicy, - class _RandomAccessIterator, - class _Comp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> __sort( - _ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_sort, _RawPolicy), - [&__policy](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) { - std::stable_sort(__policy, std::move(__g_first), std::move(__g_last), std::move(__g_comp)); - return optional<__empty>{__empty{}}; - }, - std::move(__first), - std::move(__last), - std::move(__comp)); -} - -template <class _ExecutionPolicy, - class _RandomAccessIterator, - class _Comp, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) { - if (!std::__sort(__policy, std::move(__first), std::move(__last), std::move(__comp))) - std::__throw_bad_alloc(); -} - -template <class _ExecutionPolicy, - class _RandomAccessIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void -sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last) { - std::sort(std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), less{}); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_SORT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h deleted file mode 100644 index 8ea0bb3f9a..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h +++ /dev/null @@ -1,61 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_STABLE_SORT_H -#define _LIBCPP___ALGORITHM_PSTL_STABLE_SORT_H - -#include <__algorithm/pstl_backend.h> -#include <__config> -#include <__functional/operations.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/empty.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _RandomAccessIterator, - class _Comp = less<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> __stable_sort( - _ExecutionPolicy&&, _RandomAccessIterator&& __first, _RandomAccessIterator&& __last, _Comp&& __comp = {}) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_stable_sort<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__comp)); -} - -template <class _ExecutionPolicy, - class _RandomAccessIterator, - class _Comp = less<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI void stable_sort( - _ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp = {}) { - if (!std::__stable_sort(__policy, std::move(__first), std::move(__last), std::move(__comp))) - std::__throw_bad_alloc(); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_STABLE_SORT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h deleted file mode 100644 index f95938782f..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h +++ /dev/null @@ -1,120 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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_PSTL_TRANSFORM_H -#define _LIBCPP___ALGORITHM_PSTL_TRANSFORM_H - -#include <__algorithm/pstl_backend.h> -#include <__config> -#include <__iterator/cpp17_iterator_concepts.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_execution_policy.h> -#include <__type_traits/remove_cvref.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _UnaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_ForwardOutIterator>> -__transform(_ExecutionPolicy&&, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _ForwardOutIterator&& __result, - _UnaryOperation&& __op) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_transform<_RawPolicy>( - _Backend{}, std::move(__first), std::move(__last), std::move(__result), std::move(__op)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _ForwardOutIterator, - class _UnaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform( - _ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _ForwardOutIterator __result, - _UnaryOperation __op) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator); - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator); - _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(__op(*__first))); - auto __res = std::__transform(__policy, std::move(__first), std::move(__last), std::move(__result), std::move(__op)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _BinaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_ForwardOutIterator>> -__transform(_ExecutionPolicy&&, - _ForwardIterator1&& __first1, - _ForwardIterator1&& __last1, - _ForwardIterator2&& __first2, - _ForwardOutIterator&& __result, - _BinaryOperation&& __op) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_transform<_RawPolicy>( - _Backend{}, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__result), std::move(__op)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _ForwardOutIterator, - class _BinaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform( - _ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _ForwardOutIterator __result, - _BinaryOperation __op) { - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1); - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2); - _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator); - _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(__op(*__first1, *__first2))); - auto __res = std::__transform( - __policy, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__result), std::move(__op)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___ALGORITHM_PSTL_TRANSFORM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h index a10b04167e..3c54f72331 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h @@ -53,7 +53,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_binary_predicate<projected<_Iter, _Proj>, projected<_Iter, _Proj>> _Pred = ranges::equal_to> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const { return __adjacent_find_impl(std::move(__first), std::move(__last), __pred, __proj); } @@ -62,7 +62,7 @@ struct __fn { class _Proj = identity, indirect_binary_predicate<projected<iterator_t<_Range>, _Proj>, projected<iterator_t<_Range>, _Proj>> _Pred = ranges::equal_to> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred = {}, _Proj __proj = {}) const { return __adjacent_find_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h index 8976541d59..2f603b32f3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h @@ -45,7 +45,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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); } @@ -53,7 +53,7 @@ struct __fn { template <input_range _Range, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h index 7c775f5f64..205fcecc08 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h @@ -45,7 +45,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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); } @@ -53,7 +53,7 @@ struct __fn { template <input_range _Range, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h index f3b7842d5c..1ef2bd62b5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h @@ -39,7 +39,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj); return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__ret)); @@ -49,7 +49,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h index f5ef5fd7f2..e6181ef943 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h @@ -35,7 +35,7 @@ struct __fn { template <class _Type, class _Proj = identity, indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Type& operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Type& operator()( const _Type& __value, const _Type& __low, const _Type& __high, _Comp __comp = {}, _Proj __proj = {}) const { _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( !bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains.h index 00d0e54019..4836c3baed 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains.h @@ -37,14 +37,14 @@ namespace __contains { struct __fn { template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool static + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool static operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) { return ranges::find(std::move(__first), __last, __value, std::ref(__proj)) != __last; } template <input_range _Range, class _Type, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool static + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool static operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) { return ranges::find(ranges::begin(__range), ranges::end(__range), __value, std::ref(__proj)) != ranges::end(__range); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains_subrange.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains_subrange.h index 4cd03cbb53..4398c457fd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains_subrange.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_contains_subrange.h @@ -15,11 +15,11 @@ #include <__functional/ranges_operations.h> #include <__functional/reference_wrapper.h> #include <__iterator/concepts.h> -#include <__iterator/distance.h> #include <__iterator/indirectly_comparable.h> #include <__iterator/projected.h> #include <__ranges/access.h> #include <__ranges/concepts.h> +#include <__ranges/size.h> #include <__ranges/subrange.h> #include <__utility/move.h> @@ -45,7 +45,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool static operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool static operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -53,8 +53,7 @@ struct __fn { _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) { - auto __n2 = ranges::distance(__first2, __last2); - if (__n2 == 0) + if (__first2 == __last2) return true; auto __ret = ranges::search( @@ -68,16 +67,15 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool static + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool static operator()(_Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) { - auto __n2 = 0; if constexpr (sized_range<_Range2>) { - __n2 = ranges::size(__range2); + if (ranges::size(__range2) == 0) + return true; } else { - __n2 = std::distance(cbegin(__range2), cend(__range2)); + if (ranges::begin(__range2) == ranges::end(__range2)) + return true; } - if (__n2 == 0) - return true; auto __ret = ranges::search(__range1, __range2, __pred, std::ref(__proj1), std::ref(__proj2)); return __ret.empty() == false; diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h index a8965c1b96..4f35117438 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h @@ -38,14 +38,14 @@ namespace __count { struct __fn { template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const { return std::__count<_RangeAlgPolicy>(std::move(__first), std::move(__last), __value, __proj); } template <input_range _Range, class _Type, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range> operator()(_Range&& __r, const _Type& __value, _Proj __proj = {}) const { return std::__count<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), __value, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h index 71b942dd53..5f2396ff7d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h @@ -50,7 +50,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Predicate> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator()(_Iter __first, _Sent __last, _Predicate __pred, _Proj __proj = {}) const { return ranges::__count_if_impl(std::move(__first), std::move(__last), __pred, __proj); } @@ -58,7 +58,7 @@ struct __fn { template <input_range _Range, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Predicate> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range> operator()(_Range&& __r, _Predicate __pred, _Proj __proj = {}) const { return ranges::__count_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_ends_with.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_ends_with.h index bb01918326..06efdef36b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_ends_with.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_ends_with.h @@ -133,7 +133,7 @@ struct __fn { requires(forward_iterator<_Iter1> || sized_sentinel_for<_Sent1, _Iter1>) && (forward_iterator<_Iter2> || sized_sentinel_for<_Sent2, _Iter2>) && indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -152,7 +152,7 @@ struct __fn { class _Proj2 = identity> requires(forward_range<_Range1> || sized_range<_Range1>) && (forward_range<_Range2> || sized_range<_Range2>) && indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _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>) { auto __n1 = ranges::size(__range1); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h index 31c7ee261d..edbd0e3641 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h @@ -44,7 +44,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -74,7 +74,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _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)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h index 4c1c3834ba..4a308e016b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h @@ -46,7 +46,7 @@ struct __fn { class _Tp, class _Proj = identity, indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Sent __last, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__equal_range<_RangeAlgPolicy>(std::move(__first), std::move(__last), __value, __comp, __proj); return {std::move(__ret.first), std::move(__ret.second)}; @@ -56,7 +56,7 @@ struct __fn { class _Tp, class _Proj = identity, indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()(_Range&& __range, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__equal_range<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), __value, __comp, __proj); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h index 7459fad717..6b0d5efe37 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h @@ -44,22 +44,22 @@ struct __fn { if constexpr (forward_iterator<_Iter>) { auto [__first_un, __last_un] = std::__unwrap_range(__first, std::move(__last)); return std::__rewrap_range<_Sent>( - std::move(__first), std::__find_impl(std::move(__first_un), std::move(__last_un), __value, __proj)); + std::move(__first), std::__find(std::move(__first_un), std::move(__last_un), __value, __proj)); } else { - return std::__find_impl(std::move(__first), std::move(__last), __value, __proj); + return std::__find(std::move(__first), std::move(__last), __value, __proj); } } template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<_Ip, _Proj>, const _Tp*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __first, _Sp __last, const _Tp& __value, _Proj __proj = {}) const { return __find_unwrap(std::move(__first), std::move(__last), __value, __proj); } template <input_range _Rp, class _Tp, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Rp>, _Proj>, const _Tp*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> operator()(_Rp&& __r, const _Tp& __value, _Proj __proj = {}) const { return __find_unwrap(ranges::begin(__r), ranges::end(__r), __value, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h index 0bda4f3e1c..e49e66dd4a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h @@ -45,7 +45,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -72,7 +72,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()( _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { auto __ret = std::__find_end_impl<_RangeAlgPolicy>( ranges::begin(__range1), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h index 63a7b8335f..d92d9686bc 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h @@ -60,7 +60,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter1 operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter1 operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -78,7 +78,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range1> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range1> operator()( _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return __find_first_of_impl( ranges::begin(__range1), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h index 52ae55ce96..888f9ec3cb 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h @@ -48,13 +48,13 @@ struct __fn { sentinel_for<_Ip> _Sp, class _Proj = identity, indirect_unary_predicate<projected<_Ip, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const { return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj); } template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const { return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h index 60c6796cbb..ec19545b5a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h @@ -40,14 +40,14 @@ struct __fn { sentinel_for<_Ip> _Sp, class _Proj = identity, indirect_unary_predicate<projected<_Ip, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const { auto __pred2 = [&](auto&& __e) -> bool { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); }; return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred2, __proj); } template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const { auto __pred2 = [&](auto&& __e) -> bool { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); }; return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred2, __proj); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h index 0bc4c043bd..c4c3b8ed08 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h @@ -45,7 +45,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity, indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -69,7 +69,7 @@ struct __fn { class _Proj2 = identity, indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return std::__includes( ranges::begin(__range1), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h index 122368c90d..3d9e18ce1d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h @@ -51,7 +51,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const { return __is_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj); } @@ -59,7 +59,7 @@ struct __fn { template <random_access_range _Range, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const { return __is_heap_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h index b2705d37a6..7a2e1fc770 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h @@ -51,7 +51,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const { return __is_heap_until_fn_impl(std::move(__first), std::move(__last), __comp, __proj); } @@ -59,7 +59,7 @@ struct __fn { template <random_access_range _Range, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const { return __is_heap_until_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h index c6a585c9f5..5be6fba46f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h @@ -57,7 +57,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const { return __is_partitioned_impl(std::move(__first), std::move(__last), __pred, __proj); } @@ -65,7 +65,7 @@ struct __fn { template <input_range _Range, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const { return __is_partitioned_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h index e0423d722b..1f8d67007a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h @@ -56,7 +56,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity, indirect_equivalence_relation<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Pred = ranges::equal_to> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -74,7 +74,7 @@ struct __fn { class _Proj2 = identity, indirect_equivalence_relation<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>> _Pred = ranges::equal_to> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _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)) diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h index d71035d5aa..5b88d422b4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h @@ -37,7 +37,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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; } @@ -45,7 +45,7 @@ struct __fn { template <forward_range _Range, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _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; diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h index dcfb6a4e18..54de530c8b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h @@ -53,7 +53,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter + [[nodiscard]] _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); } @@ -61,7 +61,7 @@ struct __fn { template <forward_range _Range, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> + [[nodiscard]] _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); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h index 90e96b5465..6d82017e30 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h @@ -60,7 +60,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity, indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -78,7 +78,7 @@ struct __fn { class _Proj2 = identity, indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()( _Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return __lexicographical_compare_impl( ranges::begin(__range1), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h index ab1f80e7ab..0651147e04 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h @@ -43,7 +43,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { return std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj); } @@ -52,7 +52,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { return std::__lower_bound<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), __value, __comp, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h index c63656de51..d0ee6f314b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h @@ -41,7 +41,7 @@ struct __fn { template <class _Tp, class _Proj = identity, indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Comp __comp = {}, @@ -52,7 +52,7 @@ struct __fn { template <copyable _Tp, class _Proj = identity, indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const { _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS( __il.begin() != __il.end(), "initializer_list must contain at least one element"); @@ -65,7 +65,7 @@ struct __fn { class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less> requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h index 83adf49b61..c577309271 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h @@ -38,7 +38,7 @@ struct __fn { sentinel_for<_Ip> _Sp, class _Proj = identity, indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip + [[nodiscard]] _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) -> bool { return std::invoke(__comp, __rhs, __lhs); }; return ranges::__min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj); @@ -47,7 +47,7 @@ struct __fn { template <forward_range _Rp, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> + [[nodiscard]] _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) -> bool { return std::invoke(__comp, __rhs, __lhs); }; return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp_lhs_rhs_swapped, __proj); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h index e8f97f2754..cc569d2a06 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h @@ -40,7 +40,7 @@ struct __fn { template <class _Tp, class _Proj = identity, indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Comp __comp = {}, @@ -51,7 +51,7 @@ struct __fn { template <copyable _Tp, class _Proj = identity, indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const { _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS( __il.begin() != __il.end(), "initializer_list must contain at least one element"); @@ -62,7 +62,7 @@ struct __fn { class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less> requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h index 4b9cb76da5..588ef258e2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h @@ -52,7 +52,7 @@ struct __fn { sentinel_for<_Ip> _Sp, class _Proj = identity, indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const { return ranges::__min_element_impl(__first, __last, __comp, __proj); } @@ -60,7 +60,7 @@ struct __fn { template <forward_range _Rp, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const { return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h index 22a62b620c..09cbefd91a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h @@ -23,7 +23,9 @@ #include <__iterator/projected.h> #include <__ranges/access.h> #include <__ranges/concepts.h> +#include <__type_traits/desugars_to.h> #include <__type_traits/is_reference.h> +#include <__type_traits/is_trivially_copyable.h> #include <__type_traits/remove_cvref.h> #include <__utility/forward.h> #include <__utility/move.h> @@ -50,7 +52,7 @@ struct __fn { template <class _Type, class _Proj = identity, indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&> operator()(_LIBCPP_LIFETIMEBOUND const _Type& __a, _LIBCPP_LIFETIMEBOUND const _Type& __b, _Comp __comp = {}, @@ -63,7 +65,7 @@ struct __fn { template <copyable _Type, class _Proj = identity, indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<_Type> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<_Type> operator()(initializer_list<_Type> __il, _Comp __comp = {}, _Proj __proj = {}) const { _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS( __il.begin() != __il.end(), "initializer_list has to contain at least one element"); @@ -75,7 +77,7 @@ struct __fn { class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> requires indirectly_copyable_storable<iterator_t<_Range>, range_value_t<_Range>*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<range_value_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<range_value_t<_Range>> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); @@ -83,7 +85,20 @@ struct __fn { _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__first != __last, "range has to contain at least one element"); - if constexpr (forward_range<_Range>) { + // This optimiation is not in minmax_element because clang doesn't see through the pointers and as a result doesn't + // vectorize the code. + if constexpr (contiguous_range<_Range> && is_integral_v<_ValueT> && + __is_cheap_to_copy<_ValueT> & __is_identity<_Proj>::value && + __desugars_to_v<__less_tag, _Comp, _ValueT, _ValueT>) { + minmax_result<_ValueT> __result = {__r[0], __r[0]}; + for (auto __e : __r) { + if (__e < __result.min) + __result.min = __e; + if (__result.max < __e) + __result.max = __e; + } + return __result; + } else if constexpr (forward_range<_Range>) { // Special-case the one element case. Avoid repeatedly initializing objects from the result of an iterator // dereference when doing so might not be idempotent. The `if constexpr` avoids the extra branch in cases where // it's not needed. diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h index 5132856ebc..4bf6d2404e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h @@ -46,7 +46,7 @@ struct __fn { sentinel_for<_Ip> _Sp, class _Proj = identity, indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<_Ip> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<_Ip> operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__minmax_element_impl(std::move(__first), std::move(__last), __comp, __proj); return {__ret.first, __ret.second}; @@ -55,7 +55,7 @@ struct __fn { template <forward_range _Rp, class _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<borrowed_iterator_t<_Rp>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<borrowed_iterator_t<_Rp>> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__minmax_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj); return {__ret.first, __ret.second}; diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h index d8a7dd43af..c4bf0022a9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h @@ -65,7 +65,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_I1, _I2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<_I1, _I2> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<_I1, _I2> operator()( _I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return __go(std::move(__first1), __last1, std::move(__first2), __last2, __pred, __proj1, __proj2); @@ -77,7 +77,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_R1>, iterator_t<_R2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>> operator()(_R1&& __r1, _R2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return __go( diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h index 59bd87997d..7df3c1829f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h @@ -46,7 +46,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const { return __none_of_impl(std::move(__first), std::move(__last), __pred, __proj); } @@ -54,7 +54,7 @@ struct __fn { template <input_range _Range, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const { return __none_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h index 315bed8fba..17c3a2c5cd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h @@ -37,7 +37,7 @@ namespace __remove { struct __fn { template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity> requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const { auto __pred = [&](auto&& __other) -> bool { return __value == __other; }; return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj); @@ -46,7 +46,7 @@ struct __fn { template <forward_range _Range, class _Type, class _Proj = identity> requires permutable<iterator_t<_Range>> && indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const { auto __pred = [&](auto&& __other) -> bool { return __value == __other; }; return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h index 943dbdd738..0ea5d9a01b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h @@ -59,7 +59,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const { return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj); } @@ -68,7 +68,7 @@ struct __fn { class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred> requires permutable<iterator_t<_Range>> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const { return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h index ca2326e9ab..55294c6063 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h @@ -77,7 +77,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -94,7 +94,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()( _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { auto __first1 = ranges::begin(__range1); if constexpr (sized_range<_Range2>) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h index 4c1d73d8e6..56e12755b9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h @@ -71,7 +71,7 @@ struct __fn { class _Pred = ranges::equal_to, class _Proj = identity> requires indirectly_comparable<_Iter, const _Type*, _Pred, _Proj> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Sent __last, iter_difference_t<_Iter> __count, @@ -83,7 +83,7 @@ struct __fn { template <forward_range _Range, class _Type, class _Pred = ranges::equal_to, class _Proj = identity> requires indirectly_comparable<iterator_t<_Range>, const _Type*, _Pred, _Proj> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()( _Range&& __range, range_difference_t<_Range> __count, const _Type& __value, _Pred __pred = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__range); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h index 7ba8af13a8..17084e4f24 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h @@ -42,7 +42,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr bool operator()( + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool operator()( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, @@ -67,7 +67,7 @@ struct __fn { class _Proj1 = identity, class _Proj2 = identity> requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr bool + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool operator()(_Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) { return __mismatch::__fn::__go( ranges::begin(__range1), diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h index 7340310eb3..7a9b784321 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h @@ -47,7 +47,7 @@ struct __fn { sentinel_for<_Iter> _Sent, class _Proj = identity, indirect_equivalence_relation<projected<_Iter, _Proj>> _Comp = ranges::equal_to> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__unique<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::__make_projected(__comp, __proj)); @@ -58,7 +58,7 @@ struct __fn { class _Proj = identity, indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to> requires permutable<iterator_t<_Range>> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const { auto __ret = std::__unique<_RangeAlgPolicy>( ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj)); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h index 7b571fb344..fa6fa7f70e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h @@ -37,7 +37,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __comp_lhs_rhs_swapped = [&](const auto& __lhs, const auto& __rhs) -> bool { return !std::invoke(__comp, __rhs, __lhs); @@ -50,7 +50,7 @@ struct __fn { class _Type, class _Proj = identity, indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const { auto __comp_lhs_rhs_swapped = [&](const auto& __lhs, const auto& __rhs) -> bool { return !std::invoke(__comp, __rhs, __lhs); diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove.h index 1498852c43..fd01c23cb6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove.h @@ -24,7 +24,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { __first = std::find(__first, __last, __value); if (__first != __last) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove_if.h index c77b78023f..b14f3c0efa 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/remove_if.h @@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = std::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred); if (__first != __last) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h index 8557c76f80..b82ca78095 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h @@ -160,7 +160,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __searc } template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, @@ -173,14 +173,14 @@ search(_ForwardIterator1 __first1, } template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { return std::search(__first1, __last1, __first2, __last2, __equal_to()); } #if _LIBCPP_STD_VER >= 17 template <class _ForwardIterator, class _Searcher> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) { return __s(__f, __l).first; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h index 12007fa7de..771647d316 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h @@ -136,7 +136,7 @@ __search_n_impl(_Iter1 __first, _Sent1 __last, _DiffT __count, const _Type& __va } template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search_n( +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search_n( _ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value, _BinaryPredicate __pred) { static_assert( __is_callable<_BinaryPredicate, decltype(*__first), const _Tp&>::value, "BinaryPredicate has to be callable"); @@ -145,7 +145,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 } template <class _ForwardIterator, class _Size, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value) { return std::search_n(__first, __last, std::__convert_to_integral(__count), __value, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/simd_utils.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/simd_utils.h index 3548c00aa3..840400729e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/simd_utils.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/simd_utils.h @@ -11,6 +11,7 @@ #include <__algorithm/min.h> #include <__bit/bit_cast.h> +#include <__bit/countl.h> #include <__bit/countr.h> #include <__config> #include <__type_traits/is_arithmetic.h> @@ -27,7 +28,7 @@ _LIBCPP_PUSH_MACROS #include <__undef_macros> // TODO: Find out how altivec changes things and allow vectorizations there too. -#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) && !defined(__CUDACC__) && !(defined(_MSC_VER) && _LIBCPP_CLANG_VER <= 1801) +#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__) && !defined(__CUDACC__) && !(defined(_MSC_VER) && _LIBCPP_CLANG_VER <= 1801) && _LIBCPP_CLANG_VER >= 1600 # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1 #else # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0 @@ -43,10 +44,38 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD +template <class _Tp> +inline constexpr bool __can_map_to_integer_v = + sizeof(_Tp) == alignof(_Tp) && (sizeof(_Tp) == 1 || sizeof(_Tp) == 2 || sizeof(_Tp) == 4 || sizeof(_Tp) == 8); + +template <size_t _TypeSize> +struct __get_as_integer_type_impl; + +template <> +struct __get_as_integer_type_impl<1> { + using type = uint8_t; +}; + +template <> +struct __get_as_integer_type_impl<2> { + using type = uint16_t; +}; +template <> +struct __get_as_integer_type_impl<4> { + using type = uint32_t; +}; +template <> +struct __get_as_integer_type_impl<8> { + using type = uint64_t; +}; + +template <class _Tp> +using __get_as_integer_type_t = typename __get_as_integer_type_impl<sizeof(_Tp)>::type; + // This isn't specialized for 64 byte vectors on purpose. They have the potential to significantly reduce performance // in mixed simd/non-simd workloads and don't provide any performance improvement for currently vectorized algorithms // as far as benchmarks are concerned. -# if defined(__AVX__) +# if defined(__AVX__) || defined(__MVS__) template <class _Tp> inline constexpr size_t __native_vector_size = 32 / sizeof(_Tp); # elif defined(__SSE__) || defined(__ARM_NEON__) @@ -80,10 +109,10 @@ template <class _VecT> using __simd_vector_underlying_type_t = decltype(std::__simd_vector_underlying_type_impl(_VecT{})); // This isn't inlined without always_inline when loading chars. -template <class _VecT, class _Tp> -_LIBCPP_NODISCARD _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __load_vector(const _Tp* __ptr) noexcept { +template <class _VecT, class _Iter> +_LIBCPP_NODISCARD _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __load_vector(_Iter __iter) noexcept { return [=]<size_t... _Indices>(index_sequence<_Indices...>) _LIBCPP_ALWAYS_INLINE noexcept { - return _VecT{__ptr[_Indices]...}; + return _VecT{__iter[_Indices]...}; }(make_index_sequence<__simd_vector_size_v<_VecT>>{}); } @@ -98,8 +127,13 @@ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI size_t __find_first_set(__simd_vector<_T // This has MSan disabled du to https://github.com/llvm/llvm-project/issues/85876 auto __impl = [&]<class _MaskT>(_MaskT) _LIBCPP_NO_SANITIZE("memory") noexcept { +# if defined(_LIBCPP_BIG_ENDIAN) + return std::min<size_t>( + _Np, std::__countl_zero(__builtin_bit_cast(_MaskT, __builtin_convertvector(__vec, __mask_vec)))); +# else return std::min<size_t>( _Np, std::__countr_zero(__builtin_bit_cast(_MaskT, __builtin_convertvector(__vec, __mask_vec)))); +# endif }; if constexpr (sizeof(__mask_vec) == sizeof(uint8_t)) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h index 8a5e0211cd..07b5814639 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h @@ -696,9 +696,8 @@ __partition_with_equals_on_left(_RandomAccessIterator __first, _RandomAccessIter using _Ops = _IterOps<_AlgPolicy>; typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type; - // TODO(LLVM18): Make __begin const, see https://reviews.llvm.org/D147089#4349748 - _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around - const _RandomAccessIterator __end = __last; + const _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around + const _RandomAccessIterator __end = __last; (void)__end; // value_type __pivot(_Ops::__iter_move(__first)); if (__comp(__pivot, *(__last - difference_type(1)))) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unique.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unique.h index 056373d06f..d597014596 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unique.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unique.h @@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // unique template <class _AlgPolicy, class _Iter, class _Sent, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 std::pair<_Iter, _Iter> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 std::pair<_Iter, _Iter> __unique(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) { __first = std::__adjacent_find(__first, __last, __pred); if (__first != __last) { @@ -46,13 +46,13 @@ __unique(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) { } template <class _ForwardIterator, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { return std::__unique<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __pred).first; } template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last) { return std::unique(__first, __last, __equal_to()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h index 9c7d8fbcde..c39dec2e89 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h @@ -48,7 +48,7 @@ __upper_bound(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp } template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { static_assert(is_copy_constructible<_ForwardIterator>::value, "Iterator has to be copy constructible"); return std::__upper_bound<_ClassicAlgPolicy>( @@ -56,7 +56,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { return std::upper_bound(std::move(__first), std::move(__last), __value, __less<>()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h index 3dfb6937d0..bd3f659c22 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h @@ -462,22 +462,26 @@ atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __ // atomic_notify_one template <class _Tp> -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT { +_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void +atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT { __o->notify_one(); } template <class _Tp> -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT { +_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void +atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT { __o->notify_one(); } // atomic_notify_all template <class _Tp> -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT { +_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void +atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT { __o->notify_all(); } template <class _Tp> -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT { +_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void +atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT { __o->notify_all(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h index e9badccc25..7e26434c9c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h @@ -14,7 +14,6 @@ #include <__atomic/cxx_atomic_impl.h> #include <__atomic/is_always_lock_free.h> #include <__atomic/memory_order.h> -#include <__availability> #include <__config> #include <__memory/addressof.h> #include <__type_traits/is_integral.h> @@ -34,7 +33,7 @@ struct __atomic_base // false mutable __cxx_atomic_impl<_Tp> __a_; #if _LIBCPP_STD_VER >= 17 - static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value; + static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value; #endif _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const volatile _NOEXCEPT { @@ -130,11 +129,6 @@ struct __atomic_base // false __atomic_base(const __atomic_base&) = delete; }; -#if _LIBCPP_STD_VER >= 17 -template <class _Tp, bool __b> -_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free; -#endif - // atomic<Integral> template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h index 084366237c..00b157cdff 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h @@ -13,7 +13,6 @@ #include <__atomic/contention_t.h> #include <__atomic/cxx_atomic_impl.h> #include <__atomic/memory_order.h> -#include <__availability> #include <__chrono/duration.h> #include <__config> #include <__memory/addressof.h> @@ -49,22 +48,26 @@ struct atomic_flag { __cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const - volatile _NOEXCEPT { + _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void + wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT { std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void + _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT { std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { + _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { + std::__atomic_notify_one(*this); + } + _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT { std::__atomic_notify_all(*this); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); } + _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { + std::__atomic_notify_all(*this); + } #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI constexpr atomic_flag() _NOEXCEPT : __a_(false) {} @@ -141,41 +144,43 @@ inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_clear_explicit(atomic_flag* __o, m __o->clear(__m); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT { __o->wait(__v); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT { __o->wait(__v); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_wait_explicit(const volatile atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT { __o->wait(__v, __m); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_wait_explicit(const atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT { __o->wait(__v, __m); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT { __o->notify_one(); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT { +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT { __o->notify_one(); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT { __o->notify_all(); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT { +inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void +atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT { __o->notify_all(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h index 8ef5958bfe..8e86ba31b4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h @@ -15,12 +15,10 @@ # pragma GCC system_header #endif -#define ATOMIC_FLAG_INIT \ - { false } -#define ATOMIC_VAR_INIT(__v) \ - { __v } +#define ATOMIC_FLAG_INIT {false} +#define ATOMIC_VAR_INIT(__v) {__v} -#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) +#if _LIBCPP_STD_VER >= 20 && defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) # pragma clang deprecated(ATOMIC_VAR_INIT) #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_ref.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_ref.h new file mode 100644 index 0000000000..a63a95c4dd --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_ref.h @@ -0,0 +1,373 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +//===---------------------------------------------------------------------===// + +#ifndef _LIBCPP___ATOMIC_ATOMIC_REF_H +#define _LIBCPP___ATOMIC_ATOMIC_REF_H + +#include <__assert> +#include <__atomic/atomic_sync.h> +#include <__atomic/check_memory_order.h> +#include <__atomic/to_gcc_order.h> +#include <__concepts/arithmetic.h> +#include <__concepts/same_as.h> +#include <__config> +#include <__memory/addressof.h> +#include <__type_traits/has_unique_object_representation.h> +#include <__type_traits/is_trivially_copyable.h> +#include <cstddef> +#include <cstdint> +#include <cstring> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER >= 20 + +// These types are required to make __atomic_is_always_lock_free work across GCC and Clang. +// The purpose of this trick is to make sure that we provide an object with the correct alignment +// to __atomic_is_always_lock_free, since that answer depends on the alignment. +template <size_t _Alignment> +struct __alignment_checker_type { + alignas(_Alignment) char __data; +}; + +template <size_t _Alignment> +struct __get_aligner_instance { + static constexpr __alignment_checker_type<_Alignment> __instance{}; +}; + +template <class _Tp> +struct __atomic_ref_base { +protected: + _Tp* __ptr_; + + _LIBCPP_HIDE_FROM_ABI __atomic_ref_base(_Tp& __obj) : __ptr_(std::addressof(__obj)) {} + +private: + _LIBCPP_HIDE_FROM_ABI static _Tp* __clear_padding(_Tp& __val) noexcept { + _Tp* __ptr = std::addressof(__val); +# if __has_builtin(__builtin_clear_padding) + __builtin_clear_padding(__ptr); +# endif + return __ptr; + } + + _LIBCPP_HIDE_FROM_ABI static bool __compare_exchange( + _Tp* __ptr, _Tp* __expected, _Tp* __desired, bool __is_weak, int __success, int __failure) noexcept { + if constexpr ( +# if __has_builtin(__builtin_clear_padding) + has_unique_object_representations_v<_Tp> || floating_point<_Tp> +# else + true // NOLINT(readability-simplify-boolean-expr) +# endif + ) { + return __atomic_compare_exchange(__ptr, __expected, __desired, __is_weak, __success, __failure); + } else { // _Tp has padding bits and __builtin_clear_padding is available + __clear_padding(*__desired); + _Tp __copy = *__expected; + __clear_padding(__copy); + // The algorithm we use here is basically to perform `__atomic_compare_exchange` on the + // values until it has either succeeded, or failed because the value representation of the + // objects involved was different. This is why we loop around __atomic_compare_exchange: + // we basically loop until its failure is caused by the value representation of the objects + // being different, not only their object representation. + while (true) { + _Tp __prev = __copy; + if (__atomic_compare_exchange(__ptr, std::addressof(__copy), __desired, __is_weak, __success, __failure)) { + return true; + } + _Tp __curr = __copy; + if (std::memcmp(__clear_padding(__prev), __clear_padding(__curr), sizeof(_Tp)) != 0) { + // Value representation without padding bits do not compare equal -> + // write the current content of *ptr into *expected + std::memcpy(__expected, std::addressof(__copy), sizeof(_Tp)); + return false; + } + } + } + } + + friend struct __atomic_waitable_traits<__atomic_ref_base<_Tp>>; + +public: + using value_type = _Tp; + + static constexpr size_t required_alignment = alignof(_Tp); + + // The __atomic_always_lock_free builtin takes into account the alignment of the pointer if provided, + // so we create a fake pointer with a suitable alignment when querying it. Note that we are guaranteed + // that the pointer is going to be aligned properly at runtime because that is a (checked) precondition + // of atomic_ref's constructor. + static constexpr bool is_always_lock_free = + __atomic_always_lock_free(sizeof(_Tp), &__get_aligner_instance<required_alignment>::__instance); + + _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const noexcept { return __atomic_is_lock_free(sizeof(_Tp), __ptr_); } + + _LIBCPP_HIDE_FROM_ABI void store(_Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept + _LIBCPP_CHECK_STORE_MEMORY_ORDER(__order) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __order == memory_order::relaxed || __order == memory_order::release || __order == memory_order::seq_cst, + "atomic_ref: memory order argument to atomic store operation is invalid"); + __atomic_store(__ptr_, __clear_padding(__desired), std::__to_gcc_order(__order)); + } + + _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { + store(__desired); + return __desired; + } + + _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __order = memory_order::seq_cst) const noexcept + _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__order) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __order == memory_order::relaxed || __order == memory_order::consume || __order == memory_order::acquire || + __order == memory_order::seq_cst, + "atomic_ref: memory order argument to atomic load operation is invalid"); + alignas(_Tp) byte __mem[sizeof(_Tp)]; + auto* __ret = reinterpret_cast<_Tp*>(__mem); + __atomic_load(__ptr_, __ret, std::__to_gcc_order(__order)); + return *__ret; + } + + _LIBCPP_HIDE_FROM_ABI operator _Tp() const noexcept { return load(); } + + _LIBCPP_HIDE_FROM_ABI _Tp exchange(_Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept { + alignas(_Tp) byte __mem[sizeof(_Tp)]; + auto* __ret = reinterpret_cast<_Tp*>(__mem); + __atomic_exchange(__ptr_, __clear_padding(__desired), __ret, std::__to_gcc_order(__order)); + return *__ret; + } + + _LIBCPP_HIDE_FROM_ABI bool + compare_exchange_weak(_Tp& __expected, _Tp __desired, memory_order __success, memory_order __failure) const noexcept + _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__success, __failure) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __failure == memory_order::relaxed || __failure == memory_order::consume || + __failure == memory_order::acquire || __failure == memory_order::seq_cst, + "atomic_ref: failure memory order argument to weak atomic compare-and-exchange operation is invalid"); + return __compare_exchange( + __ptr_, + std::addressof(__expected), + std::addressof(__desired), + true, + std::__to_gcc_order(__success), + std::__to_gcc_order(__failure)); + } + _LIBCPP_HIDE_FROM_ABI bool + compare_exchange_strong(_Tp& __expected, _Tp __desired, memory_order __success, memory_order __failure) const noexcept + _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__success, __failure) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __failure == memory_order::relaxed || __failure == memory_order::consume || + __failure == memory_order::acquire || __failure == memory_order::seq_cst, + "atomic_ref: failure memory order argument to strong atomic compare-and-exchange operation is invalid"); + return __compare_exchange( + __ptr_, + std::addressof(__expected), + std::addressof(__desired), + false, + std::__to_gcc_order(__success), + std::__to_gcc_order(__failure)); + } + + _LIBCPP_HIDE_FROM_ABI bool + compare_exchange_weak(_Tp& __expected, _Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept { + return __compare_exchange( + __ptr_, + std::addressof(__expected), + std::addressof(__desired), + true, + std::__to_gcc_order(__order), + std::__to_gcc_failure_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI bool + compare_exchange_strong(_Tp& __expected, _Tp __desired, memory_order __order = memory_order::seq_cst) const noexcept { + return __compare_exchange( + __ptr_, + std::addressof(__expected), + std::addressof(__desired), + false, + std::__to_gcc_order(__order), + std::__to_gcc_failure_order(__order)); + } + + _LIBCPP_HIDE_FROM_ABI void wait(_Tp __old, memory_order __order = memory_order::seq_cst) const noexcept + _LIBCPP_CHECK_WAIT_MEMORY_ORDER(__order) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __order == memory_order::relaxed || __order == memory_order::consume || __order == memory_order::acquire || + __order == memory_order::seq_cst, + "atomic_ref: memory order argument to atomic wait operation is invalid"); + std::__atomic_wait(*this, __old, __order); + } + _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); } + _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); } +}; + +template <class _Tp> +struct __atomic_waitable_traits<__atomic_ref_base<_Tp>> { + static _LIBCPP_HIDE_FROM_ABI _Tp __atomic_load(const __atomic_ref_base<_Tp>& __a, memory_order __order) { + return __a.load(__order); + } + static _LIBCPP_HIDE_FROM_ABI const _Tp* __atomic_contention_address(const __atomic_ref_base<_Tp>& __a) { + return __a.__ptr_; + } +}; + +template <class _Tp> +struct atomic_ref : public __atomic_ref_base<_Tp> { + static_assert(is_trivially_copyable_v<_Tp>, "std::atomic_ref<T> requires that 'T' be a trivially copyable type"); + + using __base = __atomic_ref_base<_Tp>; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0, + "atomic_ref ctor: referenced object must be aligned to required_alignment"); + } + + _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); } + + atomic_ref& operator=(const atomic_ref&) = delete; +}; + +template <class _Tp> + requires(std::integral<_Tp> && !std::same_as<bool, _Tp>) +struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> { + using __base = __atomic_ref_base<_Tp>; + + using difference_type = typename __base::value_type; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0, + "atomic_ref ctor: referenced object must be aligned to required_alignment"); + } + + _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); } + + atomic_ref& operator=(const atomic_ref&) = delete; + + _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_add(this->__ptr_, __arg, std::__to_gcc_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_sub(this->__ptr_, __arg, std::__to_gcc_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI _Tp fetch_and(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_and(this->__ptr_, __arg, std::__to_gcc_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI _Tp fetch_or(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_or(this->__ptr_, __arg, std::__to_gcc_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI _Tp fetch_xor(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_xor(this->__ptr_, __arg, std::__to_gcc_order(__order)); + } + + _LIBCPP_HIDE_FROM_ABI _Tp operator++(int) const noexcept { return fetch_add(_Tp(1)); } + _LIBCPP_HIDE_FROM_ABI _Tp operator--(int) const noexcept { return fetch_sub(_Tp(1)); } + _LIBCPP_HIDE_FROM_ABI _Tp operator++() const noexcept { return fetch_add(_Tp(1)) + _Tp(1); } + _LIBCPP_HIDE_FROM_ABI _Tp operator--() const noexcept { return fetch_sub(_Tp(1)) - _Tp(1); } + _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __arg) const noexcept { return fetch_add(__arg) + __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp operator-=(_Tp __arg) const noexcept { return fetch_sub(__arg) - __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp operator&=(_Tp __arg) const noexcept { return fetch_and(__arg) & __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp operator|=(_Tp __arg) const noexcept { return fetch_or(__arg) | __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp operator^=(_Tp __arg) const noexcept { return fetch_xor(__arg) ^ __arg; } +}; + +template <class _Tp> + requires std::floating_point<_Tp> +struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> { + using __base = __atomic_ref_base<_Tp>; + + using difference_type = typename __base::value_type; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0, + "atomic_ref ctor: referenced object must be aligned to required_alignment"); + } + + _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); } + + atomic_ref& operator=(const atomic_ref&) = delete; + + _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + _Tp __old = this->load(memory_order_relaxed); + _Tp __new = __old + __arg; + while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) { + __new = __old + __arg; + } + return __old; + } + _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __arg, memory_order __order = memory_order_seq_cst) const noexcept { + _Tp __old = this->load(memory_order_relaxed); + _Tp __new = __old - __arg; + while (!this->compare_exchange_weak(__old, __new, __order, memory_order_relaxed)) { + __new = __old - __arg; + } + return __old; + } + + _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __arg) const noexcept { return fetch_add(__arg) + __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp operator-=(_Tp __arg) const noexcept { return fetch_sub(__arg) - __arg; } +}; + +template <class _Tp> +struct atomic_ref<_Tp*> : public __atomic_ref_base<_Tp*> { + using __base = __atomic_ref_base<_Tp*>; + + using difference_type = ptrdiff_t; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp*& __ptr) : __base(__ptr) {} + + _LIBCPP_HIDE_FROM_ABI _Tp* operator=(_Tp* __desired) const noexcept { return __base::operator=(__desired); } + + atomic_ref& operator=(const atomic_ref&) = delete; + + _LIBCPP_HIDE_FROM_ABI _Tp* fetch_add(ptrdiff_t __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_add(this->__ptr_, __arg * sizeof(_Tp), std::__to_gcc_order(__order)); + } + _LIBCPP_HIDE_FROM_ABI _Tp* fetch_sub(ptrdiff_t __arg, memory_order __order = memory_order_seq_cst) const noexcept { + return __atomic_fetch_sub(this->__ptr_, __arg * sizeof(_Tp), std::__to_gcc_order(__order)); + } + + _LIBCPP_HIDE_FROM_ABI _Tp* operator++(int) const noexcept { return fetch_add(1); } + _LIBCPP_HIDE_FROM_ABI _Tp* operator--(int) const noexcept { return fetch_sub(1); } + _LIBCPP_HIDE_FROM_ABI _Tp* operator++() const noexcept { return fetch_add(1) + 1; } + _LIBCPP_HIDE_FROM_ABI _Tp* operator--() const noexcept { return fetch_sub(1) - 1; } + _LIBCPP_HIDE_FROM_ABI _Tp* operator+=(ptrdiff_t __arg) const noexcept { return fetch_add(__arg) + __arg; } + _LIBCPP_HIDE_FROM_ABI _Tp* operator-=(ptrdiff_t __arg) const noexcept { return fetch_sub(__arg) - __arg; } +}; + +_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(atomic_ref); + +#endif // _LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP__ATOMIC_ATOMIC_REF_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h index e583dca38c..aaf81f5873 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h @@ -12,7 +12,7 @@ #include <__atomic/contention_t.h> #include <__atomic/cxx_atomic_impl.h> #include <__atomic/memory_order.h> -#include <__availability> +#include <__atomic/to_gcc_order.h> #include <__chrono/duration.h> #include <__config> #include <__memory/addressof.h> @@ -71,19 +71,21 @@ struct __atomic_wait_poll_impl { #ifndef _LIBCPP_HAS_NO_THREADS -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*); -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*); -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*); -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t); +_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*) _NOEXCEPT; +_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*) _NOEXCEPT; +_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t +__libcpp_atomic_monitor(void const volatile*) _NOEXCEPT; +_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void +__libcpp_atomic_wait(void const volatile*, __cxx_contention_t) _NOEXCEPT; _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void -__cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*); +__cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*) _NOEXCEPT; _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void -__cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*); +__cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*) _NOEXCEPT; _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t -__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*); +__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*) _NOEXCEPT; _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void -__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t); +__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t) _NOEXCEPT; template <class _AtomicWaitable, class _Poll> struct __atomic_wait_backoff_impl { diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h index 3012aec052..536f764a61 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h @@ -27,4 +27,8 @@ _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || __f == memory_order_acq_rel, \ "memory order argument to atomic operation is invalid") +#define _LIBCPP_CHECK_WAIT_MEMORY_ORDER(__m) \ + _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || __m == memory_order_acq_rel, \ + "memory order argument to atomic operation is invalid") + #endif // _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h index b900cc135f..18e88aa97b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h @@ -10,6 +10,7 @@ #define _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H #include <__atomic/memory_order.h> +#include <__atomic/to_gcc_order.h> #include <__config> #include <__memory/addressof.h> #include <__type_traits/is_assignable.h> @@ -54,32 +55,6 @@ struct __cxx_atomic_base_impl { _Tp __a_value; }; -_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { - // Avoid switch statement to make this a constexpr. - return __order == memory_order_relaxed - ? __ATOMIC_RELAXED - : (__order == memory_order_acquire - ? __ATOMIC_ACQUIRE - : (__order == memory_order_release - ? __ATOMIC_RELEASE - : (__order == memory_order_seq_cst - ? __ATOMIC_SEQ_CST - : (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL : __ATOMIC_CONSUME)))); -} - -_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) { - // Avoid switch statement to make this a constexpr. - return __order == memory_order_relaxed - ? __ATOMIC_RELAXED - : (__order == memory_order_acquire - ? __ATOMIC_ACQUIRE - : (__order == memory_order_release - ? __ATOMIC_RELAXED - : (__order == memory_order_seq_cst - ? __ATOMIC_SEQ_CST - : (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE : __ATOMIC_CONSUME)))); -} - template <typename _Tp> _LIBCPP_HIDE_FROM_ABI void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) { __cxx_atomic_assign_volatile(__a->__a_value, __val); diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h index 16fd186769..294121d1c4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h @@ -37,7 +37,7 @@ enum class memory_order : __memory_order_underlying_t { seq_cst = __mo_seq_cst }; -static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value), +static_assert(is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value, "unexpected underlying type for std::memory_order"); inline constexpr auto memory_order_relaxed = memory_order::relaxed; diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/to_gcc_order.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/to_gcc_order.h new file mode 100644 index 0000000000..d04c111add --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/to_gcc_order.h @@ -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 +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ATOMIC_TO_GCC_ORDER_H +#define _LIBCPP___ATOMIC_TO_GCC_ORDER_H + +#include <__atomic/memory_order.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if defined(__ATOMIC_RELAXED) && defined(__ATOMIC_CONSUME) && defined(__ATOMIC_ACQUIRE) && \ + defined(__ATOMIC_RELEASE) && defined(__ATOMIC_ACQ_REL) && defined(__ATOMIC_SEQ_CST) + +_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { + // Avoid switch statement to make this a constexpr. + return __order == memory_order_relaxed + ? __ATOMIC_RELAXED + : (__order == memory_order_acquire + ? __ATOMIC_ACQUIRE + : (__order == memory_order_release + ? __ATOMIC_RELEASE + : (__order == memory_order_seq_cst + ? __ATOMIC_SEQ_CST + : (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL : __ATOMIC_CONSUME)))); +} + +_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) { + // Avoid switch statement to make this a constexpr. + return __order == memory_order_relaxed + ? __ATOMIC_RELAXED + : (__order == memory_order_acquire + ? __ATOMIC_ACQUIRE + : (__order == memory_order_release + ? __ATOMIC_RELAXED + : (__order == memory_order_seq_cst + ? __ATOMIC_SEQ_CST + : (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE : __ATOMIC_CONSUME)))); +} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ATOMIC_TO_GCC_ORDER_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__availability b/contrib/libs/cxxsupp/libcxx/include/__availability deleted file mode 100644 index bb3ed0a8da..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__availability +++ /dev/null @@ -1,324 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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___AVAILABILITY -#define _LIBCPP___AVAILABILITY - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -// Libc++ is shipped by various vendors. In particular, it is used as a system -// library on macOS, iOS and other Apple platforms. In order for users to be -// able to compile a binary that is intended to be deployed to an older version -// of a platform, Clang provides availability attributes [1]. These attributes -// can be placed on declarations and are used to describe the life cycle of a -// symbol in the library. -// -// The main goal is to ensure a compile-time error if a symbol that hasn't been -// introduced in a previously released library is used in a program that targets -// that previously released library. Normally, this would be a load-time error -// when one tries to launch the program against the older library. -// -// For example, the filesystem library was introduced in the dylib in macOS 10.15. -// If a user compiles on a macOS 10.15 host but targets macOS 10.13 with their -// program, the compiler would normally not complain (because the required -// declarations are in the headers), but the dynamic loader would fail to find -// the symbols when actually trying to launch the program on macOS 10.13. To -// turn this into a compile-time issue instead, declarations are annotated with -// when they were introduced, and the compiler can produce a diagnostic if the -// program references something that isn't available on the deployment target. -// -// This mechanism is general in nature, and any vendor can add their markup to -// the library (see below). Whenever a new feature is added that requires support -// in the shared library, two macros are added below to allow marking the feature -// as unavailable: -// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` which must be defined -// exactly when compiling for a target that doesn't support the feature. -// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must always be defined -// and must expand to the proper availability attribute for the platform. -// -// When vendors decide to ship the feature as part of their shared library, they -// can update these macros appropriately for their platform, and the library will -// use those to provide an optimal user experience. -// -// Furthermore, many features in the standard library have corresponding -// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` macros -// are checked by the corresponding feature-test macros generated by -// generate_feature_test_macro_components.py to ensure that the library -// doesn't announce a feature as being implemented if it is unavailable on -// the deployment target. -// -// Note that this mechanism is disabled by default in the "upstream" libc++. -// Availability annotations are only meaningful when shipping libc++ inside -// a platform (i.e. as a system library), and so vendors that want them should -// turn those annotations on at CMake configuration time. -// -// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability - -// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY -// for a while. -#if defined(_LIBCPP_DISABLE_AVAILABILITY) -# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) -# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -# endif -#endif - -// Availability markup is disabled when building the library, or when a non-Clang -// compiler is used because only Clang supports the necessary attributes. -// doesn't support the proper attributes. -#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || !defined(_LIBCPP_COMPILER_CLANG_BASED) -# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) -# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -# endif -#endif - -#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) - -// These macros control the availability of std::bad_optional_access and -// other exception types. These were put in the shared library to prevent -// code bloat from every user program defining the vtable for these exception -// types. -// -// Note that when exceptions are disabled, the methods that normally throw -// these exceptions can be used even on older deployment targets, but those -// methods will abort instead of throwing. -# define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS 1 -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS - -# define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS 1 -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS - -# define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST 1 -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST - -// These macros control the availability of all parts of <filesystem> that -// depend on something in the dylib. -# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 1 -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP - -// This controls the availability of the C++20 synchronization library, -// which requires shared library support for various operations -// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>, -// <semaphore>, and notification functions on std::atomic. -# define _LIBCPP_AVAILABILITY_HAS_SYNC 1 -# define _LIBCPP_AVAILABILITY_SYNC - -// Enable additional explicit instantiations of iostreams components. This -// reduces the number of weak definitions generated in programs that use -// iostreams by providing a single strong definition in the shared library. -// -// TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation, -// or once libc++ doesn't use the attribute anymore. -// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed. -# if !defined(_LIBCPP_COMPILER_GCC) && !defined(_WIN32) -# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 1 -# else -# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0 -# endif - -// This controls the availability of floating-point std::to_chars functions. -// These overloads were added later than the integer overloads. -# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 1 -# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT - -// This controls whether the library claims to provide a default verbose -// termination function, and consequently whether the headers will try -// to use it when the mechanism isn't overriden at compile-time. -# define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 1 -# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT - -// This controls the availability of the C++17 std::pmr library, -// which is implemented in large part in the built library. -# define _LIBCPP_AVAILABILITY_HAS_PMR 1 -# define _LIBCPP_AVAILABILITY_PMR - -// These macros controls the availability of __cxa_init_primary_exception -// in the built library, which std::make_exception_ptr might use -// (see libcxx/include/__exception/exception_ptr.h). -# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 1 -# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION - -// This controls the availability of C++23 <print>, which -// has a dependency on the built library (it needs access to -// the underlying buffer types of std::cout, std::cerr, and std::clog. -# define _LIBCPP_AVAILABILITY_HAS_PRINT 1 -# define _LIBCPP_AVAILABILITY_PRINT - -// This controls the availability of the C++20 time zone database. -// The parser code is built in the library. -# define _LIBCPP_AVAILABILITY_HAS_TZDB 1 -# define _LIBCPP_AVAILABILITY_TZDB - -#elif defined(__APPLE__) - -# define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS \ - (!defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 50000) - -# define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS - -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((availability(watchos, strict, introduced = 5.0))) -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS - -// TODO: Update once this is released -# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0 -# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION __attribute__((unavailable)) - -// <filesystem> -// clang-format off -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) -// clang-format on -# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 0 -# else -# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 1 -# endif -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY \ - __attribute__((availability(macos, strict, introduced = 10.15))) \ - __attribute__((availability(ios, strict, introduced = 13.0))) \ - __attribute__((availability(tvos, strict, introduced = 13.0))) \ - __attribute__((availability(watchos, strict, introduced = 6.0))) -// clang-format off -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH \ - _Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))") -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") -// clang-format on - -// std::to_chars(floating-point) -// clang-format off -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160300) || \ - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160300) || \ - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90300) -// clang-format on -# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 0 -# else -# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 1 -# endif -# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT \ - __attribute__((availability(macos, strict, introduced = 13.3))) \ - __attribute__((availability(ios, strict, introduced = 16.3))) \ - __attribute__((availability(tvos, strict, introduced = 16.3))) \ - __attribute__((availability(watchos, strict, introduced = 9.3))) - -// c++20 synchronization library -// clang-format off -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \ - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \ - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000) -// clang-format on -# define _LIBCPP_AVAILABILITY_HAS_SYNC 0 -# else -# define _LIBCPP_AVAILABILITY_HAS_SYNC 1 -# endif -# define _LIBCPP_AVAILABILITY_SYNC \ - __attribute__((availability(macos, strict, introduced = 11.0))) \ - __attribute__((availability(ios, strict, introduced = 14.0))) \ - __attribute__((availability(tvos, strict, introduced = 14.0))) \ - __attribute__((availability(watchos, strict, introduced = 7.0))) - -// __libcpp_verbose_abort -// TODO: Update once this is released -# define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 0 - -# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT __attribute__((unavailable)) - -// std::pmr -// clang-format off -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \ - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \ - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000) -// clang-format on -# define _LIBCPP_AVAILABILITY_HAS_PMR 0 -# else -# define _LIBCPP_AVAILABILITY_HAS_PMR 1 -# endif -// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed -// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support -// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we -// use availability annotations until that bug has been fixed. -# if 0 -# define _LIBCPP_AVAILABILITY_PMR \ - __attribute__((availability(macos, strict, introduced = 14.0))) \ - __attribute__((availability(ios, strict, introduced = 17.0))) \ - __attribute__((availability(tvos, strict, introduced = 17.0))) \ - __attribute__((availability(watchos, strict, introduced = 10.0))) -# else -# define _LIBCPP_AVAILABILITY_PMR -# endif - -# define _LIBCPP_AVAILABILITY_HAS_TZDB 0 -# define _LIBCPP_AVAILABILITY_TZDB __attribute__((unavailable)) - -// Warning: This availability macro works differently than the other macros. -// The dylib part of print is not needed on Apple platforms. Therefore when -// the macro is not available the code calling the dylib is commented out. -// The macro _LIBCPP_AVAILABILITY_PRINT is not used. -# define _LIBCPP_AVAILABILITY_HAS_PRINT 0 -# define _LIBCPP_AVAILABILITY_PRINT __attribute__((unavailable)) - -// clang-format off -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 120000) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 150000) || \ - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 150000) || \ - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 80000) -// clang-format on -# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0 -# else -# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 1 -# endif -#else - -// ...New vendors can add availability markup here... - -# error \ - "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!" - -#endif - -// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS. -// Those are defined in terms of the availability attributes above, and -// should not be vendor-specific. -#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) -# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS -#else -# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST -# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS -#endif - -// Define availability attributes that depend on both -// _LIBCPP_HAS_NO_EXCEPTIONS and _LIBCPP_HAS_NO_RTTI. -#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) || defined(_LIBCPP_HAS_NO_RTTI) -# undef _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION -# undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION -# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0 -# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION -#endif - -#endif // _LIBCPP___AVAILABILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h index 6298810f37..cd04567381 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h @@ -33,7 +33,7 @@ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI constexpr _ToType __bit_cast(const _From template <class _ToType, class _FromType> requires(sizeof(_ToType) == sizeof(_FromType) && is_trivially_copyable_v<_ToType> && is_trivially_copyable_v<_FromType>) -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _ToType bit_cast(const _FromType& __from) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _ToType bit_cast(const _FromType& __from) noexcept { return __builtin_bit_cast(_ToType, __from); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h index 77fa739503..cfd792dc2e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h @@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) noexcept { if (__t < 2) return 1; const unsigned __n = numeric_limits<_Tp>::digits - std::__countl_zero((_Tp)(__t - 1u)); @@ -42,7 +42,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) no # if _LIBCPP_STD_VER >= 20 template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept { return std::__bit_ceil(__t); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h index cf5cf5803a..133e369504 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept { return __t == 0 ? 0 : _Tp{1} << std::__bit_log2(__t); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h index a2020a0142..853e481776 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept { return __t == 0 ? 0 : std::__bit_log2(__t) + 1; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h b/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h index 20045d6fd4..6225ecf2f9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 23 template <integral _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept { if constexpr (sizeof(_Tp) == 1) { return __val; } else if constexpr (sizeof(_Tp) == 2) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h b/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h index 396cfc2c3f..998a0b44c1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// TODO: __builtin_clzg is available since Clang 19 and GCC 14. When support for older versions is dropped, we can +// refactor this code to exclusively use __builtin_clzg. + #ifndef _LIBCPP___BIT_COUNTL_H #define _LIBCPP___BIT_COUNTL_H @@ -38,6 +41,9 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_cl #ifndef _LIBCPP_HAS_NO_INT128 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_clz(__uint128_t __x) _NOEXCEPT { +# if __has_builtin(__builtin_clzg) + return __builtin_clzg(__x); +# else // The function is written in this form due to C++ constexpr limitations. // The algorithm: // - Test whether any bit in the high 64-bits is set @@ -49,12 +55,16 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_clz(__uint128_t __x) // zeros in the high 64-bits. return ((__x >> 64) == 0) ? (64 + __builtin_clzll(static_cast<unsigned long long>(__x))) : __builtin_clzll(static_cast<unsigned long long>(__x >> 64)); +# endif } #endif // _LIBCPP_HAS_NO_INT128 template <class _Tp> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _NOEXCEPT { static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countl_zero requires an unsigned integer type"); +#if __has_builtin(__builtin_clzg) + return __builtin_clzg(__t, numeric_limits<_Tp>::digits); +#else // __has_builtin(__builtin_clzg) if (__t == 0) return numeric_limits<_Tp>::digits; @@ -79,17 +89,18 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _ } return __ret + __iter; } +#endif // __has_builtin(__builtin_clzg) } #if _LIBCPP_STD_VER >= 20 template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept { return std::__countl_zero(__t); } template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept { return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h b/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h index b6b3ac52ca..9e92021fba 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// TODO: __builtin_ctzg is available since Clang 19 and GCC 14. When support for older versions is dropped, we can +// refactor this code to exclusively use __builtin_ctzg. + #ifndef _LIBCPP___BIT_COUNTR_H #define _LIBCPP___BIT_COUNTR_H @@ -37,9 +40,11 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_ct template <class _Tp> _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countr_zero(_Tp __t) _NOEXCEPT { +#if __has_builtin(__builtin_ctzg) + return __builtin_ctzg(__t, numeric_limits<_Tp>::digits); +#else // __has_builtin(__builtin_ctzg) if (__t == 0) return numeric_limits<_Tp>::digits; - if (sizeof(_Tp) <= sizeof(unsigned int)) return std::__libcpp_ctz(static_cast<unsigned int>(__t)); else if (sizeof(_Tp) <= sizeof(unsigned long)) @@ -55,17 +60,18 @@ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __coun } return __ret + std::__libcpp_ctz(static_cast<unsigned long long>(__t)); } +#endif // __has_builtin(__builtin_ctzg) } #if _LIBCPP_STD_VER >= 20 template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept { return std::__countr_zero(__t); } template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept { return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h b/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h index a4e178060a..52f5853a1b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h @@ -24,7 +24,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept { return __t != 0 && (((__t & (__t - 1)) == 0)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h b/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h index b0319cef25..5cf0a01d07 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h +++ b/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// TODO: __builtin_popcountg is available since Clang 19 and GCC 14. When support for older versions is dropped, we can +// refactor this code to exclusively use __builtin_popcountg. + #ifndef _LIBCPP___BIT_POPCOUNT_H #define _LIBCPP___BIT_POPCOUNT_H @@ -38,7 +41,10 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_popcount(unsigned lo #if _LIBCPP_STD_VER >= 20 template <__libcpp_unsigned_integer _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept { +# if __has_builtin(__builtin_popcountg) + return __builtin_popcountg(__t); +# else // __has_builtin(__builtin_popcountg) if (sizeof(_Tp) <= sizeof(unsigned int)) return std::__libcpp_popcount(static_cast<unsigned int>(__t)); else if (sizeof(_Tp) <= sizeof(unsigned long)) @@ -53,6 +59,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noex } return __ret; } +# endif // __has_builtin(__builtin_popcountg) } #endif // _LIBCPP_STD_VER >= 20 diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit_reference b/contrib/libs/cxxsupp/libcxx/include/__bit_reference index 9579b9eaf7..606069d98b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__bit_reference +++ b/contrib/libs/cxxsupp/libcxx/include/__bit_reference @@ -95,8 +95,8 @@ public: } private: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_reference( - __storage_pointer __s, __storage_type __m) _NOEXCEPT + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} }; @@ -149,6 +149,7 @@ public: using __container = typename _Cp::__self; _LIBCPP_HIDE_FROM_ABI __bit_const_reference(const __bit_const_reference&) = default; + __bit_const_reference& operator=(const __bit_const_reference&) = delete; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT : __seg_(__x.__seg_), @@ -163,12 +164,10 @@ public: } private: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __bit_const_reference( - __storage_pointer __s, __storage_type __m) _NOEXCEPT + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR explicit __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} - - __bit_const_reference& operator=(const __bit_const_reference&) = delete; }; // copy @@ -940,8 +939,8 @@ public: } private: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_iterator( - __storage_pointer __s, unsigned __ctz) _NOEXCEPT + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT : __seg_(__s), __ctz_(__ctz) {} @@ -1000,8 +999,8 @@ private: _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, _IC> __find_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); template <bool _ToCount, class _Dp, bool _IC> - friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - __count_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); + friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 __count_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); }; _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h index 95faa29010..c76cebd5d1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h +++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h @@ -39,20 +39,17 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator^(chars_format __x, return chars_format(std::__to_underlying(__x) ^ std::__to_underlying(__y)); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format& -operator&=(chars_format& __x, chars_format __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator&=(chars_format& __x, chars_format __y) { __x = __x & __y; return __x; } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format& -operator|=(chars_format& __x, chars_format __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator|=(chars_format& __x, chars_format __y) { __x = __x | __y; return __x; } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format& -operator^=(chars_format& __x, chars_format __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator^=(chars_format& __x, chars_format __y) { __x = __x ^ __y; return __x; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h index 08720e1078..118f316b21 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h +++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H #define _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H -#include <__availability> #include <__charconv/chars_format.h> #include <__charconv/to_chars_result.h> #include <__config> diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h index 1301cd6f1f..881a497082 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h @@ -16,10 +16,12 @@ #include <__chrono/duration.h> #include <__chrono/file_clock.h> #include <__chrono/hh_mm_ss.h> +#include <__chrono/local_info.h> #include <__chrono/month.h> #include <__chrono/month_weekday.h> #include <__chrono/monthday.h> #include <__chrono/statically_widen.h> +#include <__chrono/sys_info.h> #include <__chrono/system_clock.h> #include <__chrono/time_point.h> #include <__chrono/weekday.h> @@ -171,6 +173,12 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _ChronoT& __value) { if (__value.hours().count() > std::numeric_limits<decltype(__result.tm_hour)>::max()) std::__throw_format_error("Formatting hh_mm_ss, encountered an hour overflow"); __result.tm_hour = __value.hours().count(); +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + } else if constexpr (same_as<_ChronoT, chrono::sys_info>) { + // Has no time information. + } else if constexpr (same_as<_ChronoT, chrono::local_info>) { + // Has no time information. +# endif } else static_assert(sizeof(_ChronoT) == 0, "Add the missing type specialization"); diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h index 1e81420244..1e36d73428 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h @@ -391,8 +391,8 @@ operator<=>(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Perio template <class _Rep1, class _Period1, class _Rep2, class _Period2> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR - typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type - operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { +typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type +operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; return _Cd(_Cd(__lhs).count() + _Cd(__rhs).count()); } @@ -401,8 +401,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR template <class _Rep1, class _Period1, class _Rep2, class _Period2> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR - typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type - operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { +typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type +operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; return _Cd(_Cd(__lhs).count() - _Cd(__rhs).count()); } @@ -468,8 +468,8 @@ operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) { template <class _Rep1, class _Period1, class _Rep2, class _Period2> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR - typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type - operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { +typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type +operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { typedef typename common_type<_Rep1, _Rep2>::type _Cr; typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; return _Cd(static_cast<_Cr>(_Cd(__lhs).count()) % static_cast<_Cr>(_Cd(__rhs).count())); diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/exception.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/exception.h new file mode 100644 index 0000000000..266f8fac44 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/exception.h @@ -0,0 +1,135 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +#ifndef _LIBCPP___CHRONO_EXCEPTION_H +#define _LIBCPP___CHRONO_EXCEPTION_H + +#include <version> +// Enable the contents of the header only when libc++ was built with experimental features enabled. +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/calendar.h> +# include <__chrono/local_info.h> +# include <__chrono/time_point.h> +# include <__config> +# include <__configuration/availability.h> +# include <__verbose_abort> +# include <format> +# include <stdexcept> +# include <string> + +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +# if _LIBCPP_STD_VER >= 20 + +namespace chrono { + +class nonexistent_local_time : public runtime_error { +public: + template <class _Duration> + _LIBCPP_HIDE_FROM_ABI nonexistent_local_time(const local_time<_Duration>& __time, const local_info& __info) + : runtime_error{__create_message(__time, __info)} { + // [time.zone.exception.nonexist]/2 + // Preconditions: i.result == local_info::nonexistent is true. + // The value of __info.result is not used. + _LIBCPP_ASSERT_PEDANTIC(__info.result == local_info::nonexistent, + "creating an nonexistent_local_time from a local_info that is not non-existent"); + } + + _LIBCPP_HIDE_FROM_ABI nonexistent_local_time(const nonexistent_local_time&) = default; + _LIBCPP_HIDE_FROM_ABI nonexistent_local_time& operator=(const nonexistent_local_time&) = default; + + _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~nonexistent_local_time() override; // exported as key function + +private: + template <class _Duration> + _LIBCPP_HIDE_FROM_ABI string __create_message(const local_time<_Duration>& __time, const local_info& __info) { + return std::format( + R"({} is in a gap between +{} {} and +{} {} which are both equivalent to +{} UTC)", + __time, + local_seconds{__info.first.end.time_since_epoch()} + __info.first.offset, + __info.first.abbrev, + local_seconds{__info.second.begin.time_since_epoch()} + __info.second.offset, + __info.second.abbrev, + __info.first.end); + } +}; + +template <class _Duration> +_LIBCPP_NORETURN _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI void __throw_nonexistent_local_time( + [[maybe_unused]] const local_time<_Duration>& __time, [[maybe_unused]] const local_info& __info) { +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + throw nonexistent_local_time(__time, __info); +# else + _LIBCPP_VERBOSE_ABORT("nonexistent_local_time was thrown in -fno-exceptions mode"); +# endif +} + +class ambiguous_local_time : public runtime_error { +public: + template <class _Duration> + _LIBCPP_HIDE_FROM_ABI ambiguous_local_time(const local_time<_Duration>& __time, const local_info& __info) + : runtime_error{__create_message(__time, __info)} { + // [time.zone.exception.ambig]/2 + // Preconditions: i.result == local_info::ambiguous is true. + // The value of __info.result is not used. + _LIBCPP_ASSERT_PEDANTIC(__info.result == local_info::ambiguous, + "creating an ambiguous_local_time from a local_info that is not ambiguous"); + } + + _LIBCPP_HIDE_FROM_ABI ambiguous_local_time(const ambiguous_local_time&) = default; + _LIBCPP_HIDE_FROM_ABI ambiguous_local_time& operator=(const ambiguous_local_time&) = default; + + _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~ambiguous_local_time() override; // exported as key function + +private: + template <class _Duration> + _LIBCPP_HIDE_FROM_ABI string __create_message(const local_time<_Duration>& __time, const local_info& __info) { + return std::format( + // There are two spaces after the full-stop; this has been verified + // in the sources of the Standard. + R"({0} is ambiguous. It could be +{0} {1} == {2} UTC or +{0} {3} == {4} UTC)", + __time, + __info.first.abbrev, + __time - __info.first.offset, + __info.second.abbrev, + __time - __info.second.offset); + } +}; + +template <class _Duration> +_LIBCPP_NORETURN _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI void __throw_ambiguous_local_time( + [[maybe_unused]] const local_time<_Duration>& __time, [[maybe_unused]] const local_info& __info) { +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + throw ambiguous_local_time(__time, __info); +# else + _LIBCPP_VERBOSE_ABORT("ambiguous_local_time was thrown in -fno-exceptions mode"); +# endif +} + +} // namespace chrono + +# endif // _LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +#endif // _LIBCPP___CHRONO_EXCEPTION_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h index 7d25729fec..4dd3f88ce5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___CHRONO_FILE_CLOCK_H #define _LIBCPP___CHRONO_FILE_CLOCK_H -#include <__availability> #include <__chrono/duration.h> #include <__chrono/system_clock.h> #include <__chrono/time_point.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h index 4ad59382a4..e9b81c3de8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h @@ -10,6 +10,7 @@ #ifndef _LIBCPP___CHRONO_FORMATTER_H #define _LIBCPP___CHRONO_FORMATTER_H +#include <__algorithm/ranges_copy.h> #include <__chrono/calendar.h> #include <__chrono/concepts.h> #include <__chrono/convert_to_tm.h> @@ -17,12 +18,14 @@ #include <__chrono/duration.h> #include <__chrono/file_clock.h> #include <__chrono/hh_mm_ss.h> +#include <__chrono/local_info.h> #include <__chrono/month.h> #include <__chrono/month_weekday.h> #include <__chrono/monthday.h> #include <__chrono/ostream.h> #include <__chrono/parser_std_format_spec.h> #include <__chrono/statically_widen.h> +#include <__chrono/sys_info.h> #include <__chrono/system_clock.h> #include <__chrono/time_point.h> #include <__chrono/weekday.h> @@ -79,12 +82,15 @@ namespace __formatter { // small). Therefore a duration uses its own conversion. template <class _CharT, class _Rep, class _Period> _LIBCPP_HIDE_FROM_ABI void -__format_sub_seconds(const chrono::duration<_Rep, _Period>& __value, basic_stringstream<_CharT>& __sstr) { +__format_sub_seconds(basic_stringstream<_CharT>& __sstr, const chrono::duration<_Rep, _Period>& __value) { __sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point(); using __duration = chrono::duration<_Rep, _Period>; auto __fraction = __value - chrono::duration_cast<chrono::seconds>(__value); + // Converts a negative fraction to its positive value. + if (__value < chrono::seconds{0} && __fraction != __duration{0}) + __fraction += chrono::seconds{1}; if constexpr (chrono::treat_as_floating_point_v<_Rep>) // When the floating-point value has digits itself they are ignored based // on the wording in [tab:time.format.spec] @@ -110,13 +116,13 @@ __format_sub_seconds(const chrono::duration<_Rep, _Period>& __value, basic_strin } template <class _CharT, __is_time_point _Tp> -_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_stringstream<_CharT>& __sstr) { - __formatter::__format_sub_seconds(__value.time_since_epoch(), __sstr); +_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(basic_stringstream<_CharT>& __sstr, const _Tp& __value) { + __formatter::__format_sub_seconds(__sstr, __value.time_since_epoch()); } template <class _CharT, class _Duration> _LIBCPP_HIDE_FROM_ABI void -__format_sub_seconds(const chrono::hh_mm_ss<_Duration>& __value, basic_stringstream<_CharT>& __sstr) { +__format_sub_seconds(basic_stringstream<_CharT>& __sstr, const chrono::hh_mm_ss<_Duration>& __value) { __sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point(); if constexpr (chrono::treat_as_floating_point_v<typename _Duration::rep>) std::format_to(std::ostreambuf_iterator<_CharT>{__sstr}, @@ -143,7 +149,7 @@ consteval bool __use_fraction() { } template <class _CharT> -_LIBCPP_HIDE_FROM_ABI void __format_year(int __year, basic_stringstream<_CharT>& __sstr) { +_LIBCPP_HIDE_FROM_ABI void __format_year(basic_stringstream<_CharT>& __sstr, int __year) { if (__year < 0) { __sstr << _CharT('-'); __year = -__year; @@ -159,7 +165,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_year(int __year, basic_stringstream<_CharT>& } template <class _CharT> -_LIBCPP_HIDE_FROM_ABI void __format_century(int __year, basic_stringstream<_CharT>& __sstr) { +_LIBCPP_HIDE_FROM_ABI void __format_century(basic_stringstream<_CharT>& __sstr, int __year) { // TODO FMT Write an issue // [tab:time.format.spec] // %C The year divided by 100 using floored division. If the result is a @@ -170,10 +176,51 @@ _LIBCPP_HIDE_FROM_ABI void __format_century(int __year, basic_stringstream<_Char __sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02}"), __century); } +// Implements the %z format specifier according to [tab:time.format.spec], where +// '__modifier' signals %Oz or %Ez were used. (Both modifiers behave the same, +// so there is no need to distinguish between them.) +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI void +__format_zone_offset(basic_stringstream<_CharT>& __sstr, chrono::seconds __offset, bool __modifier) { + if (__offset < 0s) { + __sstr << _CharT('-'); + __offset = -__offset; + } else { + __sstr << _CharT('+'); + } + + chrono::hh_mm_ss __hms{__offset}; + std::ostreambuf_iterator<_CharT> __out_it{__sstr}; + // Note HMS does not allow formatting hours > 23, but the offset is not limited to 24H. + std::format_to(__out_it, _LIBCPP_STATICALLY_WIDEN(_CharT, "{:02}"), __hms.hours().count()); + if (__modifier) + __sstr << _CharT(':'); + std::format_to(__out_it, _LIBCPP_STATICALLY_WIDEN(_CharT, "{:02}"), __hms.minutes().count()); +} + +// Helper to store the time zone information needed for formatting. +struct _LIBCPP_HIDE_FROM_ABI __time_zone { + // Typically these abbreviations are short and fit in the string's internal + // buffer. + string __abbrev; + chrono::seconds __offset; +}; + +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI __time_zone __convert_to_time_zone([[maybe_unused]] const _Tp& __value) { +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + if constexpr (same_as<_Tp, chrono::sys_info>) + return {__value.abbrev, __value.offset}; + else +# endif + return {"UTC", chrono::seconds{0}}; +} + template <class _CharT, class _Tp> _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs( - const _Tp& __value, basic_stringstream<_CharT>& __sstr, basic_string_view<_CharT> __chrono_specs) { + basic_stringstream<_CharT>& __sstr, const _Tp& __value, basic_string_view<_CharT> __chrono_specs) { tm __t = std::__convert_to_tm<tm>(__value); + __time_zone __z = __formatter::__convert_to_time_zone(__value); const auto& __facet = std::use_facet<time_put<_CharT>>(__sstr.getloc()); for (auto __it = __chrono_specs.begin(); __it != __chrono_specs.end(); ++__it) { if (*__it == _CharT('%')) { @@ -196,7 +243,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs( // strftime's output is only defined in the range [00, 99]. int __year = __t.tm_year + 1900; if (__year < 1000 || __year > 9999) - __formatter::__format_century(__year, __sstr); + __formatter::__format_century(__sstr, __year); else __facet.put( {__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1)); @@ -242,7 +289,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs( __facet.put( {__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1)); if constexpr (__use_fraction<_Tp>()) - __formatter::__format_sub_seconds(__value, __sstr); + __formatter::__format_sub_seconds(__sstr, __value); break; // Unlike time_put and strftime the formatting library requires %Y @@ -283,22 +330,24 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs( // Depending on the platform's libc the range of supported years is // limited. Intead of of testing all conditions use the internal // implementation unconditionally. - __formatter::__format_year(__t.tm_year + 1900, __sstr); + __formatter::__format_year(__sstr, __t.tm_year + 1900); break; - case _CharT('F'): { - int __year = __t.tm_year + 1900; - if (__year < 1000) { - __formatter::__format_year(__year, __sstr); - __sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "-{:02}-{:02}"), __t.tm_mon + 1, __t.tm_mday); - } else - __facet.put( - {__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1)); - } break; + case _CharT('F'): + // Depending on the platform's libc the range of supported years is + // limited. Instead of testing all conditions use the internal + // implementation unconditionally. + __formatter::__format_year(__sstr, __t.tm_year + 1900); + __sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "-{:02}-{:02}"), __t.tm_mon + 1, __t.tm_mday); + break; + + case _CharT('z'): + __formatter::__format_zone_offset(__sstr, __z.__offset, false); + break; case _CharT('Z'): - // TODO FMT Add proper timezone support. - __sstr << _LIBCPP_STATICALLY_WIDEN(_CharT, "UTC"); + // __abbrev is always a char so the copy may convert. + ranges::copy(__z.__abbrev, std::ostreambuf_iterator<_CharT>{__sstr}); break; case _CharT('O'): @@ -310,13 +359,19 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs( ++__it; __facet.put( {__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1)); - __formatter::__format_sub_seconds(__value, __sstr); + __formatter::__format_sub_seconds(__sstr, __value); break; } } + + // Oz produces the same output as Ez below. [[fallthrough]]; case _CharT('E'): ++__it; + if (*__it == 'z') { + __formatter::__format_zone_offset(__sstr, __z.__offset, true); + break; + } [[fallthrough]]; default: __facet.put( @@ -365,6 +420,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) { return __value.weekday().ok(); else if constexpr (__is_hh_mm_ss<_Tp>) return true; +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + else if constexpr (same_as<_Tp, chrono::sys_info>) + return true; + else if constexpr (same_as<_Tp, chrono::local_info>) + return true; +# endif else static_assert(sizeof(_Tp) == 0, "Add the missing type specialization"); } @@ -405,6 +466,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) { return __value.weekday().ok(); else if constexpr (__is_hh_mm_ss<_Tp>) return true; +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + else if constexpr (same_as<_Tp, chrono::sys_info>) + return true; + else if constexpr (same_as<_Tp, chrono::local_info>) + return true; +# endif else static_assert(sizeof(_Tp) == 0, "Add the missing type specialization"); } @@ -445,6 +512,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) { return __value.ok(); else if constexpr (__is_hh_mm_ss<_Tp>) return true; +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + else if constexpr (same_as<_Tp, chrono::sys_info>) + return true; + else if constexpr (same_as<_Tp, chrono::local_info>) + return true; +# endif else static_assert(sizeof(_Tp) == 0, "Add the missing type specialization"); } @@ -485,6 +558,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) { return __value.month().ok(); else if constexpr (__is_hh_mm_ss<_Tp>) return true; +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + else if constexpr (same_as<_Tp, chrono::sys_info>) + return true; + else if constexpr (same_as<_Tp, chrono::local_info>) + return true; +# endif else static_assert(sizeof(_Tp) == 0, "Add the missing type specialization"); } @@ -512,7 +591,7 @@ __format_chrono(const _Tp& __value, if constexpr (chrono::__is_duration<_Tp>::value) { if (__value < __value.zero()) __sstr << _CharT('-'); - __formatter::__format_chrono_using_chrono_specs(chrono::abs(__value), __sstr, __chrono_specs); + __formatter::__format_chrono_using_chrono_specs(__sstr, chrono::abs(__value), __chrono_specs); // TODO FMT When keeping the precision it will truncate the string. // Note that the behaviour what the precision does isn't specified. __specs.__precision_ = -1; @@ -556,7 +635,7 @@ __format_chrono(const _Tp& __value, __sstr << _CharT('-'); } - __formatter::__format_chrono_using_chrono_specs(__value, __sstr, __chrono_specs); + __formatter::__format_chrono_using_chrono_specs(__sstr, __value, __chrono_specs); } } @@ -814,6 +893,31 @@ public: return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time); } }; + +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) +template <__fmt_char_type _CharT> +struct formatter<chrono::sys_info, _CharT> : public __formatter_chrono<_CharT> { +public: + using _Base = __formatter_chrono<_CharT>; + + template <class _ParseContext> + _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) { + return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time_zone); + } +}; + +template <__fmt_char_type _CharT> +struct formatter<chrono::local_info, _CharT> : public __formatter_chrono<_CharT> { +public: + using _Base = __formatter_chrono<_CharT>; + + template <class _ParseContext> + _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) { + return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags{}); + } +}; +# endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + #endif // if _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/leap_second.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/leap_second.h new file mode 100644 index 0000000000..1a0e7f3107 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/leap_second.h @@ -0,0 +1,126 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +#ifndef _LIBCPP___CHRONO_LEAP_SECOND_H +#define _LIBCPP___CHRONO_LEAP_SECOND_H + +#include <version> +// Enable the contents of the header only when libc++ was built with experimental features enabled. +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/duration.h> +# include <__chrono/system_clock.h> +# include <__chrono/time_point.h> +# include <__compare/ordering.h> +# include <__compare/three_way_comparable.h> +# include <__config> +# include <__utility/private_constructor_tag.h> + +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +# if _LIBCPP_STD_VER >= 20 + +namespace chrono { + +class leap_second { +public: + [[nodiscard]] + _LIBCPP_HIDE_FROM_ABI explicit constexpr leap_second(__private_constructor_tag, sys_seconds __date, seconds __value) + : __date_(__date), __value_(__value) {} + + _LIBCPP_HIDE_FROM_ABI leap_second(const leap_second&) = default; + _LIBCPP_HIDE_FROM_ABI leap_second& operator=(const leap_second&) = default; + + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI constexpr sys_seconds date() const noexcept { return __date_; } + + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI constexpr seconds value() const noexcept { return __value_; } + +private: + sys_seconds __date_; + seconds __value_; +}; + +_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const leap_second& __x, const leap_second& __y) { + return __x.date() == __y.date(); +} + +_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const leap_second& __x, const leap_second& __y) { + return __x.date() <=> __y.date(); +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const leap_second& __x, const sys_time<_Duration>& __y) { + return __x.date() == __y; +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const leap_second& __x, const sys_time<_Duration>& __y) { + return __x.date() < __y; +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const sys_time<_Duration>& __x, const leap_second& __y) { + return __x < __y.date(); +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const leap_second& __x, const sys_time<_Duration>& __y) { + return __y < __x; +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const sys_time<_Duration>& __x, const leap_second& __y) { + return __y < __x; +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const leap_second& __x, const sys_time<_Duration>& __y) { + return !(__y < __x); +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const sys_time<_Duration>& __x, const leap_second& __y) { + return !(__y < __x); +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const leap_second& __x, const sys_time<_Duration>& __y) { + return !(__x < __y); +} + +template <class _Duration> +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const sys_time<_Duration>& __x, const leap_second& __y) { + return !(__x < __y); +} + +# ifndef _LIBCPP_COMPILER_GCC +// This requirement cause a compilation loop in GCC-13 and running out of memory. +// TODO TZDB Test whether GCC-14 fixes this. +template <class _Duration> + requires three_way_comparable_with<sys_seconds, sys_time<_Duration>> +_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(const leap_second& __x, const sys_time<_Duration>& __y) { + return __x.date() <=> __y; +} +# endif + +} // namespace chrono + +# endif //_LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +#endif // _LIBCPP___CHRONO_LEAP_SECOND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/local_info.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/local_info.h new file mode 100644 index 0000000000..cfe1448904 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/local_info.h @@ -0,0 +1,50 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +#ifndef _LIBCPP___CHRONO_LOCAL_INFO_H +#define _LIBCPP___CHRONO_LOCAL_INFO_H + +#include <version> +// Enable the contents of the header only when libc++ was built with experimental features enabled. +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/sys_info.h> +# include <__config> + +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +# if _LIBCPP_STD_VER >= 20 + +namespace chrono { + +struct local_info { + static constexpr int unique = 0; + static constexpr int nonexistent = 1; + static constexpr int ambiguous = 2; + + int result; + sys_info first; + sys_info second; +}; + +} // namespace chrono + +# endif // _LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +#endif // _LIBCPP___CHRONO_LOCAL_INFO_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h index b687ef8059..bb0341bc3e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h @@ -15,10 +15,12 @@ #include <__chrono/duration.h> #include <__chrono/file_clock.h> #include <__chrono/hh_mm_ss.h> +#include <__chrono/local_info.h> #include <__chrono/month.h> #include <__chrono/month_weekday.h> #include <__chrono/monthday.h> #include <__chrono/statically_widen.h> +#include <__chrono/sys_info.h> #include <__chrono/system_clock.h> #include <__chrono/weekday.h> #include <__chrono/year.h> @@ -28,7 +30,7 @@ #include <__concepts/same_as.h> #include <__config> #include <__format/format_functions.h> -#include <ostream> +#include <__fwd/ostream.h> #include <ratio> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -262,6 +264,46 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const hh_mm_ss<_Duration> __hms return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%T}"), __hms); } +# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_info& __info) { + // __info.abbrev is always std::basic_string<char>. + // Since these strings typically are short the conversion should be cheap. + std::basic_string<_CharT> __abbrev{__info.abbrev.begin(), __info.abbrev.end()}; + return __os << std::format( + _LIBCPP_STATICALLY_WIDEN(_CharT, "[{:%F %T}, {:%F %T}) {:%T} {:%Q%q} \"{}\""), + __info.begin, + __info.end, + hh_mm_ss{__info.offset}, + __info.save, + __abbrev); +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const local_info& __info) { + auto __result = [&]() -> basic_string<_CharT> { + switch (__info.result) { + case local_info::unique: + return _LIBCPP_STATICALLY_WIDEN(_CharT, "unique"); + case local_info::nonexistent: + return _LIBCPP_STATICALLY_WIDEN(_CharT, "non-existent"); + case local_info::ambiguous: + return _LIBCPP_STATICALLY_WIDEN(_CharT, "ambiguous"); + + default: + return std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "unspecified result ({})"), __info.result); + }; + }; + + return __os << std::format( + _LIBCPP_STATICALLY_WIDEN(_CharT, "{}: {{{}, {}}}"), __result(), __info.first, __info.second); +} + +# endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + } // namespace chrono #endif // if _LIBCPP_STD_VER >= 20 diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/sys_info.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/sys_info.h new file mode 100644 index 0000000000..11536cbde3 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/sys_info.h @@ -0,0 +1,51 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +#ifndef _LIBCPP___CHRONO_SYS_INFO_H +#define _LIBCPP___CHRONO_SYS_INFO_H + +#include <version> +// Enable the contents of the header only when libc++ was built with experimental features enabled. +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/duration.h> +# include <__chrono/system_clock.h> +# include <__chrono/time_point.h> +# include <__config> +# include <string> + +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +# if _LIBCPP_STD_VER >= 20 + +namespace chrono { + +struct sys_info { + sys_seconds begin; + sys_seconds end; + seconds offset; + minutes save; + string abbrev; +}; + +} // namespace chrono + +# endif // _LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +#endif // _LIBCPP___CHRONO_SYS_INFO_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h index e65253ddb9..aaf0b098f2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h @@ -78,7 +78,7 @@ public: template <class _Clock, class _Duration1, class _Duration2> struct _LIBCPP_TEMPLATE_VIS - common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> > { +common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> > { typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type; }; @@ -92,25 +92,22 @@ time_point_cast(const time_point<_Clock, _Duration>& __t) { #if _LIBCPP_STD_VER >= 17 template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration> -floor(const time_point<_Clock, _Duration>& __t) { +inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> floor(const time_point<_Clock, _Duration>& __t) { return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())}; } template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration> -ceil(const time_point<_Clock, _Duration>& __t) { +inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> ceil(const time_point<_Clock, _Duration>& __t) { return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())}; } template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration> -round(const time_point<_Clock, _Duration>& __t) { +inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> round(const time_point<_Clock, _Duration>& __t) { return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())}; } template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) { +inline _LIBCPP_HIDE_FROM_ABI constexpr duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) { return __d >= __d.zero() ? +__d : -__d; } #endif // _LIBCPP_STD_VER >= 17 @@ -180,9 +177,9 @@ operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock // time_point operator+(time_point x, duration y); template <class _Clock, class _Duration1, class _Rep2, class _Period2> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> - operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> +operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr; return _Tr(__lhs.time_since_epoch() + __rhs); } @@ -190,18 +187,18 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 // time_point operator+(duration x, time_point y); template <class _Rep1, class _Period1, class _Clock, class _Duration2> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type> - operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type> +operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) { return __rhs + __lhs; } // time_point operator-(time_point x, duration y); template <class _Clock, class _Duration1, class _Rep2, class _Period2> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> - operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> +operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) { typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret; return _Ret(__lhs.time_since_epoch() - __rhs); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone.h index 7d97327a6c..de11dac1ee 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone.h @@ -14,11 +14,18 @@ #include <version> // Enable the contents of the header only when libc++ was built with experimental features enabled. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) - +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/calendar.h> +# include <__chrono/duration.h> +# include <__chrono/exception.h> +# include <__chrono/local_info.h> +# include <__chrono/sys_info.h> +# include <__chrono/system_clock.h> # include <__compare/strong_order.h> # include <__config> # include <__memory/unique_ptr.h> +# include <__type_traits/common_type.h> # include <string_view> # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -35,6 +42,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace chrono { +enum class choose { earliest, latest }; + class _LIBCPP_AVAILABILITY_TZDB time_zone { _LIBCPP_HIDE_FROM_ABI time_zone() = default; @@ -53,21 +62,108 @@ public: _LIBCPP_HIDE_FROM_ABI time_zone(time_zone&&) = default; _LIBCPP_HIDE_FROM_ABI time_zone& operator=(time_zone&&) = default; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI string_view name() const noexcept { return __name(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_view name() const noexcept { return __name(); } + + template <class _Duration> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_info get_info(const sys_time<_Duration>& __time) const { + return __get_info(chrono::time_point_cast<seconds>(__time)); + } + + template <class _Duration> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI local_info get_info(const local_time<_Duration>& __time) const { + return __get_info(chrono::time_point_cast<seconds>(__time)); + } + + // We don't apply nodiscard here since this function throws on many inputs, + // so it could be used as a validation. + template <class _Duration> + _LIBCPP_HIDE_FROM_ABI sys_time<common_type_t<_Duration, seconds>> to_sys(const local_time<_Duration>& __time) const { + local_info __info = get_info(__time); + switch (__info.result) { + case local_info::unique: + return sys_time<common_type_t<_Duration, seconds>>{__time.time_since_epoch() - __info.first.offset}; + + case local_info::nonexistent: + chrono::__throw_nonexistent_local_time(__time, __info); + + case local_info::ambiguous: + chrono::__throw_ambiguous_local_time(__time, __info); + } + + // TODO TZDB The Standard does not specify anything in these cases. + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.result != -1, "cannot convert the local time; it would be before the minimum system clock value"); + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.result != -2, "cannot convert the local time; it would be after the maximum system clock value"); + + return {}; + } + + template <class _Duration> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_time<common_type_t<_Duration, seconds>> + to_sys(const local_time<_Duration>& __time, choose __z) const { + local_info __info = get_info(__time); + switch (__info.result) { + case local_info::unique: + case local_info::nonexistent: // first and second are the same + return sys_time<common_type_t<_Duration, seconds>>{__time.time_since_epoch() - __info.first.offset}; + + case local_info::ambiguous: + switch (__z) { + case choose::earliest: + return sys_time<common_type_t<_Duration, seconds>>{__time.time_since_epoch() - __info.first.offset}; + + case choose::latest: + return sys_time<common_type_t<_Duration, seconds>>{__time.time_since_epoch() - __info.second.offset}; + + // Note a value out of bounds is not specified. + } + } + + // TODO TZDB The standard does not specify anything in these cases. + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.result != -1, "cannot convert the local time; it would be before the minimum system clock value"); + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.result != -2, "cannot convert the local time; it would be after the maximum system clock value"); + + return {}; + } + + template <class _Duration> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI local_time<common_type_t<_Duration, seconds>> + to_local(const sys_time<_Duration>& __time) const { + using _Dp = common_type_t<_Duration, seconds>; + + sys_info __info = get_info(__time); + + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.offset >= chrono::seconds{0} || __time.time_since_epoch() >= _Dp::min() - __info.offset, + "cannot convert the system time; it would be before the minimum local clock value"); + + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __info.offset <= chrono::seconds{0} || __time.time_since_epoch() <= _Dp::max() - __info.offset, + "cannot convert the system time; it would be after the maximum local clock value"); + + return local_time<_Dp>{__time.time_since_epoch() + __info.offset}; + } [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const __impl& __implementation() const noexcept { return *__impl_; } private: [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI string_view __name() const noexcept; + + [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI sys_info __get_info(sys_seconds __time) const; + [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI local_info __get_info(local_seconds __time) const; + unique_ptr<__impl> __impl_; }; -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline bool +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline bool operator==(const time_zone& __x, const time_zone& __y) noexcept { return __x.name() == __y.name(); } -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline strong_ordering +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline strong_ordering operator<=>(const time_zone& __x, const time_zone& __y) noexcept { return __x.name() <=> __y.name(); } @@ -81,6 +177,6 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) #endif // _LIBCPP___CHRONO_TIME_ZONE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone_link.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone_link.h index 17e915d267..b2d365c5fd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone_link.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_zone_link.h @@ -14,10 +14,11 @@ #include <version> // Enable the contents of the header only when libc++ was built with experimental features enabled. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) # include <__compare/strong_order.h> # include <__config> +# include <__utility/private_constructor_tag.h> # include <string> # include <string_view> @@ -37,16 +38,15 @@ namespace chrono { class time_zone_link { public: - struct __constructor_tag; - _LIBCPP_NODISCARD_EXT - _LIBCPP_HIDE_FROM_ABI explicit time_zone_link(__constructor_tag&&, string_view __name, string_view __target) + [[nodiscard]] + _LIBCPP_HIDE_FROM_ABI explicit time_zone_link(__private_constructor_tag, string_view __name, string_view __target) : __name_{__name}, __target_{__target} {} _LIBCPP_HIDE_FROM_ABI time_zone_link(time_zone_link&&) = default; _LIBCPP_HIDE_FROM_ABI time_zone_link& operator=(time_zone_link&&) = default; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI string_view name() const noexcept { return __name_; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI string_view target() const noexcept { return __target_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_view name() const noexcept { return __name_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_view target() const noexcept { return __target_; } private: string __name_; @@ -56,12 +56,12 @@ private: string __target_; }; -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline bool +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline bool operator==(const time_zone_link& __x, const time_zone_link& __y) noexcept { return __x.name() == __y.name(); } -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline strong_ordering +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline strong_ordering operator<=>(const time_zone_link& __x, const time_zone_link& __y) noexcept { return __x.name() <=> __y.name(); } @@ -74,6 +74,6 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) #endif // _LIBCPP___CHRONO_TIME_ZONE_LINK_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb.h index 582172e5df..f731f8c318 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb.h @@ -14,8 +14,10 @@ #include <version> // Enable the contents of the header only when libc++ was built with experimental features enabled. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) +# include <__algorithm/ranges_lower_bound.h> +# include <__chrono/leap_second.h> # include <__chrono/time_zone.h> # include <__chrono/time_zone_link.h> # include <__config> @@ -40,6 +42,42 @@ struct tzdb { string version; vector<time_zone> zones; vector<time_zone_link> links; + + vector<leap_second> leap_seconds; + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const time_zone* __locate_zone(string_view __name) const { + if (const time_zone* __result = __find_in_zone(__name)) + return __result; + + if (auto __it = ranges::lower_bound(links, __name, {}, &time_zone_link::name); + __it != links.end() && __it->name() == __name) + if (const time_zone* __result = __find_in_zone(__it->target())) + return __result; + + return nullptr; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const time_zone* locate_zone(string_view __name) const { + if (const time_zone* __result = __locate_zone(__name)) + return __result; + + std::__throw_runtime_error("tzdb: requested time zone not found"); + } + + [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI const time_zone* current_zone() const { + return __current_zone(); + } + +private: + _LIBCPP_HIDE_FROM_ABI const time_zone* __find_in_zone(string_view __name) const noexcept { + if (auto __it = ranges::lower_bound(zones, __name, {}, &time_zone::name); + __it != zones.end() && __it->name() == __name) + return std::addressof(*__it); + + return nullptr; + } + + [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const time_zone* __current_zone() const; }; } // namespace chrono @@ -51,6 +89,6 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) #endif // _LIBCPP___CHRONO_TZDB_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb_list.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb_list.h index e8aaf31e36..aeef4fe1ab 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb_list.h +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/tzdb_list.h @@ -14,9 +14,9 @@ #include <version> // Enable the contents of the header only when libc++ was built with experimental features enabled. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) -# include <__availability> +# include <__chrono/time_zone.h> # include <__chrono/tzdb.h> # include <__config> # include <__fwd/string.h> @@ -52,15 +52,15 @@ public: using const_iterator = forward_list<tzdb>::const_iterator; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI const tzdb& front() const noexcept { return __front(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const tzdb& front() const noexcept { return __front(); } _LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) { return __erase_after(__p); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return __begin(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return __end(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return __begin(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return __end(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return __cbegin(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return __cend(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return __cbegin(); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return __cend(); } [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __impl& __implementation() { return *__impl_; } @@ -78,15 +78,23 @@ private: __impl* __impl_; }; -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list(); +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list(); -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const tzdb& get_tzdb() { +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const tzdb& get_tzdb() { return get_tzdb_list().front(); } +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const time_zone* locate_zone(string_view __name) { + return get_tzdb().locate_zone(__name); +} + +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const time_zone* current_zone() { + return get_tzdb().current_zone(); +} + _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb(); -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version(); +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version(); } // namespace chrono @@ -95,6 +103,6 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string _LIBCPP_END_NAMESPACE_STD -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB) +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) #endif // _LIBCPP___CHRONO_TZDB_LIST_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/zoned_time.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/zoned_time.h new file mode 100644 index 0000000000..c6084426ad --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/zoned_time.h @@ -0,0 +1,55 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +#ifndef _LIBCPP___CHRONO_ZONED_TIME_H +#define _LIBCPP___CHRONO_ZONED_TIME_H + +#include <version> +// Enable the contents of the header only when libc++ was built with experimental features enabled. +#if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +# include <__chrono/time_zone.h> +# include <__chrono/tzdb_list.h> +# include <__config> +# include <__fwd/string_view.h> + +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \ + !defined(_LIBCPP_HAS_NO_LOCALIZATION) + +namespace chrono { + +template <class> +struct zoned_traits {}; + +template <> +struct zoned_traits<const time_zone*> { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static const time_zone* default_zone() { return chrono::locate_zone("UTC"); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static const time_zone* locate_zone(string_view __name) { + return chrono::locate_zone(__name); + } +}; + +} // namespace chrono + +# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) + // && !defined(_LIBCPP_HAS_NO_LOCALIZATION) + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) + +#endif // _LIBCPP___CHRONO_ZONED_TIME_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h b/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h index 6420d1362d..e48ce49799 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h +++ b/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h @@ -25,12 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // [expos.only.func] -// TODO MODULES restore the lamba to match the Standard. -// See https://github.com/llvm/llvm-project/issues/57222 -//_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way = -// []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u) -template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI constexpr auto __synth_three_way(const _Tp& __t, const _Up& __u) +_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way = []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u) requires requires { { __t < __u } -> __boolean_testable; { __u < __t } -> __boolean_testable; @@ -45,7 +40,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __synth_three_way(const _Tp& __t, const _Up return weak_ordering::greater; return weak_ordering::equivalent; } -} +}; template <class _Tp, class _Up = _Tp> using __synth_three_way_result = decltype(std::__synth_three_way(std::declval<_Tp&>(), std::declval<_Up&>())); diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config index b5c2fb4f21..8ce18c110a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config +++ b/contrib/libs/cxxsupp/libcxx/include/__config @@ -11,64 +11,17 @@ #define _LIBCPP___CONFIG #include <__config_site> +#include <__configuration/abi.h> +#include <__configuration/availability.h> +#include <__configuration/compiler.h> +#include <__configuration/platform.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER # pragma GCC system_header #endif -#if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) -# pragma clang deprecated( \ - _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES, \ - "_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES is deprecated in LLVM 18 and will be removed in LLVM 19") -#endif -#if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) -# pragma clang deprecated( \ - _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES, \ - "_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES is deprecated in LLVM 18 and will be removed in LLVM 19") -#endif - -#if defined(__apple_build_version__) -// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403) -# define _LIBCPP_COMPILER_CLANG_BASED -# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000) -#elif defined(__clang__) -# define _LIBCPP_COMPILER_CLANG_BASED -# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) -#elif defined(__GNUC__) -# define _LIBCPP_COMPILER_GCC -# define _LIBCPP_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__) -#endif - -// Move outside #ifdef __cplusplus because this needs to work in both C and C++ headers. -#if defined(__apple_build_version__) -# define _LIBCPP_COMPILER_CLANG_BASED -# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000) -#elif defined(__clang__) -# define _LIBCPP_COMPILER_CLANG -# define _LIBCPP_COMPILER_CLANG_BASED -# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) -#elif defined(__GNUC__) -# define _LIBCPP_COMPILER_GCC -#endif - #ifdef __cplusplus -// Warn if a compiler version is used that is not supported anymore -// LLVM RELEASE Update the minimum compiler versions -# if defined(_LIBCPP_CLANG_VER) -# if _LIBCPP_CLANG_VER < 1600 -// we temporary allow old clang-s # warning "Libc++ only supports Clang 16 and later" -# endif -# elif defined(_LIBCPP_APPLE_CLANG_VER) -# if _LIBCPP_APPLE_CLANG_VER < 1500 -# warning "Libc++ only supports AppleClang 15 and later" -# endif -# elif defined(_LIBCPP_GCC_VER) -# if _LIBCPP_GCC_VER < 1300 -# warning "Libc++ only supports GCC 13 and later" -# endif -# endif - // The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html // _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM. @@ -83,175 +36,6 @@ # define _LIBCPP_FREESTANDING # endif -// NOLINTBEGIN(libcpp-cpp-version-check) -# ifndef _LIBCPP_STD_VER -# if __cplusplus <= 201103L -# define _LIBCPP_STD_VER 11 -# elif __cplusplus <= 201402L -# define _LIBCPP_STD_VER 14 -# elif __cplusplus <= 201703L -# define _LIBCPP_STD_VER 17 -# elif __cplusplus <= 202002L -# define _LIBCPP_STD_VER 20 -# elif __cplusplus <= 202302L -# define _LIBCPP_STD_VER 23 -# else -// Expected release year of the next C++ standard -# define _LIBCPP_STD_VER 26 -# endif -# endif // _LIBCPP_STD_VER -// NOLINTEND(libcpp-cpp-version-check) - -# if defined(__ELF__) -# define _LIBCPP_OBJECT_FORMAT_ELF 1 -# elif defined(__MACH__) -# define _LIBCPP_OBJECT_FORMAT_MACHO 1 -# elif defined(_WIN32) || defined(__CYGWIN__) -# define _LIBCPP_OBJECT_FORMAT_COFF 1 -# elif defined(__wasm__) -# define _LIBCPP_OBJECT_FORMAT_WASM 1 -# elif defined(_AIX) -# define _LIBCPP_OBJECT_FORMAT_XCOFF 1 -# else -// ... add new file formats here ... -# endif - -// ABI { - -# if _LIBCPP_ABI_VERSION >= 2 -// Change short string representation so that string data starts at offset 0, -// improving its alignment in some cases. -# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT -// Fix deque iterator type in order to support incomplete types. -# define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE -// Fix undefined behavior in how std::list stores its linked nodes. -# define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB -// Fix undefined behavior in how __tree stores its end and parent nodes. -# define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB -// Fix undefined behavior in how __hash_table stores its pointer types. -# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB -# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB -# define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE -// Define a key function for `bad_function_call` in the library, to centralize -// its vtable and typeinfo to libc++ rather than having all other libraries -// using that class define their own copies. -# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION -// Override the default return value of exception::what() for -// bad_function_call::what() with a string that is specific to -// bad_function_call (see http://wg21.link/LWG2233). This is an ABI break -// because it changes the vtable layout of bad_function_call. -# define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE -// Enable optimized version of __do_get_(un)signed which avoids redundant copies. -# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET -// Give reverse_iterator<T> one data member of type T, not two. -// Also, in C++17 and later, don't derive iterator types from std::iterator. -# define _LIBCPP_ABI_NO_ITERATOR_BASES -// Use the smallest possible integer type to represent the index of the variant. -// Previously libc++ used "unsigned int" exclusively. -# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION -// Unstable attempt to provide a more optimized std::function -# ifdef __EMSCRIPTEN__ -// XXX EMSCRIPTEN https://github.com/emscripten-core/emscripten/issues/11022 -// # define _LIBCPP_ABI_OPTIMIZED_FUNCTION -# else -# define _LIBCPP_ABI_OPTIMIZED_FUNCTION -# endif -// All the regex constants must be distinct and nonzero. -# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO -// Re-worked external template instantiations for std::string with a focus on -// performance and fast-path inlining. -# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION -// Enable clang::trivial_abi on std::unique_ptr. -# define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -// Enable clang::trivial_abi on std::shared_ptr and std::weak_ptr -# define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI -// std::random_device holds some state when it uses an implementation that gets -// entropy from a file (see _LIBCPP_USING_DEV_RANDOM). When switching from this -// implementation to another one on a platform that has already shipped -// std::random_device, one needs to retain the same object layout to remain ABI -// compatible. This switch removes these workarounds for platforms that don't care -// about ABI compatibility. -# define _LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT -// Don't export the legacy __basic_string_common class and its methods from the built library. -# define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON -// Don't export the legacy __vector_base_common class and its methods from the built library. -# define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON -// According to the Standard, `bitset::operator[] const` returns bool -# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL -// Fix the implementation of CityHash used for std::hash<fundamental-type>. -// This is an ABI break because `std::hash` will return a different result, -// which means that hashing the same object in translation units built against -// different versions of libc++ can return inconsistent results. This is especially -// tricky since std::hash is used in the implementation of unordered containers. -// -// The incorrect implementation of CityHash has the problem that it drops some -// bits on the floor. -# define _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION -// Remove the base 10 implementation of std::to_chars from the dylib. -// The implementation moved to the header, but we still export the symbols from -// the dylib for backwards compatibility. -# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10 -// Define std::array/std::string_view iterators to be __wrap_iters instead of raw -// pointers, which prevents people from relying on a non-portable implementation -// detail. This is especially useful because enabling bounded iterators hardening -// requires code not to make these assumptions. -# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY -# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW -# elif _LIBCPP_ABI_VERSION == 1 -# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF)) -// Enable compiling copies of now inline methods into the dylib to support -// applications compiled against older libraries. This is unnecessary with -// COFF dllexport semantics, since dllexport forces a non-inline definition -// of inline functions to be emitted anyway. Our own non-inline copy would -// conflict with the dllexport-emitted copy, so we disable it. For XCOFF, -// the linker will take issue with the symbols in the shared object if the -// weak inline methods get visibility (such as from -fvisibility-inlines-hidden), -// so disable it. -# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS -# endif -// Feature macros for disabling pre ABI v1 features. All of these options -// are deprecated. -# if defined(__FreeBSD__) && __FreeBSD__ < 14 -# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR -# endif -// For XCOFF linkers, we have problems if we see a weak hidden version of a symbol -// in user code (like you get with -fvisibility-inlines-hidden) and then a strong def -// in the library, so we need to always rely on the library version. -# if defined(_AIX) -# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION -# endif -# endif - -# if defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_ABI_VERSION >= 2 -// Define a key function for `bad_function_call` in the library, to centralize -// its vtable and typeinfo to libc++ rather than having all other libraries -// using that class define their own copies. -# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION -# endif - -// We had some bugs where we use [[no_unique_address]] together with construct_at, -// which causes UB as the call on construct_at could write to overlapping subobjects -// -// https://github.com/llvm/llvm-project/issues/70506 -// https://github.com/llvm/llvm-project/issues/70494 -// -// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions. -// The macro below is used for all classes whose ABI have changed as part of fixing these bugs. -# define _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS __attribute__((__abi_tag__("llvm18_nua"))) - -// Changes the iterator type of select containers (see below) to a bounded iterator that keeps track of whether it's -// within the bounds of the original container and asserts it on every dereference. -// -// ABI impact: changes the iterator type of the relevant containers. -// -// Supported containers: -// - `span`; -// - `string_view`; -// - `array`. -// #define _LIBCPP_ABI_BOUNDED_ITERATORS - -// } ABI - // HARDENING { // TODO(hardening): deprecate this in LLVM 19. @@ -378,26 +162,16 @@ _LIBCPP_HARDENING_MODE_DEBUG # define _LIBCPP_CXX03_LANG # endif -# ifndef __has_attribute -# define __has_attribute(__x) 0 -# endif - -# ifndef __has_builtin -# define __has_builtin(__x) 0 -# endif - +// TODO: Remove once we switch to GCC 14 # ifndef __has_extension # define __has_extension(__x) 0 # endif +// TODO: Remove once we switch to GCC 14 # ifndef __has_feature # define __has_feature(__x) 0 # endif -# ifndef __has_cpp_attribute -# define __has_cpp_attribute(__x) 0 -# endif - # ifndef __has_constexpr_builtin # define __has_constexpr_builtin(x) 0 # endif @@ -419,10 +193,6 @@ _LIBCPP_HARDENING_MODE_DEBUG # define __has_keyword(__x) !(__is_identifier(__x)) -# ifndef __has_include -# define __has_include(...) 0 -# endif - # ifndef __has_warning # define __has_warning(...) 0 # endif @@ -465,35 +235,14 @@ _LIBCPP_HARDENING_MODE_DEBUG # if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY) # define _LIBCPP_HAS_NO_INCOMPLETE_PSTL # define _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN -# define _LIBCPP_HAS_NO_INCOMPLETE_TZDB +# define _LIBCPP_HAS_NO_EXPERIMENTAL_TZDB # define _LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM # endif -// Need to detect which libc we're using if we're on Linux. -# if defined(__linux__) -# include <features.h> -# if defined(__GLIBC_PREREQ) -# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) -# else -# define _LIBCPP_GLIBC_PREREQ(a, b) 0 -# endif // defined(__GLIBC_PREREQ) -# endif // defined(__linux__) - # if defined(__MVS__) # include <features.h> // for __NATIVE_ASCII_F # endif -# ifndef __BYTE_ORDER__ -# error \ - "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform" -# endif - -# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define _LIBCPP_LITTLE_ENDIAN -# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define _LIBCPP_BIG_ENDIAN -# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - # if defined(_WIN32) # define _LIBCPP_WIN32API # define _LIBCPP_SHORT_WCHAR 1 @@ -597,27 +346,10 @@ typedef __char32_t char32_t; # endif -# if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L -# define _LIBCPP_HAS_NO_EXCEPTIONS -# endif - # define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp) # if defined(_LIBCPP_COMPILER_CLANG_BASED) -# if defined(__APPLE__) -# if defined(__i386__) || defined(__x86_64__) -// use old string layout on x86_64 and i386 -# elif defined(__arm__) -// use old string layout on arm (which does not include aarch64/arm64), except on watch ABIs -# if defined(__ARM_ARCH_7K__) && __ARM_ARCH_7K__ >= 2 -# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT -# endif -# else -# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT -# endif -# endif - // Objective-C++ features (opt-in) # if __has_feature(objc_arc) # define _LIBCPP_HAS_OBJC_ARC @@ -834,16 +566,12 @@ typedef __char32_t char32_t; # if !defined(_LIBCPP_NO_ABI_TAG) && !defined(__CUDACC__) # define _LIBCPP_HIDE_FROM_ABI \ _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \ - __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))) + __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))) # else # define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION # endif # define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION -// This macro provides a HIDE_FROM_ABI equivalent that can be applied to extern -// "C" function, as those lack mangling. -# define _LIBCPP_HIDE_FROM_ABI_C _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION - # ifdef _LIBCPP_BUILDING_LIBRARY # if _LIBCPP_ABI_VERSION > 1 # define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI @@ -855,11 +583,11 @@ typedef __char32_t char32_t; # endif // TODO: Remove this workaround once we drop support for Clang 16 -#if __has_warning("-Wc++23-extensions") -# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions") -#else -# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++2b-extensions") -#endif +# if __has_warning("-Wc++23-extensions") +# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions") +# else +# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++2b-extensions") +# endif // Clang modules take a significant compile time hit when pushing and popping diagnostics. // Since all the headers are marked as system headers in the modulemap, we can simply disable this @@ -889,10 +617,16 @@ typedef __char32_t char32_t; inline namespace _LIBCPP_ABI_NAMESPACE { # define _LIBCPP_END_NAMESPACE_STD }} _LIBCPP_POP_EXTENSION_DIAGNOSTICS +#ifdef _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE +# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD namespace filesystem { +# define _LIBCPP_END_NAMESPACE_FILESYSTEM } _LIBCPP_END_NAMESPACE_STD +#else # define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \ inline namespace __fs { namespace filesystem { # define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD +#endif + // clang-format on # if __has_attribute(__enable_if__) @@ -989,6 +723,14 @@ typedef __char32_t char32_t; # define _LIBCPP_DEPRECATED_(m) # endif +# if _LIBCPP_STD_VER < 20 +# define _LIBCPP_DEPRECATED_ATOMIC_SYNC \ + _LIBCPP_DEPRECATED_("The C++20 synchronization library has been deprecated prior to C++20. Please update to " \ + "using -std=c++20 if you need to use these facilities.") +# else +# define _LIBCPP_DEPRECATED_ATOMIC_SYNC /* nothing */ +# endif + # if !defined(_LIBCPP_CXX03_LANG) # define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED # else @@ -1078,22 +820,6 @@ typedef __char32_t char32_t; # define _LIBCPP_CONSTEXPR_SINCE_CXX23 # endif -# ifndef _LIBCPP_HAS_NO_ASAN -extern "C" _LIBCPP_EXPORTED_FROM_ABI void -__sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*); -# if !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) -extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container( - const void*, const void*, const void*, const void*, const void*, const void*); -extern "C" _LIBCPP_EXPORTED_FROM_ABI int -__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*); -# endif -# endif - -// Try to find out if RTTI is disabled. -# if !defined(__cpp_rtti) || __cpp_rtti < 199711L -# define _LIBCPP_HAS_NO_RTTI -# endif - # ifndef _LIBCPP_WEAK # define _LIBCPP_WEAK __attribute__((__weak__)) # endif @@ -1267,25 +993,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c # define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__ # endif -# if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) -# define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -# define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE -# define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS -# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -# endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES - -# if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES) -# define _LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS -# define _LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS -# define _LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR -# define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS -# endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES - -// Yandex-specific: We build our own libc++, so it has everything available -# define _LIBCPP_DISABLE_AVAILABILITY -// End of Yandex-specific - // clang-format off # define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh\")") _Pragma("push_macro(\"move\")") _Pragma("push_macro(\"erase\")") # define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh\")") _Pragma("pop_macro(\"move\")") _Pragma("pop_macro(\"erase\")") @@ -1442,7 +1149,7 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c # define _LIBCPP_USING_IF_EXISTS # endif -# if __has_cpp_attribute(nodiscard) +# if __has_cpp_attribute(__nodiscard__) # define _LIBCPP_NODISCARD [[__nodiscard__]] # else // We can't use GCC's [[gnu::warn_unused_result]] and @@ -1451,32 +1158,13 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c # define _LIBCPP_NODISCARD # endif -// _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not -// specified as such as an extension. -# if !defined(_LIBCPP_DISABLE_NODISCARD_EXT) -# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD -# else -# define _LIBCPP_NODISCARD_EXT -# endif - -# if _LIBCPP_STD_VER >= 20 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT) -# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD -# else -# define _LIBCPP_NODISCARD_AFTER_CXX17 -# endif - # if __has_attribute(__no_destroy__) # define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__)) # else # define _LIBCPP_NO_DESTROY # endif -# if !__has_builtin(__builtin_is_constant_evaluated) || (defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER < 900) || \ - __CUDACC_VER_MAJOR__ == 10 -# define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED -# endif - -# if __has_attribute(__diagnose_if__) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS) +# if __has_attribute(__diagnose_if__) # define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((__diagnose_if__(__VA_ARGS__, "warning"))) # else # define _LIBCPP_DIAGNOSE_WARNING(...) @@ -1497,12 +1185,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c # define _LIBCPP_LIFETIMEBOUND # endif -# if defined(_LIBCPP_COMPILER_CLANG_BASED) -# define _LIBCPP_REINITIALIZES_OBJECT [[clang::reinitializes]] -# else -# define _LIBCPP_REINITIALIZES_OBJECT -# endif - # if __has_attribute(__nodebug__) # define _LIBCPP_NODEBUG __attribute__((__nodebug__)) # else diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_epilogue.h b/contrib/libs/cxxsupp/libcxx/include/__config_epilogue.h index bdc229a325..f5e3bca01b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config_epilogue.h +++ b/contrib/libs/cxxsupp/libcxx/include/__config_epilogue.h @@ -1,5 +1,15 @@ #pragma once +# if defined(_LIBCPP_COMPILER_CLANG_BASED) +# define _LIBCPP_REINITIALIZES_OBJECT [[clang::reinitializes]] +# else +# define _LIBCPP_REINITIALIZES_OBJECT +# endif + +# if !__has_builtin(__builtin_is_constant_evaluated) || __CUDACC_VER_MAJOR__ == 10 +# define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED +# endif + #if defined(__CUDACC__) #undef _LIBCPP_DECLSPEC_EMPTY_BASES #define _LIBCPP_DECLSPEC_EMPTY_BASES diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_site b/contrib/libs/cxxsupp/libcxx/include/__config_site index 41a3962dd4..ecd7ae4d27 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config_site +++ b/contrib/libs/cxxsupp/libcxx/include/__config_site @@ -3,7 +3,7 @@ #define _LIBCPP_ABI_VERSION 1 #define _LIBCPP_ABI_NAMESPACE __y1 -#define _LIBCPP_PSTL_CPU_BACKEND_THREAD +#define _LIBCPP_PSTL_BACKEND_STD_THREAD #ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS # define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1 @@ -30,6 +30,7 @@ #define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS #define _LIBCPP_NO_AUTO_LINK #define _LIBCPP_DISABLE_DEPRECATION_WARNINGS +#define _LIBCPP_DISABLE_AVAILABILITY // should be removed in https://st.yandex-team.ru/IGNIETFERRO-1957 #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR @@ -40,6 +41,7 @@ // should be removed in https://st.yandex-team.ru/IGNIETFERRO-1955 #define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS #define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION +#define _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST // should be removed in https://st.yandex-team.ru/IGNIETFERRO-1956 #define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_site.in b/contrib/libs/cxxsupp/libcxx/include/__config_site.in index 7c002c5bfc..67022146c9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config_site.in +++ b/contrib/libs/cxxsupp/libcxx/include/__config_site.in @@ -26,15 +26,16 @@ #cmakedefine _LIBCPP_HAS_NO_FILESYSTEM #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION +#cmakedefine _LIBCPP_HAS_NO_UNICODE #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS #cmakedefine _LIBCPP_HAS_NO_STD_MODULES #cmakedefine _LIBCPP_HAS_NO_TIME_ZONE_DATABASE #cmakedefine _LIBCPP_INSTRUMENTED_WITH_ASAN // PSTL backends -#cmakedefine _LIBCPP_PSTL_CPU_BACKEND_SERIAL -#cmakedefine _LIBCPP_PSTL_CPU_BACKEND_THREAD -#cmakedefine _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH +#cmakedefine _LIBCPP_PSTL_BACKEND_SERIAL +#cmakedefine _LIBCPP_PSTL_BACKEND_STD_THREAD +#cmakedefine _LIBCPP_PSTL_BACKEND_LIBDISPATCH // Hardening. #cmakedefine _LIBCPP_HARDENING_MODE_DEFAULT @_LIBCPP_HARDENING_MODE_DEFAULT@ diff --git a/contrib/libs/cxxsupp/libcxx/include/__configuration/abi.h b/contrib/libs/cxxsupp/libcxx/include/__configuration/abi.h new file mode 100644 index 0000000000..c31fbbae1a --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__configuration/abi.h @@ -0,0 +1,153 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___CONFIGURATION_ABI_H +#define _LIBCPP___CONFIGURATION_ABI_H + +#include <__config_site> +#include <__configuration/compiler.h> +#include <__configuration/platform.h> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +# pragma GCC system_header +#endif + +#if _LIBCPP_ABI_VERSION >= 2 +// Change short string representation so that string data starts at offset 0, +// improving its alignment in some cases. +# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT +// Fix deque iterator type in order to support incomplete types. +# define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE +// Fix undefined behavior in how std::list stores its linked nodes. +# define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB +// Fix undefined behavior in how __tree stores its end and parent nodes. +# define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB +// Fix undefined behavior in how __hash_table stores its pointer types. +# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB +# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB +# define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE +// Override the default return value of exception::what() for bad_function_call::what() +// with a string that is specific to bad_function_call (see http://wg21.link/LWG2233). +// This is an ABI break on platforms that sign and authenticate vtable function pointers +// because it changes the mangling of the virtual function located in the vtable, which +// changes how it gets signed. +# define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE +// Enable optimized version of __do_get_(un)signed which avoids redundant copies. +# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET +// Give reverse_iterator<T> one data member of type T, not two. +// Also, in C++17 and later, don't derive iterator types from std::iterator. +# define _LIBCPP_ABI_NO_ITERATOR_BASES +// Use the smallest possible integer type to represent the index of the variant. +// Previously libc++ used "unsigned int" exclusively. +# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION +// Unstable attempt to provide a more optimized std::function +# ifdef __EMSCRIPTEN__ +// XXX EMSCRIPTEN https://github.com/emscripten-core/emscripten/issues/11022 +// # define _LIBCPP_ABI_OPTIMIZED_FUNCTION +# else +# define _LIBCPP_ABI_OPTIMIZED_FUNCTION +# endif +// All the regex constants must be distinct and nonzero. +# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO +// Re-worked external template instantiations for std::string with a focus on +// performance and fast-path inlining. +# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION +// Enable clang::trivial_abi on std::unique_ptr. +# define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI +// Enable clang::trivial_abi on std::shared_ptr and std::weak_ptr +# define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI +// std::random_device holds some state when it uses an implementation that gets +// entropy from a file (see _LIBCPP_USING_DEV_RANDOM). When switching from this +// implementation to another one on a platform that has already shipped +// std::random_device, one needs to retain the same object layout to remain ABI +// compatible. This switch removes these workarounds for platforms that don't care +// about ABI compatibility. +# define _LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT +// Don't export the legacy __basic_string_common class and its methods from the built library. +# define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON +// Don't export the legacy __vector_base_common class and its methods from the built library. +# define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON +// According to the Standard, `bitset::operator[] const` returns bool +# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL +// Fix the implementation of CityHash used for std::hash<fundamental-type>. +// This is an ABI break because `std::hash` will return a different result, +// which means that hashing the same object in translation units built against +// different versions of libc++ can return inconsistent results. This is especially +// tricky since std::hash is used in the implementation of unordered containers. +// +// The incorrect implementation of CityHash has the problem that it drops some +// bits on the floor. +# define _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION +// Remove the base 10 implementation of std::to_chars from the dylib. +// The implementation moved to the header, but we still export the symbols from +// the dylib for backwards compatibility. +# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10 +// Define std::array/std::string_view iterators to be __wrap_iters instead of raw +// pointers, which prevents people from relying on a non-portable implementation +// detail. This is especially useful because enabling bounded iterators hardening +// requires code not to make these assumptions. +# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY +# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW +// Dont' add an inline namespace for `std::filesystem` +# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE +#elif _LIBCPP_ABI_VERSION == 1 +# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF)) +// Enable compiling copies of now inline methods into the dylib to support +// applications compiled against older libraries. This is unnecessary with +// COFF dllexport semantics, since dllexport forces a non-inline definition +// of inline functions to be emitted anyway. Our own non-inline copy would +// conflict with the dllexport-emitted copy, so we disable it. For XCOFF, +// the linker will take issue with the symbols in the shared object if the +// weak inline methods get visibility (such as from -fvisibility-inlines-hidden), +// so disable it. +# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS +# endif +// Feature macros for disabling pre ABI v1 features. All of these options +// are deprecated. +# if defined(__FreeBSD__) && __FreeBSD__ < 14 +# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR +# endif +#endif + +// We had some bugs where we use [[no_unique_address]] together with construct_at, +// which causes UB as the call on construct_at could write to overlapping subobjects +// +// https://github.com/llvm/llvm-project/issues/70506 +// https://github.com/llvm/llvm-project/issues/70494 +// +// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions. +// The macro below is used for all classes whose ABI have changed as part of fixing these bugs. +#define _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS __attribute__((__abi_tag__("llvm18_nua"))) + +// Changes the iterator type of select containers (see below) to a bounded iterator that keeps track of whether it's +// within the bounds of the original container and asserts it on every dereference. +// +// ABI impact: changes the iterator type of the relevant containers. +// +// Supported containers: +// - `span`; +// - `string_view`. +// #define _LIBCPP_ABI_BOUNDED_ITERATORS + +#if defined(_LIBCPP_COMPILER_CLANG_BASED) +# if defined(__APPLE__) +# if defined(__i386__) || defined(__x86_64__) +// use old string layout on x86_64 and i386 +# elif defined(__arm__) +// use old string layout on arm (which does not include aarch64/arm64), except on watch ABIs +# if defined(__ARM_ARCH_7K__) && __ARM_ARCH_7K__ >= 2 +# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT +# endif +# else +# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT +# endif +# endif +#endif + +#endif // _LIBCPP___CONFIGURATION_ABI_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__configuration/availability.h b/contrib/libs/cxxsupp/libcxx/include/__configuration/availability.h new file mode 100644 index 0000000000..ab483a07c9 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__configuration/availability.h @@ -0,0 +1,400 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___CONFIGURATION_AVAILABILITY_H +#define _LIBCPP___CONFIGURATION_AVAILABILITY_H + +#include <__configuration/compiler.h> +#include <__configuration/language.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +// Libc++ is shipped by various vendors. In particular, it is used as a system +// library on macOS, iOS and other Apple platforms. In order for users to be +// able to compile a binary that is intended to be deployed to an older version +// of a platform, Clang provides availability attributes [1]. These attributes +// can be placed on declarations and are used to describe the life cycle of a +// symbol in the library. +// +// The main goal is to ensure a compile-time error if a symbol that hasn't been +// introduced in a previously released library is used in a program that targets +// that previously released library. Normally, this would be a load-time error +// when one tries to launch the program against the older library. +// +// For example, the filesystem library was introduced in the dylib in LLVM 9. +// On Apple platforms, this corresponds to macOS 10.15. If a user compiles on +// a macOS 10.15 host but targets macOS 10.13 with their program, the compiler +// would normally not complain (because the required declarations are in the +// headers), but the dynamic loader would fail to find the symbols when actually +// trying to launch the program on macOS 10.13. To turn this into a compile-time +// issue instead, declarations are annotated with when they were introduced, and +// the compiler can produce a diagnostic if the program references something that +// isn't available on the deployment target. +// +// This mechanism is general in nature, and any vendor can add their markup to +// the library (see below). Whenever a new feature is added that requires support +// in the shared library, two macros are added below to allow marking the feature +// as unavailable: +// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_<feature>` which must be defined +// to `_LIBCPP_INTRODUCED_IN_<version>` for the appropriate LLVM version. +// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must be defined to +// `_LIBCPP_INTRODUCED_IN_<version>_MARKUP` for the appropriate LLVM version. +// +// When vendors decide to ship the feature as part of their shared library, they +// can update the `_LIBCPP_INTRODUCED_IN_<version>` macro (and the markup counterpart) +// based on the platform version they shipped that version of LLVM in. The library +// will then use this markup to provide an optimal user experience on these platforms. +// +// Furthermore, many features in the standard library have corresponding +// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_<feature>` macros +// are checked by the corresponding feature-test macros generated by +// generate_feature_test_macro_components.py to ensure that the library +// doesn't announce a feature as being implemented if it is unavailable on +// the deployment target. +// +// Note that this mechanism is disabled by default in the "upstream" libc++. +// Availability annotations are only meaningful when shipping libc++ inside +// a platform (i.e. as a system library), and so vendors that want them should +// turn those annotations on at CMake configuration time. +// +// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability + +// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY +// for a while. +#if defined(_LIBCPP_DISABLE_AVAILABILITY) +# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +# endif +#endif + +// Availability markup is disabled when building the library, or when a non-Clang +// compiler is used because only Clang supports the necessary attributes. +#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || !defined(_LIBCPP_COMPILER_CLANG_BASED) +# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +# endif +#endif + +// When availability annotations are disabled, we take for granted that features introduced +// in all versions of the library are available. +#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) + +# define _LIBCPP_INTRODUCED_IN_LLVM_19 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_18 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_17 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_17_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_16 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_15 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_14 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_13 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_13_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_12 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_11 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_10 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_9 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE /* nothing */ +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH /* nothing */ +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_8 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_8_ATTRIBUTE /* nothing */ + +# define _LIBCPP_INTRODUCED_IN_LLVM_4 1 +# define _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE /* nothing */ + +#elif defined(__APPLE__) + +// clang-format off + +// LLVM 19 +// TODO: Fill this in +# define _LIBCPP_INTRODUCED_IN_LLVM_19 0 +# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE __attribute__((unavailable)) + +// LLVM 18 +// TODO: Fill this in +# define _LIBCPP_INTRODUCED_IN_LLVM_18 0 +# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE __attribute__((unavailable)) + +// LLVM 17 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140400) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170400) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170400) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100400) +# define _LIBCPP_INTRODUCED_IN_LLVM_17 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_17 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_17_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 14.4))) \ + __attribute__((availability(ios, strict, introduced = 17.4))) \ + __attribute__((availability(tvos, strict, introduced = 17.4))) \ + __attribute__((availability(watchos, strict, introduced = 10.4))) + +// LLVM 16 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000) +# define _LIBCPP_INTRODUCED_IN_LLVM_16 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_16 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 14.0))) \ + __attribute__((availability(ios, strict, introduced = 17.0))) \ + __attribute__((availability(tvos, strict, introduced = 17.0))) \ + __attribute__((availability(watchos, strict, introduced = 10.0))) + +// LLVM 15 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130400) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160500) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160500) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90500) +# define _LIBCPP_INTRODUCED_IN_LLVM_15 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_15 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 13.4))) \ + __attribute__((availability(ios, strict, introduced = 16.5))) \ + __attribute__((availability(tvos, strict, introduced = 16.5))) \ + __attribute__((availability(watchos, strict, introduced = 9.5))) + +// LLVM 14 +# define _LIBCPP_INTRODUCED_IN_LLVM_14 _LIBCPP_INTRODUCED_IN_LLVM_15 +# define _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE + +// LLVM 13 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130000) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90000) +# define _LIBCPP_INTRODUCED_IN_LLVM_13 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_13 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_13_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 13.0))) \ + __attribute__((availability(ios, strict, introduced = 16.0))) \ + __attribute__((availability(tvos, strict, introduced = 16.0))) \ + __attribute__((availability(watchos, strict, introduced = 9.0))) + +// LLVM 12 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 120300) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 150300) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 150300) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 80300) +# define _LIBCPP_INTRODUCED_IN_LLVM_12 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_12 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 12.3))) \ + __attribute__((availability(ios, strict, introduced = 15.3))) \ + __attribute__((availability(tvos, strict, introduced = 15.3))) \ + __attribute__((availability(watchos, strict, introduced = 8.3))) + +// LLVM 11 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000) +# define _LIBCPP_INTRODUCED_IN_LLVM_11 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_11 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 11.0))) \ + __attribute__((availability(ios, strict, introduced = 14.0))) \ + __attribute__((availability(tvos, strict, introduced = 14.0))) \ + __attribute__((availability(watchos, strict, introduced = 7.0))) + +// LLVM 10 +# define _LIBCPP_INTRODUCED_IN_LLVM_10 _LIBCPP_INTRODUCED_IN_LLVM_11 +# define _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE + +// LLVM 9 +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) +# define _LIBCPP_INTRODUCED_IN_LLVM_9 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_9 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE \ + __attribute__((availability(macos, strict, introduced = 10.15))) \ + __attribute__((availability(ios, strict, introduced = 13.0))) \ + __attribute__((availability(tvos, strict, introduced = 13.0))) \ + __attribute__((availability(watchos, strict, introduced = 6.0))) +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH \ + _Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))") +# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") + +// LLVM 4 +# if defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000 +# define _LIBCPP_INTRODUCED_IN_LLVM_4 0 +# else +# define _LIBCPP_INTRODUCED_IN_LLVM_4 1 +# endif +# define _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE __attribute__((availability(watchos, strict, introduced = 5.0))) + +// clang-format on + +#else + +// ...New vendors can add availability markup here... + +# error \ + "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!" + +#endif + +// These macros control the availability of std::bad_optional_access and +// other exception types. These were put in the shared library to prevent +// code bloat from every user program defining the vtable for these exception +// types. +// +// Note that when exceptions are disabled, the methods that normally throw +// these exceptions can be used even on older deployment targets, but those +// methods will abort instead of throwing. +#define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4 +#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE + +#define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4 +#define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE + +#define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST _LIBCPP_INTRODUCED_IN_LLVM_4 +#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE + +// These macros control the availability of all parts of <filesystem> that +// depend on something in the dylib. +#define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9 +#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE +#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH +#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP + +// This controls the availability of the C++20 synchronization library, +// which requires shared library support for various operations +// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>, +// <semaphore>, and notification functions on std::atomic. +#define _LIBCPP_AVAILABILITY_HAS_SYNC _LIBCPP_INTRODUCED_IN_LLVM_11 +#define _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INTRODUCED_IN_LLVM_11_ATTRIBUTE + +// Enable additional explicit instantiations of iostreams components. This +// reduces the number of weak definitions generated in programs that use +// iostreams by providing a single strong definition in the shared library. +// +// TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation, +// or once libc++ doesn't use the attribute anymore. +// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed. +#if !defined(_LIBCPP_COMPILER_GCC) && !defined(_WIN32) +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 _LIBCPP_INTRODUCED_IN_LLVM_12 +#else +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0 +#endif + +// This controls the availability of floating-point std::to_chars functions. +// These overloads were added later than the integer overloads. +#define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14 +#define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE + +// This controls whether the library claims to provide a default verbose +// termination function, and consequently whether the headers will try +// to use it when the mechanism isn't overriden at compile-time. +#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15 +#define _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE + +// This controls the availability of the C++17 std::pmr library, +// which is implemented in large part in the built library. +// +// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed +// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support +// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we +// use availability annotations until that bug has been fixed. +#define _LIBCPP_AVAILABILITY_HAS_PMR _LIBCPP_INTRODUCED_IN_LLVM_16 +#define _LIBCPP_AVAILABILITY_PMR + +// These macros controls the availability of __cxa_init_primary_exception +// in the built library, which std::make_exception_ptr might use +// (see libcxx/include/__exception/exception_ptr.h). +#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18 +#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE + +// This controls the availability of C++23 <print>, which +// has a dependency on the built library (it needs access to +// the underlying buffer types of std::cout, std::cerr, and std::clog. +#define _LIBCPP_AVAILABILITY_HAS_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18 +#define _LIBCPP_AVAILABILITY_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE + +// This controls the availability of the C++20 time zone database. +// The parser code is built in the library. +#define _LIBCPP_AVAILABILITY_HAS_TZDB _LIBCPP_INTRODUCED_IN_LLVM_19 +#define _LIBCPP_AVAILABILITY_TZDB _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE + +// These macros determine whether we assume that std::bad_function_call and +// std::bad_expected_access provide a key function in the dylib. This allows +// centralizing their vtable and typeinfo instead of having all TUs provide +// a weak definition that then gets deduplicated. +#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19 +#define _LIBCPP_AVAILABILITY_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE +#define _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19 +#define _LIBCPP_AVAILABILITY_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE + +// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS. +// Those are defined in terms of the availability attributes above, and +// should not be vendor-specific. +#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS +#else +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS +#endif + +// Define availability attributes that depend on both +// _LIBCPP_HAS_NO_EXCEPTIONS and _LIBCPP_HAS_NO_RTTI. +#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) || defined(_LIBCPP_HAS_NO_RTTI) +# undef _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION +# undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION +# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0 +# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION +#endif + +#endif // _LIBCPP___CONFIGURATION_AVAILABILITY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__configuration/compiler.h b/contrib/libs/cxxsupp/libcxx/include/__configuration/compiler.h new file mode 100644 index 0000000000..d34361b9dc --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__configuration/compiler.h @@ -0,0 +1,52 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___CONFIGURATION_COMPILER_H +#define _LIBCPP___CONFIGURATION_COMPILER_H + +#include <__config_site> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +# pragma GCC system_header +#endif + +#if defined(__apple_build_version__) +// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403) +# define _LIBCPP_COMPILER_CLANG_BASED +# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000) +#elif defined(__clang__) +# define _LIBCPP_COMPILER_CLANG_BASED +# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) +#elif defined(__GNUC__) +# define _LIBCPP_COMPILER_GCC +# define _LIBCPP_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +#endif + +#ifdef __cplusplus + +// Warn if a compiler version is used that is not supported anymore +// LLVM RELEASE Update the minimum compiler versions +# if defined(_LIBCPP_CLANG_VER) +# if _LIBCPP_CLANG_VER < 1700 +// We allow clang 14 and newer +// # warning "Libc++ only supports Clang 17 and later" +# endif +# elif defined(_LIBCPP_APPLE_CLANG_VER) +# if _LIBCPP_APPLE_CLANG_VER < 1500 +# warning "Libc++ only supports AppleClang 15 and later" +# endif +# elif defined(_LIBCPP_GCC_VER) +# if _LIBCPP_GCC_VER < 1400 +# warning "Libc++ only supports GCC 14 and later" +# endif +# endif + +#endif + +#endif // _LIBCPP___CONFIGURATION_COMPILER_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__configuration/language.h b/contrib/libs/cxxsupp/libcxx/include/__configuration/language.h new file mode 100644 index 0000000000..fa62a7b6f5 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__configuration/language.h @@ -0,0 +1,46 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___CONFIGURATION_LANGUAGE_H +#define _LIBCPP___CONFIGURATION_LANGUAGE_H + +#include <__config_site> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +# pragma GCC system_header +#endif + +// NOLINTBEGIN(libcpp-cpp-version-check) +#ifdef __cplusplus +# if __cplusplus <= 201103L +# define _LIBCPP_STD_VER 11 +# elif __cplusplus <= 201402L +# define _LIBCPP_STD_VER 14 +# elif __cplusplus <= 201703L +# define _LIBCPP_STD_VER 17 +# elif __cplusplus <= 202002L +# define _LIBCPP_STD_VER 20 +# elif __cplusplus <= 202302L +# define _LIBCPP_STD_VER 23 +# else +// Expected release year of the next C++ standard +# define _LIBCPP_STD_VER 26 +# endif +#endif // __cplusplus +// NOLINTEND(libcpp-cpp-version-check) + +#if !defined(__cpp_rtti) || __cpp_rtti < 199711L +# define _LIBCPP_HAS_NO_RTTI +#endif + +#if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L +# define _LIBCPP_HAS_NO_EXCEPTIONS +#endif + +#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__configuration/platform.h b/contrib/libs/cxxsupp/libcxx/include/__configuration/platform.h new file mode 100644 index 0000000000..6d5b95164e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__configuration/platform.h @@ -0,0 +1,54 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___CONFIGURATION_PLATFORM_H +#define _LIBCPP___CONFIGURATION_PLATFORM_H + +#include <__config_site> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +# pragma GCC system_header +#endif + +#if defined(__ELF__) +# define _LIBCPP_OBJECT_FORMAT_ELF 1 +#elif defined(__MACH__) +# define _LIBCPP_OBJECT_FORMAT_MACHO 1 +#elif defined(_WIN32) || defined(__CYGWIN__) +# define _LIBCPP_OBJECT_FORMAT_COFF 1 +#elif defined(__wasm__) +# define _LIBCPP_OBJECT_FORMAT_WASM 1 +#elif defined(_AIX) +# define _LIBCPP_OBJECT_FORMAT_XCOFF 1 +#else +// ... add new file formats here ... +#endif + +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +# include <features.h> +# if defined(__GLIBC_PREREQ) +# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) +# else +# define _LIBCPP_GLIBC_PREREQ(a, b) 0 +# endif // defined(__GLIBC_PREREQ) +#endif // defined(__linux__) + +#ifndef __BYTE_ORDER__ +# error \ + "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform" +#endif + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define _LIBCPP_LITTLE_ENDIAN +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define _LIBCPP_BIG_ENDIAN +#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + +#endif // _LIBCPP___CONFIGURATION_PLATFORM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__debug_utils/sanitizers.h b/contrib/libs/cxxsupp/libcxx/include/__debug_utils/sanitizers.h new file mode 100644 index 0000000000..f72b399e21 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__debug_utils/sanitizers.h @@ -0,0 +1,104 @@ +//===----------------------------------------------------------------------===// +// +// 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___LIBCXX_DEBUG_UTILS_SANITIZERS_H +#define _LIBCPP___LIBCXX_DEBUG_UTILS_SANITIZERS_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_constant_evaluated.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +#ifndef _LIBCPP_HAS_NO_ASAN + +extern "C" { +_LIBCPP_EXPORTED_FROM_ABI void +__sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*); +_LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container( + const void*, const void*, const void*, const void*, const void*, const void*); +_LIBCPP_EXPORTED_FROM_ABI int +__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*); +} + +#endif // _LIBCPP_HAS_NO_ASAN + +_LIBCPP_BEGIN_NAMESPACE_STD + +// ASan choices +#ifndef _LIBCPP_HAS_NO_ASAN +# define _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS 1 +#endif + +#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS +// __asan_annotate_container_with_allocator determines whether containers with custom allocators are annotated. This is +// a public customization point to disable annotations if the custom allocator assumes that the memory isn't poisoned. +// See the https://libcxx.llvm.org/UsingLibcxx.html#turning-off-asan-annotation-in-containers for more information. +template <class _Alloc> +struct __asan_annotate_container_with_allocator : true_type {}; +#endif + +// Annotate a double-ended contiguous range. +// - [__first_storage, __last_storage) is the allocated memory region, +// - [__first_old_contained, __last_old_contained) is the previously allowed (unpoisoned) range, and +// - [__first_new_contained, __last_new_contained) is the new allowed (unpoisoned) range. +template <class _Allocator> +_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container( + const void* __first_storage, + const void* __last_storage, + const void* __first_old_contained, + const void* __last_old_contained, + const void* __first_new_contained, + const void* __last_new_contained) { +#if !defined(_LIBCPP_HAS_NO_ASAN) || defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) + (void)__first_storage; + (void)__last_storage; + (void)__first_old_contained; + (void)__last_old_contained; + (void)__first_new_contained; + (void)__last_new_contained; +#else + if (__asan_annotate_container_with_allocator<_Allocator>::value && __first_storage != nullptr) + __sanitizer_annotate_double_ended_contiguous_container( + __first_storage, + __last_storage, + __first_old_contained, + __last_old_contained, + __first_new_contained, + __last_new_contained); +#endif +} + +// Annotate a contiguous range. +// [__first_storage, __last_storage) is the allocated memory region, +// __old_last_contained is the previously last allowed (unpoisoned) element, and +// __new_last_contained is the new last allowed (unpoisoned) element. +template <class _Allocator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __annotate_contiguous_container( + const void* __first_storage, + const void* __last_storage, + const void* __old_last_contained, + const void* __new_last_contained) { +#if !defined(_LIBCPP_HAS_NO_ASAN) || defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) + (void)__first_storage; + (void)__last_storage; + (void)__old_last_contained; + (void)__new_last_contained; +#else + if (!__libcpp_is_constant_evaluated() && __asan_annotate_container_with_allocator<_Allocator>::value && + __first_storage != nullptr) + __sanitizer_annotate_contiguous_container( + __first_storage, __last_storage, __old_last_contained, __new_last_contained); +#endif +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___LIBCXX_DEBUG_UTILS_SANITIZERS_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h index f0f2f12ed9..e9316f31c2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h +++ b/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___EXCEPTION_EXCEPTION_PTR_H #define _LIBCPP___EXCEPTION_EXCEPTION_PTR_H -#include <__availability> #include <__config> #include <__exception/operations.h> #include <__memory/addressof.h> @@ -65,6 +64,9 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr { friend _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT; public: + // exception_ptr is basically a COW string. + using __trivially_relocatable = exception_ptr; + _LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {} _LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {} @@ -103,15 +105,16 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { void* __ex = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ep)); # ifdef __wasm__ // In Wasm, a destructor returns its argument - (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* { + (void)__cxxabiv1::__cxa_init_primary_exception( + __ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* { # else (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) { # endif - std::__destroy_at(static_cast<_Ep2*>(__p)); + std::__destroy_at(static_cast<_Ep2*>(__p)); # ifdef __wasm__ - return __p; + return __p; # endif - }); + }); try { ::new (__ex) _Ep2(__e); diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h b/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h index 1bf2df9392..feb489f87f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h +++ b/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h @@ -84,17 +84,15 @@ struct __can_dynamic_cast : _BoolConstant< is_polymorphic<_From>::value && (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value)> {}; -template <class _Ep> -inline _LIBCPP_HIDE_FROM_ABI void -rethrow_if_nested(const _Ep& __e, __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0) { +template <class _Ep, __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep& __e) { const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::addressof(__e)); if (__nep) __nep->rethrow_nested(); } -template <class _Ep> -inline _LIBCPP_HIDE_FROM_ABI void -rethrow_if_nested(const _Ep&, __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0) {} +template <class _Ep, __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep&) {} } // namespace std diff --git a/contrib/libs/cxxsupp/libcxx/include/__expected/bad_expected_access.h b/contrib/libs/cxxsupp/libcxx/include/__expected/bad_expected_access.h index 174f97fe7b..d954545588 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__expected/bad_expected_access.h +++ b/contrib/libs/cxxsupp/libcxx/include/__expected/bad_expected_access.h @@ -27,23 +27,28 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Err> class bad_expected_access; +_LIBCPP_DIAGNOSTIC_PUSH +# if !_LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION +_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables") +# endif template <> -class bad_expected_access<void> : public exception { +class _LIBCPP_EXPORTED_FROM_ABI bad_expected_access<void> : public exception { protected: - _LIBCPP_HIDE_FROM_ABI bad_expected_access() noexcept = default; - _LIBCPP_HIDE_FROM_ABI bad_expected_access(const bad_expected_access&) = default; - _LIBCPP_HIDE_FROM_ABI bad_expected_access(bad_expected_access&&) = default; - _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(const bad_expected_access&) = default; - _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(bad_expected_access&&) = default; - _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_expected_access() override = default; + _LIBCPP_HIDE_FROM_ABI bad_expected_access() noexcept = default; + _LIBCPP_HIDE_FROM_ABI bad_expected_access(const bad_expected_access&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI bad_expected_access(bad_expected_access&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(const bad_expected_access&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(bad_expected_access&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_expected_access() override = default; public: - // The way this has been designed (by using a class template below) means that we'll already - // have a profusion of these vtables in TUs, and the dynamic linker will already have a bunch - // of work to do. So it is not worth hiding the <void> specialization in the dylib, given that - // it adds deployment target restrictions. +# if _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION + const char* what() const noexcept override; +# else _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override { return "bad access to std::expected"; } +# endif }; +_LIBCPP_DIAGNOSTIC_POP template <class _Err> class bad_expected_access : public bad_expected_access<void> { diff --git a/contrib/libs/cxxsupp/libcxx/include/__expected/expected.h b/contrib/libs/cxxsupp/libcxx/include/__expected/expected.h index 21b610b3db..d08222f7bc 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__expected/expected.h +++ b/contrib/libs/cxxsupp/libcxx/include/__expected/expected.h @@ -31,6 +31,7 @@ #include <__type_traits/is_swappable.h> #include <__type_traits/is_trivially_constructible.h> #include <__type_traits/is_trivially_destructible.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/is_void.h> #include <__type_traits/lazy.h> #include <__type_traits/negation.h> @@ -463,6 +464,11 @@ public: using error_type = _Err; using unexpected_type = unexpected<_Err>; + using __trivially_relocatable = + __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value && __libcpp_is_trivially_relocatable<_Err>::value, + expected, + void>; + template <class _Up> using rebind = expected<_Up, error_type>; @@ -501,7 +507,9 @@ private: _And< is_constructible<_Tp, _UfQual>, is_constructible<_Err, _OtherErrQual>, _If<_Not<is_same<remove_cv_t<_Tp>, bool>>::value, - _And< _Not<is_constructible<_Tp, expected<_Up, _OtherErr>&>>, + _And< + _Not<_And<is_same<_Tp, _Up>, is_same<_Err, _OtherErr>>>, // use the copy constructor instead, see #92676 + _Not<is_constructible<_Tp, expected<_Up, _OtherErr>&>>, _Not<is_constructible<_Tp, expected<_Up, _OtherErr>>>, _Not<is_constructible<_Tp, const expected<_Up, _OtherErr>&>>, _Not<is_constructible<_Tp, const expected<_Up, _OtherErr>>>, diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h index 90e44f5d13..c40b5d7233 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H #define _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H -#include <__availability> #include <__chrono/time_point.h> #include <__compare/ordering.h> #include <__config> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h index a5aa5ff543..e0246d8001 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h @@ -11,7 +11,6 @@ #define _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H #include <__assert> -#include <__availability> #include <__config> #include <__filesystem/directory_entry.h> #include <__filesystem/directory_options.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h index bfdcc5eaee..80a11e3b19 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H #define _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H -#include <__availability> #include <__config> #include <__filesystem/path.h> #include <__memory/shared_ptr.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h index 9bb83576f5..f588189ed1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___FILESYSTEM_OPERATIONS_H #define _LIBCPP___FILESYSTEM_OPERATIONS_H -#include <__availability> #include <__chrono/time_point.h> #include <__config> #include <__filesystem/copy_options.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h index 9ffc90ada5..ff468d5177 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h @@ -12,7 +12,6 @@ #include <__algorithm/replace.h> #include <__algorithm/replace_copy.h> -#include <__availability> #include <__config> #include <__functional/unary_function.h> #include <__fwd/functional.h> @@ -812,7 +811,7 @@ public: _LIBCPP_HIDE_FROM_ABI path extension() const { return string_type(__extension()); } // query - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __pn_.empty(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __pn_.empty(); } _LIBCPP_HIDE_FROM_ABI bool has_root_name() const { return !__root_name().empty(); } _LIBCPP_HIDE_FROM_ABI bool has_root_directory() const { return !__root_directory().empty(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h index d2d65cd122..f4d486d86c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h @@ -11,7 +11,6 @@ #define _LIBCPP___FILESYSTEM_PATH_ITERATOR_H #include <__assert> -#include <__availability> #include <__config> #include <__filesystem/path.h> #include <__iterator/iterator_traits.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h index a8af4f73b1..caa1396eb3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H #define _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H -#include <__availability> #include <__config> #include <__filesystem/directory_entry.h> #include <__filesystem/directory_options.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h index bde8780548..dae5823128 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h @@ -11,7 +11,6 @@ #define _LIBCPP___FILESYSTEM_U8PATH_H #include <__algorithm/unwrap_iter.h> -#include <__availability> #include <__config> #include <__filesystem/path.h> #include <string> diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h index e9f4a6e4f6..f7be2dc61f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h @@ -80,10 +80,9 @@ namespace __escaped_output_table { /// The entries of the characters to escape in format's debug string. /// /// Contains the entries for [format.string.escaped]/2.2.1.2.1 -/// CE is a Unicode encoding and C corresponds to either a UCS scalar value -/// whose Unicode property General_Category has a value in the groups -/// Separator (Z) or Other (C) or to a UCS scalar value which has the Unicode -/// property Grapheme_Extend=Yes, as described by table 12 of UAX #44 +/// CE is a Unicode encoding and C corresponds to a UCS scalar value whose +/// Unicode property General_Category has a value in the groups Separator (Z) +/// or Other (C), as described by table 12 of UAX #44 /// /// Separator (Z) consists of General_Category /// - Space_Separator, @@ -98,7 +97,6 @@ namespace __escaped_output_table { /// - Unassigned. /// /// The data is generated from -/// - https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt /// - https://www.unicode.org/Public/UCD/latest/ucd/extracted/DerivedGeneralCategory.txt /// /// The table is similar to the table @@ -107,926 +105,751 @@ namespace __escaped_output_table { /// table lacks a property, thus having more bits available for the size. /// /// The data has 2 values: -/// - bits [0, 10] The size of the range, allowing 2048 elements. -/// - bits [11, 31] The lower bound code point of the range. The upper bound of -/// the range is lower bound + size. -_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[893] = { - 0x00000020, - 0x0003f821, - 0x00056800, - 0x0018006f, - 0x001bc001, - 0x001c0003, - 0x001c5800, - 0x001c6800, - 0x001d1000, - 0x00241806, - 0x00298000, - 0x002ab801, - 0x002c5801, - 0x002c802d, - 0x002df800, - 0x002e0801, - 0x002e2001, - 0x002e3808, - 0x002f5803, - 0x002fa810, - 0x0030800a, - 0x0030e000, - 0x00325814, - 0x00338000, - 0x0036b007, - 0x0036f805, - 0x00373801, - 0x00375003, - 0x00387001, - 0x00388800, - 0x0039801c, - 0x003d300a, - 0x003d900d, - 0x003f5808, - 0x003fd802, - 0x0040b003, - 0x0040d808, - 0x00412802, - 0x00414806, - 0x0041f800, - 0x0042c804, - 0x0042f800, - 0x00435804, - 0x00447810, - 0x00465038, - 0x0049d000, - 0x0049e000, - 0x004a0807, - 0x004a6800, - 0x004a8806, - 0x004b1001, - 0x004c0800, - 0x004c2000, - 0x004c6801, - 0x004c8801, - 0x004d4800, - 0x004d8800, - 0x004d9802, - 0x004dd002, - 0x004df000, - 0x004e0805, - 0x004e4801, - 0x004e6800, - 0x004e780c, - 0x004ef000, - 0x004f1003, - 0x004ff004, - 0x00502000, - 0x00505803, - 0x00508801, - 0x00514800, - 0x00518800, - 0x0051a000, - 0x0051b800, - 0x0051d003, - 0x00520817, - 0x0052e800, - 0x0052f806, - 0x00538001, - 0x0053a800, - 0x0053b80b, - 0x00542000, - 0x00547000, - 0x00549000, - 0x00554800, - 0x00558800, - 0x0055a000, - 0x0055d002, - 0x00560807, - 0x00565000, - 0x00566802, - 0x0056880e, - 0x00571003, - 0x00579006, - 0x0057d007, - 0x00582000, - 0x00586801, - 0x00588801, - 0x00594800, - 0x00598800, - 0x0059a000, - 0x0059d002, - 0x0059f001, - 0x005a0805, - 0x005a4801, - 0x005a680e, - 0x005af000, - 0x005b1003, - 0x005bc00a, - 0x005c2000, - 0x005c5802, - 0x005c8800, - 0x005cb002, - 0x005cd800, - 0x005ce800, - 0x005d0002, - 0x005d2802, - 0x005d5802, - 0x005dd004, - 0x005e0000, - 0x005e1802, - 0x005e4800, - 0x005e6802, - 0x005e8814, - 0x005fd805, - 0x00602000, - 0x00606800, - 0x00608800, - 0x00614800, - 0x0061d002, - 0x0061f002, - 0x00622812, - 0x0062d801, - 0x0062f001, - 0x00631003, - 0x00638006, - 0x00640800, - 0x00646800, - 0x00648800, - 0x00654800, - 0x0065a000, - 0x0065d002, - 0x0065f800, - 0x00661000, - 0x00662801, - 0x00664800, - 0x00666010, - 0x0066f800, - 0x00671003, - 0x00678000, - 0x0067a00d, - 0x00686800, - 0x00688800, - 0x0069d801, - 0x0069f000, - 0x006a0804, - 0x006a4800, - 0x006a6800, - 0x006a8003, - 0x006ab800, - 0x006b1003, - 0x006c0001, - 0x006c2000, - 0x006cb802, - 0x006d9000, - 0x006de000, - 0x006df001, - 0x006e3808, - 0x006e9005, - 0x006ef806, - 0x006f8001, - 0x006fa80b, - 0x00718800, - 0x0071a00a, - 0x00723807, - 0x0072e024, - 0x00741800, - 0x00742800, - 0x00745800, - 0x00752000, - 0x00753000, - 0x00758800, - 0x0075a008, - 0x0075f001, - 0x00762800, - 0x00763808, - 0x0076d001, - 0x0077001f, - 0x0078c001, - 0x0079a800, - 0x0079b800, - 0x0079c800, - 0x007a4000, - 0x007b6811, - 0x007c0004, - 0x007c3001, - 0x007c6830, - 0x007e3000, - 0x007e6800, - 0x007ed824, - 0x00816803, - 0x00819005, - 0x0081c801, - 0x0081e801, - 0x0082c001, - 0x0082f002, - 0x00838803, - 0x00841000, - 0x00842801, - 0x00846800, - 0x0084e800, - 0x00863000, - 0x00864004, - 0x00867001, - 0x00924800, - 0x00927001, - 0x0092b800, - 0x0092c800, - 0x0092f001, - 0x00944800, - 0x00947001, - 0x00958800, - 0x0095b001, - 0x0095f800, - 0x00960800, - 0x00963001, - 0x0096b800, - 0x00988800, - 0x0098b001, - 0x009ad804, - 0x009be802, - 0x009cd005, - 0x009fb001, - 0x009ff001, - 0x00b40000, - 0x00b4e802, - 0x00b7c806, - 0x00b89002, - 0x00b8b008, - 0x00b99001, - 0x00b9b808, - 0x00ba900d, - 0x00bb6800, - 0x00bb880e, - 0x00bda001, - 0x00bdb806, - 0x00be3000, - 0x00be480a, - 0x00bee802, - 0x00bf5005, - 0x00bfd005, - 0x00c05804, - 0x00c0d005, - 0x00c3c806, - 0x00c42801, - 0x00c54800, - 0x00c55804, - 0x00c7b009, - 0x00c8f803, - 0x00c93801, - 0x00c96003, - 0x00c99000, - 0x00c9c806, - 0x00ca0802, - 0x00cb7001, - 0x00cba80a, - 0x00cd6003, - 0x00ce5005, - 0x00ced802, - 0x00d0b801, - 0x00d0d802, - 0x00d2b000, - 0x00d2c008, - 0x00d31000, - 0x00d32807, - 0x00d3980c, - 0x00d45005, - 0x00d4d005, - 0x00d57055, - 0x00d9a006, - 0x00d9e000, - 0x00da1000, - 0x00da6802, - 0x00db5808, - 0x00dbf802, - 0x00dd1003, - 0x00dd4001, - 0x00dd5802, - 0x00df3000, - 0x00df4001, - 0x00df6800, - 0x00df7802, - 0x00dfa007, - 0x00e16007, - 0x00e1b004, - 0x00e25002, - 0x00e44806, - 0x00e5d801, - 0x00e6400a, - 0x00e6a00c, - 0x00e71006, - 0x00e76800, - 0x00e7a000, - 0x00e7c001, - 0x00e7d804, - 0x00ee003f, - 0x00f8b001, - 0x00f8f001, - 0x00fa3001, - 0x00fa7001, - 0x00fac000, - 0x00fad000, - 0x00fae000, - 0x00faf000, - 0x00fbf001, - 0x00fda800, - 0x00fe2800, - 0x00fea001, - 0x00fee000, - 0x00ff8001, - 0x00ffa800, - 0x00fff810, - 0x01014007, - 0x0102f810, - 0x01039001, - 0x01047800, - 0x0104e802, - 0x0106083e, - 0x010c6003, - 0x01213818, - 0x01225814, - 0x015ba001, - 0x015cb000, - 0x01677802, - 0x0167a004, - 0x01693000, - 0x01694004, - 0x01697001, - 0x016b4006, - 0x016b880e, - 0x016cb808, - 0x016d3800, - 0x016d7800, - 0x016db800, - 0x016df800, - 0x016e3800, - 0x016e7800, - 0x016eb800, - 0x016ef820, - 0x0172f021, - 0x0174d000, - 0x0177a00b, - 0x017eb019, - 0x017fe004, - 0x01815005, - 0x01820000, - 0x0184b803, - 0x01880004, - 0x01898000, - 0x018c7800, - 0x018f200b, - 0x0190f800, - 0x05246802, - 0x05263808, - 0x05316013, - 0x05337803, - 0x0533a009, - 0x0534f001, - 0x05378001, - 0x0537c007, - 0x053e5804, - 0x053e9000, - 0x053ea000, - 0x053ed017, - 0x05401000, - 0x05403000, - 0x05405800, - 0x05412801, - 0x05416003, - 0x0541d005, - 0x0543c007, - 0x05462009, - 0x0546d017, - 0x0547f800, - 0x05493007, - 0x054a380a, - 0x054aa00a, - 0x054be805, - 0x054d9800, - 0x054db003, - 0x054de001, - 0x054e7000, - 0x054ed003, - 0x054f2800, - 0x054ff800, - 0x05514805, - 0x05518801, - 0x0551a80a, - 0x05521800, - 0x05526000, - 0x05527001, - 0x0552d001, - 0x0553e000, - 0x05558000, - 0x05559002, - 0x0555b801, - 0x0555f001, - 0x05560800, - 0x05561817, - 0x05576001, - 0x0557b00a, - 0x05583801, - 0x05587801, - 0x0558b808, - 0x05593800, - 0x05597800, - 0x055b6003, - 0x055f2800, - 0x055f4000, - 0x055f6802, - 0x055fd005, - 0x06bd200b, - 0x06be3803, - 0x06bfe7ff, - 0x06ffe7ff, - 0x073fe7ff, - 0x077fe7ff, - 0x07bfe103, - 0x07d37001, - 0x07d6d025, - 0x07d8380b, - 0x07d8c004, - 0x07d8f000, - 0x07d9b800, - 0x07d9e800, - 0x07d9f800, - 0x07da1000, - 0x07da2800, - 0x07de180f, - 0x07ec8001, - 0x07ee4006, - 0x07ee801f, - 0x07f0000f, - 0x07f0d015, - 0x07f29800, - 0x07f33800, - 0x07f36003, - 0x07f3a800, - 0x07f7e803, - 0x07fcf001, - 0x07fdf802, - 0x07fe4001, - 0x07fe8001, - 0x07fec001, - 0x07fee802, - 0x07ff3800, - 0x07ff780c, - 0x07fff001, - 0x08006000, - 0x08013800, - 0x0801d800, - 0x0801f000, - 0x08027001, - 0x0802f021, - 0x0807d804, - 0x08081803, - 0x0809a002, - 0x080c7800, - 0x080ce802, - 0x080d082e, - 0x080fe882, - 0x0814e802, - 0x0816880f, - 0x0817e003, - 0x08192008, - 0x081a5804, - 0x081bb009, - 0x081cf000, - 0x081e2003, - 0x081eb029, - 0x0824f001, - 0x08255005, - 0x0826a003, - 0x0827e003, - 0x08294007, - 0x082b200a, - 0x082bd800, - 0x082c5800, - 0x082c9800, - 0x082cb000, - 0x082d1000, - 0x082d9000, - 0x082dd000, - 0x082de842, - 0x0839b808, - 0x083ab009, - 0x083b4017, - 0x083c3000, - 0x083d8800, - 0x083dd844, - 0x08403001, - 0x08404800, - 0x0841b000, - 0x0841c802, - 0x0841e801, - 0x0842b000, - 0x0844f807, - 0x0845802f, - 0x08479800, - 0x0847b004, - 0x0848e002, - 0x0849d004, - 0x084a003f, - 0x084dc003, - 0x084e8001, - 0x0850080e, - 0x0850a000, - 0x0850c000, - 0x0851b009, - 0x08524806, - 0x0852c806, - 0x0855001f, - 0x08572805, - 0x0857b808, - 0x0859b002, - 0x085ab001, - 0x085b9804, - 0x085c9006, - 0x085ce80b, - 0x085d804f, - 0x08624836, - 0x0865980c, - 0x08679806, - 0x0869200b, - 0x0869d125, - 0x0873f800, - 0x08755002, - 0x08757001, - 0x0875904d, - 0x08794007, - 0x087a300a, - 0x087ad015, - 0x087c1003, - 0x087c5025, - 0x087e6013, - 0x087fb808, - 0x08800800, - 0x0881c00e, - 0x08827003, - 0x08838000, - 0x08839801, - 0x0883b00b, - 0x08859803, - 0x0885c801, - 0x0885e800, - 0x0886100d, - 0x08874806, - 0x0887d008, - 0x08893804, - 0x08896808, - 0x088a4007, - 0x088b9800, - 0x088bb80a, - 0x088db008, - 0x088e4803, - 0x088e7800, - 0x088f0000, - 0x088fa80a, - 0x08909000, - 0x08917802, - 0x0891a000, - 0x0891b001, - 0x0891f000, - 0x0892083e, - 0x08943800, - 0x08944800, - 0x08947000, - 0x0894f000, - 0x08955005, - 0x0896f800, - 0x0897180c, - 0x0897d007, - 0x08982000, - 0x08986801, - 0x08988801, - 0x08994800, - 0x08998800, - 0x0899a000, - 0x0899d002, - 0x0899f000, - 0x089a0000, - 0x089a2801, - 0x089a4801, - 0x089a7001, - 0x089a880b, - 0x089b209b, - 0x08a1c007, - 0x08a21002, - 0x08a23000, - 0x08a2e000, - 0x08a2f000, - 0x08a3101d, - 0x08a58000, - 0x08a59805, - 0x08a5d000, - 0x08a5e800, - 0x08a5f801, - 0x08a61001, - 0x08a64007, - 0x08a6d0a5, - 0x08ad7800, - 0x08ad9005, - 0x08ade001, - 0x08adf801, - 0x08aee023, - 0x08b19807, - 0x08b1e800, - 0x08b1f801, - 0x08b2280a, - 0x08b2d005, - 0x08b36812, - 0x08b55800, - 0x08b56800, - 0x08b58005, - 0x08b5b800, - 0x08b5d005, - 0x08b65035, - 0x08b8d804, - 0x08b91003, - 0x08b93808, - 0x08ba38b8, - 0x08c17808, - 0x08c1c801, - 0x08c1e063, - 0x08c7980b, - 0x08c83801, - 0x08c85001, - 0x08c8a000, - 0x08c8b800, - 0x08c98000, - 0x08c9b000, - 0x08c9c803, - 0x08c9f000, - 0x08ca1800, - 0x08ca3808, - 0x08cad045, - 0x08cd4001, - 0x08cea007, - 0x08cf0000, - 0x08cf281a, - 0x08d00809, - 0x08d19805, - 0x08d1d803, - 0x08d23808, - 0x08d28805, - 0x08d2c802, - 0x08d4500c, - 0x08d4c001, - 0x08d5180c, - 0x08d7c806, - 0x08d850f5, - 0x08e04800, - 0x08e1800d, - 0x08e1f800, - 0x08e23009, - 0x08e36802, - 0x08e48018, - 0x08e55006, - 0x08e59001, - 0x08e5a84a, - 0x08e83800, - 0x08e85000, - 0x08e98814, - 0x08ea3808, - 0x08ead005, - 0x08eb3000, - 0x08eb4800, - 0x08ec7803, - 0x08eca800, - 0x08ecb800, - 0x08ecc806, - 0x08ed5135, - 0x08f79801, - 0x08f7c808, - 0x08f88800, - 0x08f9b007, - 0x08fa0000, - 0x08fa1000, - 0x08fad055, - 0x08fd880e, - 0x08ff900c, - 0x091cd065, - 0x09237800, - 0x0923a80a, - 0x092a27ff, - 0x096a224b, - 0x097f980c, - 0x09a18010, - 0x09a23fff, - 0x09e23fb8, - 0x0a323fff, - 0x0a723fff, - 0x0ab23fff, - 0x0af23fff, - 0x0b3239b8, - 0x0b51c806, - 0x0b52f800, - 0x0b535003, - 0x0b55f800, - 0x0b565005, - 0x0b577006, - 0x0b57b009, - 0x0b598006, - 0x0b5a3009, - 0x0b5ad000, - 0x0b5b1000, - 0x0b5bc004, - 0x0b5c82af, - 0x0b74d864, - 0x0b7a5804, - 0x0b7c400a, - 0x0b7d003f, - 0x0b7f200b, - 0x0b7f900d, - 0x0c3fc007, - 0x0c66b029, - 0x0c684fff, - 0x0ca84fff, - 0x0ce84fff, - 0x0d284fff, - 0x0d684ae6, - 0x0d7fa000, - 0x0d7fe000, - 0x0d7ff800, - 0x0d89180e, - 0x0d89981c, - 0x0d8a9801, - 0x0d8ab00d, - 0x0d8b4007, - 0x0d97e7ff, - 0x0dd7e103, - 0x0de35804, - 0x0de3e802, - 0x0de44806, - 0x0de4d001, - 0x0de4e801, - 0x0de507ff, - 0x0e2507ff, - 0x0e6502af, - 0x0e7e203b, - 0x0e87b009, - 0x0e893801, - 0x0e8b2800, - 0x0e8b3802, - 0x0e8b7014, - 0x0e8c2806, - 0x0e8d5003, - 0x0e8f5814, - 0x0e921002, - 0x0e923079, - 0x0e96a00b, - 0x0e97a00b, - 0x0e9ab808, - 0x0e9bc886, - 0x0ea2a800, - 0x0ea4e800, - 0x0ea50001, - 0x0ea51801, - 0x0ea53801, - 0x0ea56800, - 0x0ea5d000, - 0x0ea5e000, - 0x0ea62000, - 0x0ea83000, - 0x0ea85801, - 0x0ea8a800, - 0x0ea8e800, - 0x0ea9d000, - 0x0ea9f800, - 0x0eaa2800, - 0x0eaa3802, - 0x0eaa8800, - 0x0eb53001, - 0x0ebe6001, - 0x0ed00036, - 0x0ed1d831, - 0x0ed3a800, - 0x0ed42000, - 0x0ed46473, - 0x0ef8f805, - 0x0ef95904, - 0x0f037091, - 0x0f096809, - 0x0f09f001, - 0x0f0a5003, - 0x0f0a813f, - 0x0f157011, - 0x0f176003, - 0x0f17d004, - 0x0f1801cf, - 0x0f276003, - 0x0f27d2e5, - 0x0f3f3800, - 0x0f3f6000, - 0x0f3f7800, - 0x0f3ff800, - 0x0f462801, - 0x0f46802f, - 0x0f4a2006, - 0x0f4a6003, - 0x0f4ad003, - 0x0f4b0310, - 0x0f65a84b, - 0x0f69f0c1, - 0x0f702000, - 0x0f710000, - 0x0f711800, - 0x0f712801, - 0x0f714000, - 0x0f719800, - 0x0f71c000, - 0x0f71d000, - 0x0f71e005, - 0x0f721803, - 0x0f724000, - 0x0f725000, - 0x0f726000, - 0x0f728000, - 0x0f729800, - 0x0f72a801, - 0x0f72c000, - 0x0f72d000, - 0x0f72e000, - 0x0f72f000, - 0x0f730000, - 0x0f731800, - 0x0f732801, - 0x0f735800, - 0x0f739800, - 0x0f73c000, - 0x0f73e800, - 0x0f73f800, - 0x0f745000, - 0x0f74e004, - 0x0f752000, - 0x0f755000, - 0x0f75e033, - 0x0f77910d, - 0x0f816003, - 0x0f84a00b, - 0x0f857801, - 0x0f860000, - 0x0f868000, - 0x0f87b009, - 0x0f8d7037, - 0x0f90180c, - 0x0f91e003, - 0x0f924806, - 0x0f92900d, - 0x0f933099, - 0x0fb6c003, - 0x0fb76802, - 0x0fb7e802, - 0x0fbbb803, - 0x0fbed005, - 0x0fbf6003, - 0x0fbf880e, - 0x0fc06003, - 0x0fc24007, - 0x0fc2d005, - 0x0fc44007, - 0x0fc57001, - 0x0fc5904d, - 0x0fd2a00b, - 0x0fd37001, - 0x0fd3e802, - 0x0fd44806, - 0x0fd5f000, - 0x0fd63007, - 0x0fd6e003, - 0x0fd74806, - 0x0fd7c806, - 0x0fdc9800, - 0x0fde5824, - 0x0fdfd405, - 0x1537001f, - 0x15b9d005, - 0x15c0f001, - 0x1675100d, - 0x175f0fff, - 0x179f0c1e, - 0x17d0f5e1, - 0x189a5804}; +/// - bits [0, 13] The size of the range, allowing 16384 elements. +/// - bits [14, 31] The lower bound code point of the range. The upper bound of +/// the range is lower bound + size. Note the code expects code units the fit +/// into 18 bits, instead of the 21 bits needed for the full Unicode range. +_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[711] = { + 0x00000020 /* 00000000 - 00000020 [ 33] */, + 0x001fc021 /* 0000007f - 000000a0 [ 34] */, + 0x002b4000 /* 000000ad - 000000ad [ 1] */, + 0x00de0001 /* 00000378 - 00000379 [ 2] */, + 0x00e00003 /* 00000380 - 00000383 [ 4] */, + 0x00e2c000 /* 0000038b - 0000038b [ 1] */, + 0x00e34000 /* 0000038d - 0000038d [ 1] */, + 0x00e88000 /* 000003a2 - 000003a2 [ 1] */, + 0x014c0000 /* 00000530 - 00000530 [ 1] */, + 0x0155c001 /* 00000557 - 00000558 [ 2] */, + 0x0162c001 /* 0000058b - 0000058c [ 2] */, + 0x01640000 /* 00000590 - 00000590 [ 1] */, + 0x01720007 /* 000005c8 - 000005cf [ 8] */, + 0x017ac003 /* 000005eb - 000005ee [ 4] */, + 0x017d4010 /* 000005f5 - 00000605 [ 17] */, + 0x01870000 /* 0000061c - 0000061c [ 1] */, + 0x01b74000 /* 000006dd - 000006dd [ 1] */, + 0x01c38001 /* 0000070e - 0000070f [ 2] */, + 0x01d2c001 /* 0000074b - 0000074c [ 2] */, + 0x01ec800d /* 000007b2 - 000007bf [ 14] */, + 0x01fec001 /* 000007fb - 000007fc [ 2] */, + 0x020b8001 /* 0000082e - 0000082f [ 2] */, + 0x020fc000 /* 0000083f - 0000083f [ 1] */, + 0x02170001 /* 0000085c - 0000085d [ 2] */, + 0x0217c000 /* 0000085f - 0000085f [ 1] */, + 0x021ac004 /* 0000086b - 0000086f [ 5] */, + 0x0223c008 /* 0000088f - 00000897 [ 9] */, + 0x02388000 /* 000008e2 - 000008e2 [ 1] */, + 0x02610000 /* 00000984 - 00000984 [ 1] */, + 0x02634001 /* 0000098d - 0000098e [ 2] */, + 0x02644001 /* 00000991 - 00000992 [ 2] */, + 0x026a4000 /* 000009a9 - 000009a9 [ 1] */, + 0x026c4000 /* 000009b1 - 000009b1 [ 1] */, + 0x026cc002 /* 000009b3 - 000009b5 [ 3] */, + 0x026e8001 /* 000009ba - 000009bb [ 2] */, + 0x02714001 /* 000009c5 - 000009c6 [ 2] */, + 0x02724001 /* 000009c9 - 000009ca [ 2] */, + 0x0273c007 /* 000009cf - 000009d6 [ 8] */, + 0x02760003 /* 000009d8 - 000009db [ 4] */, + 0x02778000 /* 000009de - 000009de [ 1] */, + 0x02790001 /* 000009e4 - 000009e5 [ 2] */, + 0x027fc001 /* 000009ff - 00000a00 [ 2] */, + 0x02810000 /* 00000a04 - 00000a04 [ 1] */, + 0x0282c003 /* 00000a0b - 00000a0e [ 4] */, + 0x02844001 /* 00000a11 - 00000a12 [ 2] */, + 0x028a4000 /* 00000a29 - 00000a29 [ 1] */, + 0x028c4000 /* 00000a31 - 00000a31 [ 1] */, + 0x028d0000 /* 00000a34 - 00000a34 [ 1] */, + 0x028dc000 /* 00000a37 - 00000a37 [ 1] */, + 0x028e8001 /* 00000a3a - 00000a3b [ 2] */, + 0x028f4000 /* 00000a3d - 00000a3d [ 1] */, + 0x0290c003 /* 00000a43 - 00000a46 [ 4] */, + 0x02924001 /* 00000a49 - 00000a4a [ 2] */, + 0x02938002 /* 00000a4e - 00000a50 [ 3] */, + 0x02948006 /* 00000a52 - 00000a58 [ 7] */, + 0x02974000 /* 00000a5d - 00000a5d [ 1] */, + 0x0297c006 /* 00000a5f - 00000a65 [ 7] */, + 0x029dc009 /* 00000a77 - 00000a80 [ 10] */, + 0x02a10000 /* 00000a84 - 00000a84 [ 1] */, + 0x02a38000 /* 00000a8e - 00000a8e [ 1] */, + 0x02a48000 /* 00000a92 - 00000a92 [ 1] */, + 0x02aa4000 /* 00000aa9 - 00000aa9 [ 1] */, + 0x02ac4000 /* 00000ab1 - 00000ab1 [ 1] */, + 0x02ad0000 /* 00000ab4 - 00000ab4 [ 1] */, + 0x02ae8001 /* 00000aba - 00000abb [ 2] */, + 0x02b18000 /* 00000ac6 - 00000ac6 [ 1] */, + 0x02b28000 /* 00000aca - 00000aca [ 1] */, + 0x02b38001 /* 00000ace - 00000acf [ 2] */, + 0x02b4400e /* 00000ad1 - 00000adf [ 15] */, + 0x02b90001 /* 00000ae4 - 00000ae5 [ 2] */, + 0x02bc8006 /* 00000af2 - 00000af8 [ 7] */, + 0x02c00000 /* 00000b00 - 00000b00 [ 1] */, + 0x02c10000 /* 00000b04 - 00000b04 [ 1] */, + 0x02c34001 /* 00000b0d - 00000b0e [ 2] */, + 0x02c44001 /* 00000b11 - 00000b12 [ 2] */, + 0x02ca4000 /* 00000b29 - 00000b29 [ 1] */, + 0x02cc4000 /* 00000b31 - 00000b31 [ 1] */, + 0x02cd0000 /* 00000b34 - 00000b34 [ 1] */, + 0x02ce8001 /* 00000b3a - 00000b3b [ 2] */, + 0x02d14001 /* 00000b45 - 00000b46 [ 2] */, + 0x02d24001 /* 00000b49 - 00000b4a [ 2] */, + 0x02d38006 /* 00000b4e - 00000b54 [ 7] */, + 0x02d60003 /* 00000b58 - 00000b5b [ 4] */, + 0x02d78000 /* 00000b5e - 00000b5e [ 1] */, + 0x02d90001 /* 00000b64 - 00000b65 [ 2] */, + 0x02de0009 /* 00000b78 - 00000b81 [ 10] */, + 0x02e10000 /* 00000b84 - 00000b84 [ 1] */, + 0x02e2c002 /* 00000b8b - 00000b8d [ 3] */, + 0x02e44000 /* 00000b91 - 00000b91 [ 1] */, + 0x02e58002 /* 00000b96 - 00000b98 [ 3] */, + 0x02e6c000 /* 00000b9b - 00000b9b [ 1] */, + 0x02e74000 /* 00000b9d - 00000b9d [ 1] */, + 0x02e80002 /* 00000ba0 - 00000ba2 [ 3] */, + 0x02e94002 /* 00000ba5 - 00000ba7 [ 3] */, + 0x02eac002 /* 00000bab - 00000bad [ 3] */, + 0x02ee8003 /* 00000bba - 00000bbd [ 4] */, + 0x02f0c002 /* 00000bc3 - 00000bc5 [ 3] */, + 0x02f24000 /* 00000bc9 - 00000bc9 [ 1] */, + 0x02f38001 /* 00000bce - 00000bcf [ 2] */, + 0x02f44005 /* 00000bd1 - 00000bd6 [ 6] */, + 0x02f6000d /* 00000bd8 - 00000be5 [ 14] */, + 0x02fec004 /* 00000bfb - 00000bff [ 5] */, + 0x03034000 /* 00000c0d - 00000c0d [ 1] */, + 0x03044000 /* 00000c11 - 00000c11 [ 1] */, + 0x030a4000 /* 00000c29 - 00000c29 [ 1] */, + 0x030e8001 /* 00000c3a - 00000c3b [ 2] */, + 0x03114000 /* 00000c45 - 00000c45 [ 1] */, + 0x03124000 /* 00000c49 - 00000c49 [ 1] */, + 0x03138006 /* 00000c4e - 00000c54 [ 7] */, + 0x0315c000 /* 00000c57 - 00000c57 [ 1] */, + 0x0316c001 /* 00000c5b - 00000c5c [ 2] */, + 0x03178001 /* 00000c5e - 00000c5f [ 2] */, + 0x03190001 /* 00000c64 - 00000c65 [ 2] */, + 0x031c0006 /* 00000c70 - 00000c76 [ 7] */, + 0x03234000 /* 00000c8d - 00000c8d [ 1] */, + 0x03244000 /* 00000c91 - 00000c91 [ 1] */, + 0x032a4000 /* 00000ca9 - 00000ca9 [ 1] */, + 0x032d0000 /* 00000cb4 - 00000cb4 [ 1] */, + 0x032e8001 /* 00000cba - 00000cbb [ 2] */, + 0x03314000 /* 00000cc5 - 00000cc5 [ 1] */, + 0x03324000 /* 00000cc9 - 00000cc9 [ 1] */, + 0x03338006 /* 00000cce - 00000cd4 [ 7] */, + 0x0335c005 /* 00000cd7 - 00000cdc [ 6] */, + 0x0337c000 /* 00000cdf - 00000cdf [ 1] */, + 0x03390001 /* 00000ce4 - 00000ce5 [ 2] */, + 0x033c0000 /* 00000cf0 - 00000cf0 [ 1] */, + 0x033d000b /* 00000cf4 - 00000cff [ 12] */, + 0x03434000 /* 00000d0d - 00000d0d [ 1] */, + 0x03444000 /* 00000d11 - 00000d11 [ 1] */, + 0x03514000 /* 00000d45 - 00000d45 [ 1] */, + 0x03524000 /* 00000d49 - 00000d49 [ 1] */, + 0x03540003 /* 00000d50 - 00000d53 [ 4] */, + 0x03590001 /* 00000d64 - 00000d65 [ 2] */, + 0x03600000 /* 00000d80 - 00000d80 [ 1] */, + 0x03610000 /* 00000d84 - 00000d84 [ 1] */, + 0x0365c002 /* 00000d97 - 00000d99 [ 3] */, + 0x036c8000 /* 00000db2 - 00000db2 [ 1] */, + 0x036f0000 /* 00000dbc - 00000dbc [ 1] */, + 0x036f8001 /* 00000dbe - 00000dbf [ 2] */, + 0x0371c002 /* 00000dc7 - 00000dc9 [ 3] */, + 0x0372c003 /* 00000dcb - 00000dce [ 4] */, + 0x03754000 /* 00000dd5 - 00000dd5 [ 1] */, + 0x0375c000 /* 00000dd7 - 00000dd7 [ 1] */, + 0x03780005 /* 00000de0 - 00000de5 [ 6] */, + 0x037c0001 /* 00000df0 - 00000df1 [ 2] */, + 0x037d400b /* 00000df5 - 00000e00 [ 12] */, + 0x038ec003 /* 00000e3b - 00000e3e [ 4] */, + 0x03970024 /* 00000e5c - 00000e80 [ 37] */, + 0x03a0c000 /* 00000e83 - 00000e83 [ 1] */, + 0x03a14000 /* 00000e85 - 00000e85 [ 1] */, + 0x03a2c000 /* 00000e8b - 00000e8b [ 1] */, + 0x03a90000 /* 00000ea4 - 00000ea4 [ 1] */, + 0x03a98000 /* 00000ea6 - 00000ea6 [ 1] */, + 0x03af8001 /* 00000ebe - 00000ebf [ 2] */, + 0x03b14000 /* 00000ec5 - 00000ec5 [ 1] */, + 0x03b1c000 /* 00000ec7 - 00000ec7 [ 1] */, + 0x03b3c000 /* 00000ecf - 00000ecf [ 1] */, + 0x03b68001 /* 00000eda - 00000edb [ 2] */, + 0x03b8001f /* 00000ee0 - 00000eff [ 32] */, + 0x03d20000 /* 00000f48 - 00000f48 [ 1] */, + 0x03db4003 /* 00000f6d - 00000f70 [ 4] */, + 0x03e60000 /* 00000f98 - 00000f98 [ 1] */, + 0x03ef4000 /* 00000fbd - 00000fbd [ 1] */, + 0x03f34000 /* 00000fcd - 00000fcd [ 1] */, + 0x03f6c024 /* 00000fdb - 00000fff [ 37] */, + 0x04318000 /* 000010c6 - 000010c6 [ 1] */, + 0x04320004 /* 000010c8 - 000010cc [ 5] */, + 0x04338001 /* 000010ce - 000010cf [ 2] */, + 0x04924000 /* 00001249 - 00001249 [ 1] */, + 0x04938001 /* 0000124e - 0000124f [ 2] */, + 0x0495c000 /* 00001257 - 00001257 [ 1] */, + 0x04964000 /* 00001259 - 00001259 [ 1] */, + 0x04978001 /* 0000125e - 0000125f [ 2] */, + 0x04a24000 /* 00001289 - 00001289 [ 1] */, + 0x04a38001 /* 0000128e - 0000128f [ 2] */, + 0x04ac4000 /* 000012b1 - 000012b1 [ 1] */, + 0x04ad8001 /* 000012b6 - 000012b7 [ 2] */, + 0x04afc000 /* 000012bf - 000012bf [ 1] */, + 0x04b04000 /* 000012c1 - 000012c1 [ 1] */, + 0x04b18001 /* 000012c6 - 000012c7 [ 2] */, + 0x04b5c000 /* 000012d7 - 000012d7 [ 1] */, + 0x04c44000 /* 00001311 - 00001311 [ 1] */, + 0x04c58001 /* 00001316 - 00001317 [ 2] */, + 0x04d6c001 /* 0000135b - 0000135c [ 2] */, + 0x04df4002 /* 0000137d - 0000137f [ 3] */, + 0x04e68005 /* 0000139a - 0000139f [ 6] */, + 0x04fd8001 /* 000013f6 - 000013f7 [ 2] */, + 0x04ff8001 /* 000013fe - 000013ff [ 2] */, + 0x05a00000 /* 00001680 - 00001680 [ 1] */, + 0x05a74002 /* 0000169d - 0000169f [ 3] */, + 0x05be4006 /* 000016f9 - 000016ff [ 7] */, + 0x05c58008 /* 00001716 - 0000171e [ 9] */, + 0x05cdc008 /* 00001737 - 0000173f [ 9] */, + 0x05d5000b /* 00001754 - 0000175f [ 12] */, + 0x05db4000 /* 0000176d - 0000176d [ 1] */, + 0x05dc4000 /* 00001771 - 00001771 [ 1] */, + 0x05dd000b /* 00001774 - 0000177f [ 12] */, + 0x05f78001 /* 000017de - 000017df [ 2] */, + 0x05fa8005 /* 000017ea - 000017ef [ 6] */, + 0x05fe8005 /* 000017fa - 000017ff [ 6] */, + 0x06038000 /* 0000180e - 0000180e [ 1] */, + 0x06068005 /* 0000181a - 0000181f [ 6] */, + 0x061e4006 /* 00001879 - 0000187f [ 7] */, + 0x062ac004 /* 000018ab - 000018af [ 5] */, + 0x063d8009 /* 000018f6 - 000018ff [ 10] */, + 0x0647c000 /* 0000191f - 0000191f [ 1] */, + 0x064b0003 /* 0000192c - 0000192f [ 4] */, + 0x064f0003 /* 0000193c - 0000193f [ 4] */, + 0x06504002 /* 00001941 - 00001943 [ 3] */, + 0x065b8001 /* 0000196e - 0000196f [ 2] */, + 0x065d400a /* 00001975 - 0000197f [ 11] */, + 0x066b0003 /* 000019ac - 000019af [ 4] */, + 0x06728005 /* 000019ca - 000019cf [ 6] */, + 0x0676c002 /* 000019db - 000019dd [ 3] */, + 0x06870001 /* 00001a1c - 00001a1d [ 2] */, + 0x0697c000 /* 00001a5f - 00001a5f [ 1] */, + 0x069f4001 /* 00001a7d - 00001a7e [ 2] */, + 0x06a28005 /* 00001a8a - 00001a8f [ 6] */, + 0x06a68005 /* 00001a9a - 00001a9f [ 6] */, + 0x06ab8001 /* 00001aae - 00001aaf [ 2] */, + 0x06b3c030 /* 00001acf - 00001aff [ 49] */, + 0x06d34002 /* 00001b4d - 00001b4f [ 3] */, + 0x06dfc000 /* 00001b7f - 00001b7f [ 1] */, + 0x06fd0007 /* 00001bf4 - 00001bfb [ 8] */, + 0x070e0002 /* 00001c38 - 00001c3a [ 3] */, + 0x07128002 /* 00001c4a - 00001c4c [ 3] */, + 0x07224006 /* 00001c89 - 00001c8f [ 7] */, + 0x072ec001 /* 00001cbb - 00001cbc [ 2] */, + 0x07320007 /* 00001cc8 - 00001ccf [ 8] */, + 0x073ec004 /* 00001cfb - 00001cff [ 5] */, + 0x07c58001 /* 00001f16 - 00001f17 [ 2] */, + 0x07c78001 /* 00001f1e - 00001f1f [ 2] */, + 0x07d18001 /* 00001f46 - 00001f47 [ 2] */, + 0x07d38001 /* 00001f4e - 00001f4f [ 2] */, + 0x07d60000 /* 00001f58 - 00001f58 [ 1] */, + 0x07d68000 /* 00001f5a - 00001f5a [ 1] */, + 0x07d70000 /* 00001f5c - 00001f5c [ 1] */, + 0x07d78000 /* 00001f5e - 00001f5e [ 1] */, + 0x07df8001 /* 00001f7e - 00001f7f [ 2] */, + 0x07ed4000 /* 00001fb5 - 00001fb5 [ 1] */, + 0x07f14000 /* 00001fc5 - 00001fc5 [ 1] */, + 0x07f50001 /* 00001fd4 - 00001fd5 [ 2] */, + 0x07f70000 /* 00001fdc - 00001fdc [ 1] */, + 0x07fc0001 /* 00001ff0 - 00001ff1 [ 2] */, + 0x07fd4000 /* 00001ff5 - 00001ff5 [ 1] */, + 0x07ffc010 /* 00001fff - 0000200f [ 17] */, + 0x080a0007 /* 00002028 - 0000202f [ 8] */, + 0x0817c010 /* 0000205f - 0000206f [ 17] */, + 0x081c8001 /* 00002072 - 00002073 [ 2] */, + 0x0823c000 /* 0000208f - 0000208f [ 1] */, + 0x08274002 /* 0000209d - 0000209f [ 3] */, + 0x0830400e /* 000020c1 - 000020cf [ 15] */, + 0x083c400e /* 000020f1 - 000020ff [ 15] */, + 0x08630003 /* 0000218c - 0000218f [ 4] */, + 0x0909c018 /* 00002427 - 0000243f [ 25] */, + 0x0912c014 /* 0000244b - 0000245f [ 21] */, + 0x0add0001 /* 00002b74 - 00002b75 [ 2] */, + 0x0ae58000 /* 00002b96 - 00002b96 [ 1] */, + 0x0b3d0004 /* 00002cf4 - 00002cf8 [ 5] */, + 0x0b498000 /* 00002d26 - 00002d26 [ 1] */, + 0x0b4a0004 /* 00002d28 - 00002d2c [ 5] */, + 0x0b4b8001 /* 00002d2e - 00002d2f [ 2] */, + 0x0b5a0006 /* 00002d68 - 00002d6e [ 7] */, + 0x0b5c400d /* 00002d71 - 00002d7e [ 14] */, + 0x0b65c008 /* 00002d97 - 00002d9f [ 9] */, + 0x0b69c000 /* 00002da7 - 00002da7 [ 1] */, + 0x0b6bc000 /* 00002daf - 00002daf [ 1] */, + 0x0b6dc000 /* 00002db7 - 00002db7 [ 1] */, + 0x0b6fc000 /* 00002dbf - 00002dbf [ 1] */, + 0x0b71c000 /* 00002dc7 - 00002dc7 [ 1] */, + 0x0b73c000 /* 00002dcf - 00002dcf [ 1] */, + 0x0b75c000 /* 00002dd7 - 00002dd7 [ 1] */, + 0x0b77c000 /* 00002ddf - 00002ddf [ 1] */, + 0x0b978021 /* 00002e5e - 00002e7f [ 34] */, + 0x0ba68000 /* 00002e9a - 00002e9a [ 1] */, + 0x0bbd000b /* 00002ef4 - 00002eff [ 12] */, + 0x0bf58019 /* 00002fd6 - 00002fef [ 26] */, + 0x0c000000 /* 00003000 - 00003000 [ 1] */, + 0x0c100000 /* 00003040 - 00003040 [ 1] */, + 0x0c25c001 /* 00003097 - 00003098 [ 2] */, + 0x0c400004 /* 00003100 - 00003104 [ 5] */, + 0x0c4c0000 /* 00003130 - 00003130 [ 1] */, + 0x0c63c000 /* 0000318f - 0000318f [ 1] */, + 0x0c79000a /* 000031e4 - 000031ee [ 11] */, + 0x0c87c000 /* 0000321f - 0000321f [ 1] */, + 0x29234002 /* 0000a48d - 0000a48f [ 3] */, + 0x2931c008 /* 0000a4c7 - 0000a4cf [ 9] */, + 0x298b0013 /* 0000a62c - 0000a63f [ 20] */, + 0x29be0007 /* 0000a6f8 - 0000a6ff [ 8] */, + 0x29f2c004 /* 0000a7cb - 0000a7cf [ 5] */, + 0x29f48000 /* 0000a7d2 - 0000a7d2 [ 1] */, + 0x29f50000 /* 0000a7d4 - 0000a7d4 [ 1] */, + 0x29f68017 /* 0000a7da - 0000a7f1 [ 24] */, + 0x2a0b4002 /* 0000a82d - 0000a82f [ 3] */, + 0x2a0e8005 /* 0000a83a - 0000a83f [ 6] */, + 0x2a1e0007 /* 0000a878 - 0000a87f [ 8] */, + 0x2a318007 /* 0000a8c6 - 0000a8cd [ 8] */, + 0x2a368005 /* 0000a8da - 0000a8df [ 6] */, + 0x2a55000a /* 0000a954 - 0000a95e [ 11] */, + 0x2a5f4002 /* 0000a97d - 0000a97f [ 3] */, + 0x2a738000 /* 0000a9ce - 0000a9ce [ 1] */, + 0x2a768003 /* 0000a9da - 0000a9dd [ 4] */, + 0x2a7fc000 /* 0000a9ff - 0000a9ff [ 1] */, + 0x2a8dc008 /* 0000aa37 - 0000aa3f [ 9] */, + 0x2a938001 /* 0000aa4e - 0000aa4f [ 2] */, + 0x2a968001 /* 0000aa5a - 0000aa5b [ 2] */, + 0x2ab0c017 /* 0000aac3 - 0000aada [ 24] */, + 0x2abdc009 /* 0000aaf7 - 0000ab00 [ 10] */, + 0x2ac1c001 /* 0000ab07 - 0000ab08 [ 2] */, + 0x2ac3c001 /* 0000ab0f - 0000ab10 [ 2] */, + 0x2ac5c008 /* 0000ab17 - 0000ab1f [ 9] */, + 0x2ac9c000 /* 0000ab27 - 0000ab27 [ 1] */, + 0x2acbc000 /* 0000ab2f - 0000ab2f [ 1] */, + 0x2adb0003 /* 0000ab6c - 0000ab6f [ 4] */, + 0x2afb8001 /* 0000abee - 0000abef [ 2] */, + 0x2afe8005 /* 0000abfa - 0000abff [ 6] */, + 0x35e9000b /* 0000d7a4 - 0000d7af [ 12] */, + 0x35f1c003 /* 0000d7c7 - 0000d7ca [ 4] */, + 0x35ff2103 /* 0000d7fc - 0000f8ff [ 8452] */, + 0x3e9b8001 /* 0000fa6e - 0000fa6f [ 2] */, + 0x3eb68025 /* 0000fada - 0000faff [ 38] */, + 0x3ec1c00b /* 0000fb07 - 0000fb12 [ 12] */, + 0x3ec60004 /* 0000fb18 - 0000fb1c [ 5] */, + 0x3ecdc000 /* 0000fb37 - 0000fb37 [ 1] */, + 0x3ecf4000 /* 0000fb3d - 0000fb3d [ 1] */, + 0x3ecfc000 /* 0000fb3f - 0000fb3f [ 1] */, + 0x3ed08000 /* 0000fb42 - 0000fb42 [ 1] */, + 0x3ed14000 /* 0000fb45 - 0000fb45 [ 1] */, + 0x3ef0c00f /* 0000fbc3 - 0000fbd2 [ 16] */, + 0x3f640001 /* 0000fd90 - 0000fd91 [ 2] */, + 0x3f720006 /* 0000fdc8 - 0000fdce [ 7] */, + 0x3f74001f /* 0000fdd0 - 0000fdef [ 32] */, + 0x3f868005 /* 0000fe1a - 0000fe1f [ 6] */, + 0x3f94c000 /* 0000fe53 - 0000fe53 [ 1] */, + 0x3f99c000 /* 0000fe67 - 0000fe67 [ 1] */, + 0x3f9b0003 /* 0000fe6c - 0000fe6f [ 4] */, + 0x3f9d4000 /* 0000fe75 - 0000fe75 [ 1] */, + 0x3fbf4003 /* 0000fefd - 0000ff00 [ 4] */, + 0x3fefc002 /* 0000ffbf - 0000ffc1 [ 3] */, + 0x3ff20001 /* 0000ffc8 - 0000ffc9 [ 2] */, + 0x3ff40001 /* 0000ffd0 - 0000ffd1 [ 2] */, + 0x3ff60001 /* 0000ffd8 - 0000ffd9 [ 2] */, + 0x3ff74002 /* 0000ffdd - 0000ffdf [ 3] */, + 0x3ff9c000 /* 0000ffe7 - 0000ffe7 [ 1] */, + 0x3ffbc00c /* 0000ffef - 0000fffb [ 13] */, + 0x3fff8001 /* 0000fffe - 0000ffff [ 2] */, + 0x40030000 /* 0001000c - 0001000c [ 1] */, + 0x4009c000 /* 00010027 - 00010027 [ 1] */, + 0x400ec000 /* 0001003b - 0001003b [ 1] */, + 0x400f8000 /* 0001003e - 0001003e [ 1] */, + 0x40138001 /* 0001004e - 0001004f [ 2] */, + 0x40178021 /* 0001005e - 0001007f [ 34] */, + 0x403ec004 /* 000100fb - 000100ff [ 5] */, + 0x4040c003 /* 00010103 - 00010106 [ 4] */, + 0x404d0002 /* 00010134 - 00010136 [ 3] */, + 0x4063c000 /* 0001018f - 0001018f [ 1] */, + 0x40674002 /* 0001019d - 0001019f [ 3] */, + 0x4068402e /* 000101a1 - 000101cf [ 47] */, + 0x407f8081 /* 000101fe - 0001027f [ 130] */, + 0x40a74002 /* 0001029d - 0001029f [ 3] */, + 0x40b4400e /* 000102d1 - 000102df [ 15] */, + 0x40bf0003 /* 000102fc - 000102ff [ 4] */, + 0x40c90008 /* 00010324 - 0001032c [ 9] */, + 0x40d2c004 /* 0001034b - 0001034f [ 5] */, + 0x40dec004 /* 0001037b - 0001037f [ 5] */, + 0x40e78000 /* 0001039e - 0001039e [ 1] */, + 0x40f10003 /* 000103c4 - 000103c7 [ 4] */, + 0x40f58029 /* 000103d6 - 000103ff [ 42] */, + 0x41278001 /* 0001049e - 0001049f [ 2] */, + 0x412a8005 /* 000104aa - 000104af [ 6] */, + 0x41350003 /* 000104d4 - 000104d7 [ 4] */, + 0x413f0003 /* 000104fc - 000104ff [ 4] */, + 0x414a0007 /* 00010528 - 0001052f [ 8] */, + 0x4159000a /* 00010564 - 0001056e [ 11] */, + 0x415ec000 /* 0001057b - 0001057b [ 1] */, + 0x4162c000 /* 0001058b - 0001058b [ 1] */, + 0x4164c000 /* 00010593 - 00010593 [ 1] */, + 0x41658000 /* 00010596 - 00010596 [ 1] */, + 0x41688000 /* 000105a2 - 000105a2 [ 1] */, + 0x416c8000 /* 000105b2 - 000105b2 [ 1] */, + 0x416e8000 /* 000105ba - 000105ba [ 1] */, + 0x416f4042 /* 000105bd - 000105ff [ 67] */, + 0x41cdc008 /* 00010737 - 0001073f [ 9] */, + 0x41d58009 /* 00010756 - 0001075f [ 10] */, + 0x41da0017 /* 00010768 - 0001077f [ 24] */, + 0x41e18000 /* 00010786 - 00010786 [ 1] */, + 0x41ec4000 /* 000107b1 - 000107b1 [ 1] */, + 0x41eec044 /* 000107bb - 000107ff [ 69] */, + 0x42018001 /* 00010806 - 00010807 [ 2] */, + 0x42024000 /* 00010809 - 00010809 [ 1] */, + 0x420d8000 /* 00010836 - 00010836 [ 1] */, + 0x420e4002 /* 00010839 - 0001083b [ 3] */, + 0x420f4001 /* 0001083d - 0001083e [ 2] */, + 0x42158000 /* 00010856 - 00010856 [ 1] */, + 0x4227c007 /* 0001089f - 000108a6 [ 8] */, + 0x422c002f /* 000108b0 - 000108df [ 48] */, + 0x423cc000 /* 000108f3 - 000108f3 [ 1] */, + 0x423d8004 /* 000108f6 - 000108fa [ 5] */, + 0x42470002 /* 0001091c - 0001091e [ 3] */, + 0x424e8004 /* 0001093a - 0001093e [ 5] */, + 0x4250003f /* 00010940 - 0001097f [ 64] */, + 0x426e0003 /* 000109b8 - 000109bb [ 4] */, + 0x42740001 /* 000109d0 - 000109d1 [ 2] */, + 0x42810000 /* 00010a04 - 00010a04 [ 1] */, + 0x4281c004 /* 00010a07 - 00010a0b [ 5] */, + 0x42850000 /* 00010a14 - 00010a14 [ 1] */, + 0x42860000 /* 00010a18 - 00010a18 [ 1] */, + 0x428d8001 /* 00010a36 - 00010a37 [ 2] */, + 0x428ec003 /* 00010a3b - 00010a3e [ 4] */, + 0x42924006 /* 00010a49 - 00010a4f [ 7] */, + 0x42964006 /* 00010a59 - 00010a5f [ 7] */, + 0x42a8001f /* 00010aa0 - 00010abf [ 32] */, + 0x42b9c003 /* 00010ae7 - 00010aea [ 4] */, + 0x42bdc008 /* 00010af7 - 00010aff [ 9] */, + 0x42cd8002 /* 00010b36 - 00010b38 [ 3] */, + 0x42d58001 /* 00010b56 - 00010b57 [ 2] */, + 0x42dcc004 /* 00010b73 - 00010b77 [ 5] */, + 0x42e48006 /* 00010b92 - 00010b98 [ 7] */, + 0x42e7400b /* 00010b9d - 00010ba8 [ 12] */, + 0x42ec004f /* 00010bb0 - 00010bff [ 80] */, + 0x43124036 /* 00010c49 - 00010c7f [ 55] */, + 0x432cc00c /* 00010cb3 - 00010cbf [ 13] */, + 0x433cc006 /* 00010cf3 - 00010cf9 [ 7] */, + 0x434a0007 /* 00010d28 - 00010d2f [ 8] */, + 0x434e8125 /* 00010d3a - 00010e5f [ 294] */, + 0x439fc000 /* 00010e7f - 00010e7f [ 1] */, + 0x43aa8000 /* 00010eaa - 00010eaa [ 1] */, + 0x43ab8001 /* 00010eae - 00010eaf [ 2] */, + 0x43ac804a /* 00010eb2 - 00010efc [ 75] */, + 0x43ca0007 /* 00010f28 - 00010f2f [ 8] */, + 0x43d68015 /* 00010f5a - 00010f6f [ 22] */, + 0x43e28025 /* 00010f8a - 00010faf [ 38] */, + 0x43f30013 /* 00010fcc - 00010fdf [ 20] */, + 0x43fdc008 /* 00010ff7 - 00010fff [ 9] */, + 0x44138003 /* 0001104e - 00011051 [ 4] */, + 0x441d8008 /* 00011076 - 0001107e [ 9] */, + 0x442f4000 /* 000110bd - 000110bd [ 1] */, + 0x4430c00c /* 000110c3 - 000110cf [ 13] */, + 0x443a4006 /* 000110e9 - 000110ef [ 7] */, + 0x443e8005 /* 000110fa - 000110ff [ 6] */, + 0x444d4000 /* 00011135 - 00011135 [ 1] */, + 0x44520007 /* 00011148 - 0001114f [ 8] */, + 0x445dc008 /* 00011177 - 0001117f [ 9] */, + 0x44780000 /* 000111e0 - 000111e0 [ 1] */, + 0x447d400a /* 000111f5 - 000111ff [ 11] */, + 0x44848000 /* 00011212 - 00011212 [ 1] */, + 0x4490803d /* 00011242 - 0001127f [ 62] */, + 0x44a1c000 /* 00011287 - 00011287 [ 1] */, + 0x44a24000 /* 00011289 - 00011289 [ 1] */, + 0x44a38000 /* 0001128e - 0001128e [ 1] */, + 0x44a78000 /* 0001129e - 0001129e [ 1] */, + 0x44aa8005 /* 000112aa - 000112af [ 6] */, + 0x44bac004 /* 000112eb - 000112ef [ 5] */, + 0x44be8005 /* 000112fa - 000112ff [ 6] */, + 0x44c10000 /* 00011304 - 00011304 [ 1] */, + 0x44c34001 /* 0001130d - 0001130e [ 2] */, + 0x44c44001 /* 00011311 - 00011312 [ 2] */, + 0x44ca4000 /* 00011329 - 00011329 [ 1] */, + 0x44cc4000 /* 00011331 - 00011331 [ 1] */, + 0x44cd0000 /* 00011334 - 00011334 [ 1] */, + 0x44ce8000 /* 0001133a - 0001133a [ 1] */, + 0x44d14001 /* 00011345 - 00011346 [ 2] */, + 0x44d24001 /* 00011349 - 0001134a [ 2] */, + 0x44d38001 /* 0001134e - 0001134f [ 2] */, + 0x44d44005 /* 00011351 - 00011356 [ 6] */, + 0x44d60004 /* 00011358 - 0001135c [ 5] */, + 0x44d90001 /* 00011364 - 00011365 [ 2] */, + 0x44db4002 /* 0001136d - 0001136f [ 3] */, + 0x44dd408a /* 00011375 - 000113ff [ 139] */, + 0x45170000 /* 0001145c - 0001145c [ 1] */, + 0x4518801d /* 00011462 - 0001147f [ 30] */, + 0x45320007 /* 000114c8 - 000114cf [ 8] */, + 0x453680a5 /* 000114da - 0001157f [ 166] */, + 0x456d8001 /* 000115b6 - 000115b7 [ 2] */, + 0x45778021 /* 000115de - 000115ff [ 34] */, + 0x4591400a /* 00011645 - 0001164f [ 11] */, + 0x45968005 /* 0001165a - 0001165f [ 6] */, + 0x459b4012 /* 0001166d - 0001167f [ 19] */, + 0x45ae8005 /* 000116ba - 000116bf [ 6] */, + 0x45b28035 /* 000116ca - 000116ff [ 54] */, + 0x45c6c001 /* 0001171b - 0001171c [ 2] */, + 0x45cb0003 /* 0001172c - 0001172f [ 4] */, + 0x45d1c0b8 /* 00011747 - 000117ff [ 185] */, + 0x460f0063 /* 0001183c - 0001189f [ 100] */, + 0x463cc00b /* 000118f3 - 000118fe [ 12] */, + 0x4641c001 /* 00011907 - 00011908 [ 2] */, + 0x46428001 /* 0001190a - 0001190b [ 2] */, + 0x46450000 /* 00011914 - 00011914 [ 1] */, + 0x4645c000 /* 00011917 - 00011917 [ 1] */, + 0x464d8000 /* 00011936 - 00011936 [ 1] */, + 0x464e4001 /* 00011939 - 0001193a [ 2] */, + 0x4651c008 /* 00011947 - 0001194f [ 9] */, + 0x46568045 /* 0001195a - 0001199f [ 70] */, + 0x466a0001 /* 000119a8 - 000119a9 [ 2] */, + 0x46760001 /* 000119d8 - 000119d9 [ 2] */, + 0x4679401a /* 000119e5 - 000119ff [ 27] */, + 0x46920007 /* 00011a48 - 00011a4f [ 8] */, + 0x46a8c00c /* 00011aa3 - 00011aaf [ 13] */, + 0x46be4006 /* 00011af9 - 00011aff [ 7] */, + 0x46c280f5 /* 00011b0a - 00011bff [ 246] */, + 0x47024000 /* 00011c09 - 00011c09 [ 1] */, + 0x470dc000 /* 00011c37 - 00011c37 [ 1] */, + 0x47118009 /* 00011c46 - 00011c4f [ 10] */, + 0x471b4002 /* 00011c6d - 00011c6f [ 3] */, + 0x47240001 /* 00011c90 - 00011c91 [ 2] */, + 0x472a0000 /* 00011ca8 - 00011ca8 [ 1] */, + 0x472dc048 /* 00011cb7 - 00011cff [ 73] */, + 0x4741c000 /* 00011d07 - 00011d07 [ 1] */, + 0x47428000 /* 00011d0a - 00011d0a [ 1] */, + 0x474dc002 /* 00011d37 - 00011d39 [ 3] */, + 0x474ec000 /* 00011d3b - 00011d3b [ 1] */, + 0x474f8000 /* 00011d3e - 00011d3e [ 1] */, + 0x47520007 /* 00011d48 - 00011d4f [ 8] */, + 0x47568005 /* 00011d5a - 00011d5f [ 6] */, + 0x47598000 /* 00011d66 - 00011d66 [ 1] */, + 0x475a4000 /* 00011d69 - 00011d69 [ 1] */, + 0x4763c000 /* 00011d8f - 00011d8f [ 1] */, + 0x47648000 /* 00011d92 - 00011d92 [ 1] */, + 0x47664006 /* 00011d99 - 00011d9f [ 7] */, + 0x476a8135 /* 00011daa - 00011edf [ 310] */, + 0x47be4006 /* 00011ef9 - 00011eff [ 7] */, + 0x47c44000 /* 00011f11 - 00011f11 [ 1] */, + 0x47cec002 /* 00011f3b - 00011f3d [ 3] */, + 0x47d68055 /* 00011f5a - 00011faf [ 86] */, + 0x47ec400e /* 00011fb1 - 00011fbf [ 15] */, + 0x47fc800c /* 00011ff2 - 00011ffe [ 13] */, + 0x48e68065 /* 0001239a - 000123ff [ 102] */, + 0x491bc000 /* 0001246f - 0001246f [ 1] */, + 0x491d400a /* 00012475 - 0001247f [ 11] */, + 0x49510a4b /* 00012544 - 00012f8f [ 2636] */, + 0x4bfcc00c /* 00012ff3 - 00012fff [ 13] */, + 0x4d0c000f /* 00013430 - 0001343f [ 16] */, + 0x4d158fa9 /* 00013456 - 000143ff [ 4010] */, + 0x5191e1b8 /* 00014647 - 000167ff [ 8633] */, + 0x5a8e4006 /* 00016a39 - 00016a3f [ 7] */, + 0x5a97c000 /* 00016a5f - 00016a5f [ 1] */, + 0x5a9a8003 /* 00016a6a - 00016a6d [ 4] */, + 0x5aafc000 /* 00016abf - 00016abf [ 1] */, + 0x5ab28005 /* 00016aca - 00016acf [ 6] */, + 0x5abb8001 /* 00016aee - 00016aef [ 2] */, + 0x5abd8009 /* 00016af6 - 00016aff [ 10] */, + 0x5ad18009 /* 00016b46 - 00016b4f [ 10] */, + 0x5ad68000 /* 00016b5a - 00016b5a [ 1] */, + 0x5ad88000 /* 00016b62 - 00016b62 [ 1] */, + 0x5ade0004 /* 00016b78 - 00016b7c [ 5] */, + 0x5ae402af /* 00016b90 - 00016e3f [ 688] */, + 0x5ba6c064 /* 00016e9b - 00016eff [ 101] */, + 0x5bd2c003 /* 00016f4b - 00016f4e [ 4] */, + 0x5be20006 /* 00016f88 - 00016f8e [ 7] */, + 0x5be8003f /* 00016fa0 - 00016fdf [ 64] */, + 0x5bf9400a /* 00016fe5 - 00016fef [ 11] */, + 0x5bfc800d /* 00016ff2 - 00016fff [ 14] */, + 0x61fe0007 /* 000187f8 - 000187ff [ 8] */, + 0x63358029 /* 00018cd6 - 00018cff [ 42] */, + 0x634262e6 /* 00018d09 - 0001afef [ 8935] */, + 0x6bfd0000 /* 0001aff4 - 0001aff4 [ 1] */, + 0x6bff0000 /* 0001affc - 0001affc [ 1] */, + 0x6bffc000 /* 0001afff - 0001afff [ 1] */, + 0x6c48c00e /* 0001b123 - 0001b131 [ 15] */, + 0x6c4cc01c /* 0001b133 - 0001b14f [ 29] */, + 0x6c54c001 /* 0001b153 - 0001b154 [ 2] */, + 0x6c55800d /* 0001b156 - 0001b163 [ 14] */, + 0x6c5a0007 /* 0001b168 - 0001b16f [ 8] */, + 0x6cbf0903 /* 0001b2fc - 0001bbff [ 2308] */, + 0x6f1ac004 /* 0001bc6b - 0001bc6f [ 5] */, + 0x6f1f4002 /* 0001bc7d - 0001bc7f [ 3] */, + 0x6f224006 /* 0001bc89 - 0001bc8f [ 7] */, + 0x6f268001 /* 0001bc9a - 0001bc9b [ 2] */, + 0x6f28125f /* 0001bca0 - 0001ceff [ 4704] */, + 0x73cb8001 /* 0001cf2e - 0001cf2f [ 2] */, + 0x73d1c008 /* 0001cf47 - 0001cf4f [ 9] */, + 0x73f1003b /* 0001cfc4 - 0001cfff [ 60] */, + 0x743d8009 /* 0001d0f6 - 0001d0ff [ 10] */, + 0x7449c001 /* 0001d127 - 0001d128 [ 2] */, + 0x745cc007 /* 0001d173 - 0001d17a [ 8] */, + 0x747ac014 /* 0001d1eb - 0001d1ff [ 21] */, + 0x74918079 /* 0001d246 - 0001d2bf [ 122] */, + 0x74b5000b /* 0001d2d4 - 0001d2df [ 12] */, + 0x74bd000b /* 0001d2f4 - 0001d2ff [ 12] */, + 0x74d5c008 /* 0001d357 - 0001d35f [ 9] */, + 0x74de4086 /* 0001d379 - 0001d3ff [ 135] */, + 0x75154000 /* 0001d455 - 0001d455 [ 1] */, + 0x75274000 /* 0001d49d - 0001d49d [ 1] */, + 0x75280001 /* 0001d4a0 - 0001d4a1 [ 2] */, + 0x7528c001 /* 0001d4a3 - 0001d4a4 [ 2] */, + 0x7529c001 /* 0001d4a7 - 0001d4a8 [ 2] */, + 0x752b4000 /* 0001d4ad - 0001d4ad [ 1] */, + 0x752e8000 /* 0001d4ba - 0001d4ba [ 1] */, + 0x752f0000 /* 0001d4bc - 0001d4bc [ 1] */, + 0x75310000 /* 0001d4c4 - 0001d4c4 [ 1] */, + 0x75418000 /* 0001d506 - 0001d506 [ 1] */, + 0x7542c001 /* 0001d50b - 0001d50c [ 2] */, + 0x75454000 /* 0001d515 - 0001d515 [ 1] */, + 0x75474000 /* 0001d51d - 0001d51d [ 1] */, + 0x754e8000 /* 0001d53a - 0001d53a [ 1] */, + 0x754fc000 /* 0001d53f - 0001d53f [ 1] */, + 0x75514000 /* 0001d545 - 0001d545 [ 1] */, + 0x7551c002 /* 0001d547 - 0001d549 [ 3] */, + 0x75544000 /* 0001d551 - 0001d551 [ 1] */, + 0x75a98001 /* 0001d6a6 - 0001d6a7 [ 2] */, + 0x75f30001 /* 0001d7cc - 0001d7cd [ 2] */, + 0x76a3000e /* 0001da8c - 0001da9a [ 15] */, + 0x76a80000 /* 0001daa0 - 0001daa0 [ 1] */, + 0x76ac044f /* 0001dab0 - 0001deff [ 1104] */, + 0x77c7c005 /* 0001df1f - 0001df24 [ 6] */, + 0x77cac0d4 /* 0001df2b - 0001dfff [ 213] */, + 0x7801c000 /* 0001e007 - 0001e007 [ 1] */, + 0x78064001 /* 0001e019 - 0001e01a [ 2] */, + 0x78088000 /* 0001e022 - 0001e022 [ 1] */, + 0x78094000 /* 0001e025 - 0001e025 [ 1] */, + 0x780ac004 /* 0001e02b - 0001e02f [ 5] */, + 0x781b8020 /* 0001e06e - 0001e08e [ 33] */, + 0x7824006f /* 0001e090 - 0001e0ff [ 112] */, + 0x784b4002 /* 0001e12d - 0001e12f [ 3] */, + 0x784f8001 /* 0001e13e - 0001e13f [ 2] */, + 0x78528003 /* 0001e14a - 0001e14d [ 4] */, + 0x7854013f /* 0001e150 - 0001e28f [ 320] */, + 0x78abc010 /* 0001e2af - 0001e2bf [ 17] */, + 0x78be8004 /* 0001e2fa - 0001e2fe [ 5] */, + 0x78c001cf /* 0001e300 - 0001e4cf [ 464] */, + 0x793e82e5 /* 0001e4fa - 0001e7df [ 742] */, + 0x79f9c000 /* 0001e7e7 - 0001e7e7 [ 1] */, + 0x79fb0000 /* 0001e7ec - 0001e7ec [ 1] */, + 0x79fbc000 /* 0001e7ef - 0001e7ef [ 1] */, + 0x79ffc000 /* 0001e7ff - 0001e7ff [ 1] */, + 0x7a314001 /* 0001e8c5 - 0001e8c6 [ 2] */, + 0x7a35c028 /* 0001e8d7 - 0001e8ff [ 41] */, + 0x7a530003 /* 0001e94c - 0001e94f [ 4] */, + 0x7a568003 /* 0001e95a - 0001e95d [ 4] */, + 0x7a580310 /* 0001e960 - 0001ec70 [ 785] */, + 0x7b2d404b /* 0001ecb5 - 0001ed00 [ 76] */, + 0x7b4f80c1 /* 0001ed3e - 0001edff [ 194] */, + 0x7b810000 /* 0001ee04 - 0001ee04 [ 1] */, + 0x7b880000 /* 0001ee20 - 0001ee20 [ 1] */, + 0x7b88c000 /* 0001ee23 - 0001ee23 [ 1] */, + 0x7b894001 /* 0001ee25 - 0001ee26 [ 2] */, + 0x7b8a0000 /* 0001ee28 - 0001ee28 [ 1] */, + 0x7b8cc000 /* 0001ee33 - 0001ee33 [ 1] */, + 0x7b8e0000 /* 0001ee38 - 0001ee38 [ 1] */, + 0x7b8e8000 /* 0001ee3a - 0001ee3a [ 1] */, + 0x7b8f0005 /* 0001ee3c - 0001ee41 [ 6] */, + 0x7b90c003 /* 0001ee43 - 0001ee46 [ 4] */, + 0x7b920000 /* 0001ee48 - 0001ee48 [ 1] */, + 0x7b928000 /* 0001ee4a - 0001ee4a [ 1] */, + 0x7b930000 /* 0001ee4c - 0001ee4c [ 1] */, + 0x7b940000 /* 0001ee50 - 0001ee50 [ 1] */, + 0x7b94c000 /* 0001ee53 - 0001ee53 [ 1] */, + 0x7b954001 /* 0001ee55 - 0001ee56 [ 2] */, + 0x7b960000 /* 0001ee58 - 0001ee58 [ 1] */, + 0x7b968000 /* 0001ee5a - 0001ee5a [ 1] */, + 0x7b970000 /* 0001ee5c - 0001ee5c [ 1] */, + 0x7b978000 /* 0001ee5e - 0001ee5e [ 1] */, + 0x7b980000 /* 0001ee60 - 0001ee60 [ 1] */, + 0x7b98c000 /* 0001ee63 - 0001ee63 [ 1] */, + 0x7b994001 /* 0001ee65 - 0001ee66 [ 2] */, + 0x7b9ac000 /* 0001ee6b - 0001ee6b [ 1] */, + 0x7b9cc000 /* 0001ee73 - 0001ee73 [ 1] */, + 0x7b9e0000 /* 0001ee78 - 0001ee78 [ 1] */, + 0x7b9f4000 /* 0001ee7d - 0001ee7d [ 1] */, + 0x7b9fc000 /* 0001ee7f - 0001ee7f [ 1] */, + 0x7ba28000 /* 0001ee8a - 0001ee8a [ 1] */, + 0x7ba70004 /* 0001ee9c - 0001eea0 [ 5] */, + 0x7ba90000 /* 0001eea4 - 0001eea4 [ 1] */, + 0x7baa8000 /* 0001eeaa - 0001eeaa [ 1] */, + 0x7baf0033 /* 0001eebc - 0001eeef [ 52] */, + 0x7bbc810d /* 0001eef2 - 0001efff [ 270] */, + 0x7c0b0003 /* 0001f02c - 0001f02f [ 4] */, + 0x7c25000b /* 0001f094 - 0001f09f [ 12] */, + 0x7c2bc001 /* 0001f0af - 0001f0b0 [ 2] */, + 0x7c300000 /* 0001f0c0 - 0001f0c0 [ 1] */, + 0x7c340000 /* 0001f0d0 - 0001f0d0 [ 1] */, + 0x7c3d8009 /* 0001f0f6 - 0001f0ff [ 10] */, + 0x7c6b8037 /* 0001f1ae - 0001f1e5 [ 56] */, + 0x7c80c00c /* 0001f203 - 0001f20f [ 13] */, + 0x7c8f0003 /* 0001f23c - 0001f23f [ 4] */, + 0x7c924006 /* 0001f249 - 0001f24f [ 7] */, + 0x7c94800d /* 0001f252 - 0001f25f [ 14] */, + 0x7c998099 /* 0001f266 - 0001f2ff [ 154] */, + 0x7db60003 /* 0001f6d8 - 0001f6db [ 4] */, + 0x7dbb4002 /* 0001f6ed - 0001f6ef [ 3] */, + 0x7dbf4002 /* 0001f6fd - 0001f6ff [ 3] */, + 0x7dddc003 /* 0001f777 - 0001f77a [ 4] */, + 0x7df68005 /* 0001f7da - 0001f7df [ 6] */, + 0x7dfb0003 /* 0001f7ec - 0001f7ef [ 4] */, + 0x7dfc400e /* 0001f7f1 - 0001f7ff [ 15] */, + 0x7e030003 /* 0001f80c - 0001f80f [ 4] */, + 0x7e120007 /* 0001f848 - 0001f84f [ 8] */, + 0x7e168005 /* 0001f85a - 0001f85f [ 6] */, + 0x7e220007 /* 0001f888 - 0001f88f [ 8] */, + 0x7e2b8001 /* 0001f8ae - 0001f8af [ 2] */, + 0x7e2c804d /* 0001f8b2 - 0001f8ff [ 78] */, + 0x7e95000b /* 0001fa54 - 0001fa5f [ 12] */, + 0x7e9b8001 /* 0001fa6e - 0001fa6f [ 2] */, + 0x7e9f4002 /* 0001fa7d - 0001fa7f [ 3] */, + 0x7ea24006 /* 0001fa89 - 0001fa8f [ 7] */, + 0x7eaf8000 /* 0001fabe - 0001fabe [ 1] */, + 0x7eb18007 /* 0001fac6 - 0001facd [ 8] */, + 0x7eb70003 /* 0001fadc - 0001fadf [ 4] */, + 0x7eba4006 /* 0001fae9 - 0001faef [ 7] */, + 0x7ebe4006 /* 0001faf9 - 0001faff [ 7] */, + 0x7ee4c000 /* 0001fb93 - 0001fb93 [ 1] */, + 0x7ef2c024 /* 0001fbcb - 0001fbef [ 37] */, + 0x7efe8405 /* 0001fbfa - 0001ffff [ 1030] */, + 0xa9b8001f /* 0002a6e0 - 0002a6ff [ 32] */, + 0xadce8005 /* 0002b73a - 0002b73f [ 6] */, + 0xae078001 /* 0002b81e - 0002b81f [ 2] */, + 0xb3a8800d /* 0002cea2 - 0002ceaf [ 14] */, + 0xbaf8400e /* 0002ebe1 - 0002ebef [ 15] */, + 0xbb9789a1 /* 0002ee5e - 0002f7ff [ 2466] */, + 0xbe8785e1 /* 0002fa1e - 0002ffff [ 1506] */, + 0xc4d2c004 /* 0003134b - 0003134f [ 5] */}; +/// Returns whether the code unit needs to be escaped. +/// /// At the end of the valid Unicode code points space a lot of code points are /// either reserved or a noncharacter. Adding all these entries to the -/// lookup table would add 446 entries to the table (in Unicode 14). -/// Instead the only the start of the region is stored, every code point in -/// this region needs to be escaped. -inline constexpr uint32_t __unallocated_region_lower_bound = 0x000323b0; +/// lookup table would greatly increase the size of the table. Instead these +/// entries are manually processed. In this large area of reserved code points, +/// there is a small area of extended graphemes that should not be escaped +/// unconditionally. This is also manually coded. See the generation script for +/// more details. -/// Returns whether the code unit needs to be escaped. /// -/// \pre The code point is a valid Unicode code point. +/// \\pre The code point is a valid Unicode code point. [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __needs_escape(const char32_t __code_point) noexcept { - // Since __unallocated_region_lower_bound contains the unshifted range do the - // comparison without shifting. - if (__code_point >= __unallocated_region_lower_bound) + + // The entries in the gap at the end. + if(__code_point >= 0x000e0100 && __code_point <= 0x000e01ef) + return false; + + // The entries at the end. + if (__code_point >= 0x000323b0) return true; - ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 11) | 0x7ffu) - __entries; + ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 14) | 0x3fffu) - __entries; if (__i == 0) return false; --__i; - uint32_t __upper_bound = (__entries[__i] >> 11) + (__entries[__i] & 0x7ffu); + uint32_t __upper_bound = (__entries[__i] >> 14) + (__entries[__i] & 0x3fffu); return __code_point <= __upper_bound; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h index 4924e5fb32..aa02f81dc4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h @@ -19,6 +19,7 @@ #include <__fwd/format.h> #include <__memory/addressof.h> #include <__type_traits/conditional.h> +#include <__type_traits/remove_const.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/unreachable.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h index c781014010..d14b49aff1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h @@ -66,14 +66,13 @@ using wformat_args = basic_format_args<wformat_context>; # endif template <class _Context = format_context, class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args) { return std::__format_arg_store<_Context, _Args...>(__args...); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> -make_wformat_args(_Args&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> make_wformat_args(_Args&... __args) { return std::__format_arg_store<wformat_context, _Args...>(__args...); } # endif @@ -452,8 +451,7 @@ format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) { // TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup // fires too eagerly, see http://llvm.org/PR61563. template <class = void> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string -vformat(string_view __fmt, format_args __args) { +[[nodiscard]] _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string vformat(string_view __fmt, format_args __args) { string __res; std::vformat_to(std::back_inserter(__res), __fmt, __args); return __res; @@ -463,7 +461,7 @@ vformat(string_view __fmt, format_args __args) { // TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup // fires too eagerly, see http://llvm.org/PR61563. template <class = void> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring +[[nodiscard]] _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring vformat(wstring_view __fmt, wformat_args __args) { wstring __res; std::vformat_to(std::back_inserter(__res), __fmt, __args); @@ -472,14 +470,14 @@ vformat(wstring_view __fmt, wformat_args __args) { # endif template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string format(format_string<_Args...> __fmt, _Args&&... __args) { return std::vformat(__fmt.get(), std::make_format_args(__args...)); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring format(wformat_string<_Args...> __fmt, _Args&&... __args) { return std::vformat(__fmt.get(), std::make_wformat_args(__args...)); } @@ -520,14 +518,14 @@ _LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt, } template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t formatted_size(format_string<_Args...> __fmt, _Args&&... __args) { return std::__vformatted_size(__fmt.get(), basic_format_args{std::make_format_args(__args...)}); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) { return std::__vformatted_size(__fmt.get(), basic_format_args{std::make_wformat_args(__args...)}); } @@ -585,7 +583,7 @@ format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&& // TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup // fires too eagerly, see http://llvm.org/PR61563. template <class = void> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string +[[nodiscard]] _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string vformat(locale __loc, string_view __fmt, format_args __args) { string __res; std::vformat_to(std::back_inserter(__res), std::move(__loc), __fmt, __args); @@ -596,7 +594,7 @@ vformat(locale __loc, string_view __fmt, format_args __args) { // TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup // fires too eagerly, see http://llvm.org/PR61563. template <class = void> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring +[[nodiscard]] _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring vformat(locale __loc, wstring_view __fmt, wformat_args __args) { wstring __res; std::vformat_to(std::back_inserter(__res), std::move(__loc), __fmt, __args); @@ -605,14 +603,14 @@ vformat(locale __loc, wstring_view __fmt, wformat_args __args) { # endif template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string format(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) { return std::vformat(std::move(__loc), __fmt.get(), std::make_format_args(__args...)); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) { return std::vformat(std::move(__loc), __fmt.get(), std::make_wformat_args(__args...)); } @@ -658,14 +656,14 @@ _LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_ } template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) { return std::__vformatted_size(std::move(__loc), __fmt.get(), basic_format_args{std::make_format_args(__args...)}); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t +[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) { return std::__vformatted_size(std::move(__loc), __fmt.get(), basic_format_args{std::make_wformat_args(__args...)}); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h index 1d94cc349c..fa42ba203b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h @@ -690,7 +690,7 @@ __format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__par // Let P equal the precision if nonzero, 6 if the precision is not // specified, or 1 if the precision is 0. Then, if a conversion with // style E would have an exponent of X: - int __p = std::max(1, (__specs.__has_precision() ? __specs.__precision_ : 6)); + int __p = std::max<int>(1, (__specs.__has_precision() ? __specs.__precision_ : 6)); if (__result.__exponent == __result.__last) // if P > X >= -4, the conversion is with style f or F and precision P - 1 - X. // By including the radix point it calculates P - (1 + X) diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h index d5038eb158..1498f64c4a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h @@ -100,8 +100,8 @@ __padding_size(size_t __size, size_t __width, __format_spec::__alignment __align /// /// This uses a "mass output function" of __format::__output_buffer when possible. template <__fmt_char_type _CharT, __fmt_char_type _OutCharT = _CharT> -_LIBCPP_HIDE_FROM_ABI auto __copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it) - -> decltype(__out_it) { +_LIBCPP_HIDE_FROM_ABI auto +__copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) { if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) { __out_it.__get_container()->__copy(__str); return __out_it; @@ -116,16 +116,16 @@ _LIBCPP_HIDE_FROM_ABI auto __copy(basic_string_view<_CharT> __str, output_iterat template <contiguous_iterator _Iterator, __fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type, __fmt_char_type _OutCharT = _CharT> -_LIBCPP_HIDE_FROM_ABI auto __copy(_Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it) - -> decltype(__out_it) { +_LIBCPP_HIDE_FROM_ABI auto +__copy(_Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) { return __formatter::__copy(basic_string_view{__first, __last}, std::move(__out_it)); } template <contiguous_iterator _Iterator, __fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type, __fmt_char_type _OutCharT = _CharT> -_LIBCPP_HIDE_FROM_ABI auto __copy(_Iterator __first, size_t __n, output_iterator<const _OutCharT&> auto __out_it) - -> decltype(__out_it) { +_LIBCPP_HIDE_FROM_ABI auto +__copy(_Iterator __first, size_t __n, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) { return __formatter::__copy(basic_string_view{std::to_address(__first), __n}, std::move(__out_it)); } @@ -136,9 +136,11 @@ template <contiguous_iterator _Iterator, __fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type, __fmt_char_type _OutCharT = _CharT, class _UnaryOperation> -_LIBCPP_HIDE_FROM_ABI auto __transform( - _Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it, _UnaryOperation __operation) - -> decltype(__out_it) { +_LIBCPP_HIDE_FROM_ABI auto +__transform(_Iterator __first, + _Iterator __last, + output_iterator<const _OutCharT&> auto __out_it, + _UnaryOperation __operation) -> decltype(__out_it) { if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) { __out_it.__get_container()->__transform(__first, __last, std::move(__operation)); return __out_it; diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/indic_conjunct_break_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/indic_conjunct_break_table.h new file mode 100644 index 0000000000..44521d2749 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__format/indic_conjunct_break_table.h @@ -0,0 +1,350 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// WARNING, this entire header is generated by +// utils/generate_indic_conjunct_break_table.py +// DO NOT MODIFY! + +// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +// +// See Terms of Use <https://www.unicode.org/copyright.html> +// for definitions of Unicode Inc.'s Data Files and Software. +// +// NOTICE TO USER: Carefully read the following legal agreement. +// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +// TERMS AND CONDITIONS OF THIS AGREEMENT. +// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +// THE DATA FILES OR SOFTWARE. +// +// COPYRIGHT AND PERMISSION NOTICE +// +// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved. +// Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of the Unicode data files and any associated documentation +// (the "Data Files") or Unicode software and any associated documentation +// (the "Software") to deal in the Data Files or Software +// without restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, and/or sell copies of +// the Data Files or Software, and to permit persons to whom the Data Files +// or Software are furnished to do so, provided that either +// (a) this copyright and permission notice appear with all copies +// of the Data Files or Software, or +// (b) this copyright and permission notice appear in associated +// Documentation. +// +// THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT OF THIRD PARTY RIGHTS. +// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THE DATA FILES OR SOFTWARE. +// +// Except as contained in this notice, the name of a copyright holder +// shall not be used in advertising or otherwise to promote the sale, +// use or other dealings in these Data Files or Software without prior +// written authorization of the copyright holder. + +#ifndef _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H +#define _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H + +#include <__algorithm/ranges_upper_bound.h> +#include <__config> +#include <__iterator/access.h> +#include <cstddef> +#include <cstdint> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER >= 20 + +namespace __indic_conjunct_break { + +enum class __property : uint8_t { + // Values generated from the data files. + __Consonant, + __Extend, + __Linker, + + // The code unit has none of above properties. + __none +}; + +/// The entries of the indic conjunct break property table. +/// +/// The data is generated from +/// - https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt +/// +/// The data has 3 values +/// - bits [0, 1] The property. One of the values generated from the datafiles +/// of \ref __property +/// - bits [2, 10] The size of the range. +/// - bits [11, 31] The lower bound code point of the range. The upper bound of +/// the range is lower bound + size. +/// +/// The 9 bits for the size allow a maximum range of 512 elements. Some ranges +/// in the Unicode tables are larger. They are stored in multiple consecutive +/// ranges in the data table. An alternative would be to store the sizes in a +/// separate 16-bit value. The original MSVC STL code had such an approach, but +/// this approach uses less space for the data and is about 4% faster in the +/// following benchmark. +/// libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp +// clang-format off +_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[201] = { + 0x00180139, + 0x001a807d, + 0x00241811, + 0x002c88b1, + 0x002df801, + 0x002e0805, + 0x002e2005, + 0x002e3801, + 0x00308029, + 0x00325851, + 0x00338001, + 0x0036b019, + 0x0036f815, + 0x00373805, + 0x0037500d, + 0x00388801, + 0x00398069, + 0x003f5821, + 0x003fe801, + 0x0040b00d, + 0x0040d821, + 0x00412809, + 0x00414811, + 0x0042c809, + 0x0044c01d, + 0x0046505d, + 0x00471871, + 0x0048a890, + 0x0049e001, + 0x004a6802, + 0x004a880d, + 0x004ac01c, + 0x004bc01c, + 0x004ca84c, + 0x004d5018, + 0x004d9000, + 0x004db00c, + 0x004de001, + 0x004e6802, + 0x004ee004, + 0x004ef800, + 0x004f8004, + 0x004ff001, + 0x0051e001, + 0x0054a84c, + 0x00555018, + 0x00559004, + 0x0055a810, + 0x0055e001, + 0x00566802, + 0x0057c800, + 0x0058a84c, + 0x00595018, + 0x00599004, + 0x0059a810, + 0x0059e001, + 0x005a6802, + 0x005ae004, + 0x005af800, + 0x005b8800, + 0x0060a84c, + 0x0061503c, + 0x0061e001, + 0x00626802, + 0x0062a805, + 0x0062c008, + 0x0065e001, + 0x0068a894, + 0x0069d805, + 0x006a6802, + 0x0071c009, + 0x0072400d, + 0x0075c009, + 0x0076400d, + 0x0078c005, + 0x0079a801, + 0x0079b801, + 0x0079c801, + 0x007b8805, + 0x007ba001, + 0x007bd00d, + 0x007c0001, + 0x007c1009, + 0x007c3005, + 0x007e3001, + 0x0081b801, + 0x0081c805, + 0x00846801, + 0x009ae809, + 0x00b8a001, + 0x00be9001, + 0x00bee801, + 0x00c54801, + 0x00c9c809, + 0x00d0b805, + 0x00d30001, + 0x00d3a81d, + 0x00d3f801, + 0x00d58035, + 0x00d5f83d, + 0x00d9a001, + 0x00db5821, + 0x00dd5801, + 0x00df3001, + 0x00e1b801, + 0x00e68009, + 0x00e6a031, + 0x00e71019, + 0x00e76801, + 0x00e7a001, + 0x00e7c005, + 0x00ee00fd, + 0x01006801, + 0x01068031, + 0x01070801, + 0x0107282d, + 0x01677809, + 0x016bf801, + 0x016f007d, + 0x01815015, + 0x0184c805, + 0x05337801, + 0x0533a025, + 0x0534f005, + 0x05378005, + 0x05416001, + 0x05470045, + 0x05495809, + 0x054d9801, + 0x05558001, + 0x05559009, + 0x0555b805, + 0x0555f005, + 0x05560801, + 0x0557b001, + 0x055f6801, + 0x07d8f001, + 0x07f1003d, + 0x080fe801, + 0x08170001, + 0x081bb011, + 0x08506801, + 0x08507801, + 0x0851c009, + 0x0851f801, + 0x08572805, + 0x0869200d, + 0x08755805, + 0x0877e809, + 0x087a3029, + 0x087c100d, + 0x08838001, + 0x0883f801, + 0x0885d001, + 0x08880009, + 0x08899805, + 0x088b9801, + 0x088e5001, + 0x0891b001, + 0x08974805, + 0x0899d805, + 0x089b3019, + 0x089b8011, + 0x08a23001, + 0x08a2f001, + 0x08a61801, + 0x08ae0001, + 0x08b5b801, + 0x08b95801, + 0x08c1d001, + 0x08c9f001, + 0x08ca1801, + 0x08d1a001, + 0x08d23801, + 0x08d4c801, + 0x08ea1001, + 0x08ea2005, + 0x08ecb801, + 0x08fa1001, + 0x0b578011, + 0x0b598019, + 0x0de4f001, + 0x0e8b2801, + 0x0e8b3809, + 0x0e8b7011, + 0x0e8bd81d, + 0x0e8c2819, + 0x0e8d500d, + 0x0e921009, + 0x0f000019, + 0x0f004041, + 0x0f00d819, + 0x0f011805, + 0x0f013011, + 0x0f047801, + 0x0f098019, + 0x0f157001, + 0x0f17600d, + 0x0f27600d, + 0x0f468019, + 0x0f4a2019}; +// clang-format on + +/// Returns the indic conjuct break property of a code point. +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __property __get_property(const char32_t __code_point) noexcept { + // The algorithm searches for the upper bound of the range and, when found, + // steps back one entry. This algorithm is used since the code point can be + // anywhere in the range. After a lower bound is found the next step is to + // compare whether the code unit is indeed in the range. + // + // Since the entry contains a code unit, size, and property the code point + // being sought needs to be adjusted. Just shifting the code point to the + // proper position doesn't work; suppose an entry has property 0, size 1, + // and lower bound 3. This results in the entry 0x1810. + // When searching for code point 3 it will search for 0x1800, find 0x1810 + // and moves to the previous entry. Thus the lower bound value will never + // be found. + // The simple solution is to set the bits belonging to the property and + // size. Then the upper bound for code point 3 will return the entry after + // 0x1810. After moving to the previous entry the algorithm arrives at the + // correct entry. + ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 11) | 0x7ffu) - __entries; + if (__i == 0) + return __property::__none; + + --__i; + uint32_t __upper_bound = (__entries[__i] >> 11) + ((__entries[__i] >> 2) & 0b1'1111'1111); + if (__code_point <= __upper_bound) + return static_cast<__property>(__entries[__i] & 0b11); + + return __property::__none; +} + +} // namespace __indic_conjunct_break + +#endif //_LIBCPP_STD_VER >= 20 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h b/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h index 9818f37b51..150bdde89f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h @@ -1155,8 +1155,8 @@ __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __col // When Unicode isn't supported assume ASCII and every code unit is one code // point. In ASCII the estimated column width is always one. Thus there's no // need for rounding. - size_t __width_ = std::min(__str.size(), __maximum); - return {__width_, __str.begin() + __width_}; + size_t __width = std::min(__str.size(), __maximum); + return {__width, __str.begin() + __width}; } # endif // !defined(_LIBCPP_HAS_NO_UNICODE) diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h b/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h index 40067ca344..de7d0fea1d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h @@ -15,8 +15,10 @@ #include <__concepts/same_as.h> #include <__config> #include <__format/extended_grapheme_cluster_table.h> +#include <__format/indic_conjunct_break_table.h> #include <__iterator/concepts.h> #include <__iterator/readable_traits.h> // iter_value_t +#include <__utility/unreachable.h> #include <string_view> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -292,84 +294,231 @@ private: }; # endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS -_LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break( - bool& __ri_break_allowed, - bool __has_extened_pictographic, - __extended_grapheme_custer_property_boundary::__property __prev, - __extended_grapheme_custer_property_boundary::__property __next) { - using __extended_grapheme_custer_property_boundary::__property; +// State machine to implement the Extended Grapheme Cluster Boundary +// +// The exact rules may change between Unicode versions. +// This implements the extended rules see +// https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries +class __extended_grapheme_cluster_break { + using __EGC_property = __extended_grapheme_custer_property_boundary::__property; + using __inCB_property = __indic_conjunct_break::__property; - __has_extened_pictographic |= __prev == __property::__Extended_Pictographic; +public: + _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_break(char32_t __first_code_point) + : __prev_code_point_(__first_code_point), + __prev_property_(__extended_grapheme_custer_property_boundary::__get_property(__first_code_point)) { + // Initializes the active rule. + if (__prev_property_ == __EGC_property::__Extended_Pictographic) + __active_rule_ = __rule::__GB11_emoji; + else if (__prev_property_ == __EGC_property::__Regional_Indicator) + __active_rule_ = __rule::__GB12_GB13_regional_indicator; + else if (__indic_conjunct_break::__get_property(__first_code_point) == __inCB_property::__Consonant) + __active_rule_ = __rule::__GB9c_indic_conjunct_break; + } - // https://www.unicode.org/reports/tr29/tr29-39.html#Grapheme_Cluster_Boundary_Rules + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(char32_t __next_code_point) { + __EGC_property __next_property = __extended_grapheme_custer_property_boundary::__get_property(__next_code_point); + bool __result = __evaluate(__next_code_point, __next_property); + __prev_code_point_ = __next_code_point; + __prev_property_ = __next_property; + return __result; + } - // *** Break at the start and end of text, unless the text is empty. *** + // The code point whose break propery are considered during the next + // evaluation cyle. + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr char32_t __current_code_point() const { return __prev_code_point_; } - _LIBCPP_ASSERT_INTERNAL(__prev != __property::__sot, "should be handled in the constructor"); // GB1 - _LIBCPP_ASSERT_INTERNAL(__prev != __property::__eot, "should be handled by our caller"); // GB2 +private: + // The naming of the identifiers matches the Unicode standard. + // NOLINTBEGIN(readability-identifier-naming) + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool + __evaluate(char32_t __next_code_point, __EGC_property __next_property) { + switch (__active_rule_) { + case __rule::__none: + return __evaluate_none(__next_code_point, __next_property); + case __rule::__GB9c_indic_conjunct_break: + return __evaluate_GB9c_indic_conjunct_break(__next_code_point, __next_property); + case __rule::__GB11_emoji: + return __evaluate_GB11_emoji(__next_code_point, __next_property); + case __rule::__GB12_GB13_regional_indicator: + return __evaluate_GB12_GB13_regional_indicator(__next_code_point, __next_property); + } + __libcpp_unreachable(); + } - // *** Do not break between a CR and LF. Otherwise, break before and after controls. *** - if (__prev == __property::__CR && __next == __property::__LF) // GB3 - return false; + _LIBCPP_HIDE_FROM_ABI constexpr bool __evaluate_none(char32_t __next_code_point, __EGC_property __next_property) { + // *** Break at the start and end of text, unless the text is empty. *** - if (__prev == __property::__Control || __prev == __property::__CR || __prev == __property::__LF) // GB4 - return true; + _LIBCPP_ASSERT_INTERNAL(__prev_property_ != __EGC_property::__sot, "should be handled in the constructor"); // GB1 + _LIBCPP_ASSERT_INTERNAL(__prev_property_ != __EGC_property::__eot, "should be handled by our caller"); // GB2 - if (__next == __property::__Control || __next == __property::__CR || __next == __property::__LF) // GB5 - return true; + // *** Do not break between a CR and LF. Otherwise, break before and after controls. *** + if (__prev_property_ == __EGC_property::__CR && __next_property == __EGC_property::__LF) // GB3 + return false; - // *** Do not break Hangul syllable sequences. *** - if (__prev == __property::__L && (__next == __property::__L || __next == __property::__V || - __next == __property::__LV || __next == __property::__LVT)) // GB6 - return false; + if (__prev_property_ == __EGC_property::__Control || __prev_property_ == __EGC_property::__CR || + __prev_property_ == __EGC_property::__LF) // GB4 + return true; - if ((__prev == __property::__LV || __prev == __property::__V) && - (__next == __property::__V || __next == __property::__T)) // GB7 - return false; + if (__next_property == __EGC_property::__Control || __next_property == __EGC_property::__CR || + __next_property == __EGC_property::__LF) // GB5 + return true; - if ((__prev == __property::__LVT || __prev == __property::__T) && __next == __property::__T) // GB8 - return false; + // *** Do not break Hangul syllable sequences. *** + if (__prev_property_ == __EGC_property::__L && + (__next_property == __EGC_property::__L || __next_property == __EGC_property::__V || + __next_property == __EGC_property::__LV || __next_property == __EGC_property::__LVT)) // GB6 + return false; - // *** Do not break before extending characters or ZWJ. *** - if (__next == __property::__Extend || __next == __property::__ZWJ) - return false; // GB9 + if ((__prev_property_ == __EGC_property::__LV || __prev_property_ == __EGC_property::__V) && + (__next_property == __EGC_property::__V || __next_property == __EGC_property::__T)) // GB7 + return false; - // *** Do not break before SpacingMarks, or after Prepend characters. *** - if (__next == __property::__SpacingMark) // GB9a - return false; + if ((__prev_property_ == __EGC_property::__LVT || __prev_property_ == __EGC_property::__T) && + __next_property == __EGC_property::__T) // GB8 + return false; - if (__prev == __property::__Prepend) // GB9b - return false; + // *** Do not break before extending characters or ZWJ. *** + if (__next_property == __EGC_property::__Extend || __next_property == __EGC_property::__ZWJ) + return false; // GB9 - // *** Do not break within emoji modifier sequences or emoji zwj sequences. *** + // *** Do not break before SpacingMarks, or after Prepend characters. *** + if (__next_property == __EGC_property::__SpacingMark) // GB9a + return false; - // GB11 \p{Extended_Pictographic} Extend* ZWJ x \p{Extended_Pictographic} - // - // Note that several parts of this rule are matched by GB9: Any x (Extend | ZWJ) - // - \p{Extended_Pictographic} x Extend - // - Extend x Extend - // - \p{Extended_Pictographic} x ZWJ - // - Extend x ZWJ - // - // So the only case left to test is - // - \p{Extended_Pictographic}' x ZWJ x \p{Extended_Pictographic} - // where \p{Extended_Pictographic}' is stored in __has_extened_pictographic - if (__has_extened_pictographic && __prev == __property::__ZWJ && __next == __property::__Extended_Pictographic) - return false; + if (__prev_property_ == __EGC_property::__Prepend) // GB9b + return false; - // *** Do not break within emoji flag sequences *** + // *** Do not break within certain combinations with Indic_Conjunct_Break (InCB)=Linker. *** + if (__indic_conjunct_break::__get_property(__next_code_point) == __inCB_property::__Consonant) { + __active_rule_ = __rule::__GB9c_indic_conjunct_break; + __GB9c_indic_conjunct_break_state_ = __GB9c_indic_conjunct_break_state::__Consonant; + return true; + } + + // *** Do not break within emoji modifier sequences or emoji zwj sequences. *** + if (__next_property == __EGC_property::__Extended_Pictographic) { + __active_rule_ = __rule::__GB11_emoji; + __GB11_emoji_state_ = __GB11_emoji_state::__Extended_Pictographic; + return true; + } + + // *** Do not break within emoji flag sequences *** - // That is, do not break between regional indicator (RI) symbols if there - // is an odd number of RI characters before the break point. + // That is, do not break between regional indicator (RI) symbols if there + // is an odd number of RI characters before the break point. + if (__next_property == __EGC_property::__Regional_Indicator) { // GB12 + GB13 + __active_rule_ = __rule::__GB12_GB13_regional_indicator; + return true; + } - if (__prev == __property::__Regional_Indicator && __next == __property::__Regional_Indicator) { // GB12 + GB13 - __ri_break_allowed = !__ri_break_allowed; - return __ri_break_allowed; + // *** Otherwise, break everywhere. *** + return true; // GB999 } - // *** Otherwise, break everywhere. *** - return true; // GB999 -} + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool + __evaluate_GB9c_indic_conjunct_break(char32_t __next_code_point, __EGC_property __next_property) { + __inCB_property __break = __indic_conjunct_break::__get_property(__next_code_point); + if (__break == __inCB_property::__none) { + __active_rule_ = __rule::__none; + return __evaluate_none(__next_code_point, __next_property); + } + + switch (__GB9c_indic_conjunct_break_state_) { + case __GB9c_indic_conjunct_break_state::__Consonant: + if (__break == __inCB_property::__Extend) { + return false; + } + if (__break == __inCB_property::__Linker) { + __GB9c_indic_conjunct_break_state_ = __GB9c_indic_conjunct_break_state::__Linker; + return false; + } + __active_rule_ = __rule::__none; + return __evaluate_none(__next_code_point, __next_property); + + case __GB9c_indic_conjunct_break_state::__Linker: + if (__break == __inCB_property::__Extend) { + return false; + } + if (__break == __inCB_property::__Linker) { + return false; + } + if (__break == __inCB_property::__Consonant) { + __GB9c_indic_conjunct_break_state_ = __GB9c_indic_conjunct_break_state::__Consonant; + return false; + } + __active_rule_ = __rule::__none; + return __evaluate_none(__next_code_point, __next_property); + } + __libcpp_unreachable(); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool + __evaluate_GB11_emoji(char32_t __next_code_point, __EGC_property __next_property) { + switch (__GB11_emoji_state_) { + case __GB11_emoji_state::__Extended_Pictographic: + if (__next_property == __EGC_property::__Extend) { + __GB11_emoji_state_ = __GB11_emoji_state::__Extend; + return false; + } + [[fallthrough]]; + case __GB11_emoji_state::__Extend: + if (__next_property == __EGC_property::__ZWJ) { + __GB11_emoji_state_ = __GB11_emoji_state::__ZWJ; + return false; + } + if (__next_property == __EGC_property::__Extend) + return false; + __active_rule_ = __rule::__none; + return __evaluate_none(__next_code_point, __next_property); + + case __GB11_emoji_state::__ZWJ: + if (__next_property == __EGC_property::__Extended_Pictographic) { + __GB11_emoji_state_ = __GB11_emoji_state::__Extended_Pictographic; + return false; + } + __active_rule_ = __rule::__none; + return __evaluate_none(__next_code_point, __next_property); + } + __libcpp_unreachable(); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool + __evaluate_GB12_GB13_regional_indicator(char32_t __next_code_point, __EGC_property __next_property) { + __active_rule_ = __rule::__none; + if (__next_property == __EGC_property::__Regional_Indicator) + return false; + return __evaluate_none(__next_code_point, __next_property); + } + + char32_t __prev_code_point_; + __EGC_property __prev_property_; + + enum class __rule { + __none, + __GB9c_indic_conjunct_break, + __GB11_emoji, + __GB12_GB13_regional_indicator, + }; + __rule __active_rule_ = __rule::__none; + + enum class __GB11_emoji_state { + __Extended_Pictographic, + __Extend, + __ZWJ, + }; + __GB11_emoji_state __GB11_emoji_state_ = __GB11_emoji_state::__Extended_Pictographic; + + enum class __GB9c_indic_conjunct_break_state { + __Consonant, + __Linker, + }; + + __GB9c_indic_conjunct_break_state __GB9c_indic_conjunct_break_state_ = __GB9c_indic_conjunct_break_state::__Consonant; + + // NOLINTEND(readability-identifier-naming) +}; /// Helper class to extract an extended grapheme cluster from a Unicode character range. /// @@ -382,9 +531,7 @@ class __extended_grapheme_cluster_view { public: _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(_Iterator __first, _Iterator __last) - : __code_point_view_(__first, __last), - __next_code_point_(__code_point_view_.__consume().__code_point), - __next_prop_(__extended_grapheme_custer_property_boundary::__get_property(__next_code_point_)) {} + : __code_point_view_(__first, __last), __at_break_(__code_point_view_.__consume().__code_point) {} struct __cluster { /// The first code point of the extended grapheme cluster. @@ -400,44 +547,20 @@ public: _Iterator __last_; }; - _LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() { - _LIBCPP_ASSERT_INTERNAL(__next_prop_ != __extended_grapheme_custer_property_boundary::__property::__eot, - "can't move beyond the end of input"); - - char32_t __code_point = __next_code_point_; - if (!__code_point_view_.__at_end()) - return {__code_point, __get_break()}; - - __next_prop_ = __extended_grapheme_custer_property_boundary::__property::__eot; - return {__code_point, __code_point_view_.__position()}; + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() { + char32_t __code_point = __at_break_.__current_code_point(); + _Iterator __position = __code_point_view_.__position(); + while (!__code_point_view_.__at_end()) { + if (__at_break_(__code_point_view_.__consume().__code_point)) + break; + __position = __code_point_view_.__position(); + } + return {__code_point, __position}; } private: __code_point_view<_CharT> __code_point_view_; - - char32_t __next_code_point_; - __extended_grapheme_custer_property_boundary::__property __next_prop_; - - _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __get_break() { - bool __ri_break_allowed = true; - bool __has_extened_pictographic = false; - while (true) { - _Iterator __result = __code_point_view_.__position(); - __extended_grapheme_custer_property_boundary::__property __prev = __next_prop_; - if (__code_point_view_.__at_end()) { - __next_prop_ = __extended_grapheme_custer_property_boundary::__property::__eot; - return __result; - } - __next_code_point_ = __code_point_view_.__consume().__code_point; - __next_prop_ = __extended_grapheme_custer_property_boundary::__get_property(__next_code_point_); - - __has_extened_pictographic |= - __prev == __extended_grapheme_custer_property_boundary::__property::__Extended_Pictographic; - - if (__at_extended_grapheme_cluster_break(__ri_break_allowed, __has_extened_pictographic, __prev, __next_prop_)) - return __result; - } - } + __extended_grapheme_cluster_break __at_break_; }; template <contiguous_iterator _Iterator> diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h index 6309483367..11f61dea18 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h @@ -119,7 +119,7 @@ namespace __width_estimation_table { /// - bits [0, 13] The size of the range, allowing 16384 elements. /// - bits [14, 31] The lower bound code point of the range. The upper bound of /// the range is lower bound + size. -_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[108] = { +_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[107] = { 0x0440005f /* 00001100 - 0000115f [ 96] */, // 0x08c68001 /* 0000231a - 0000231b [ 2] */, // 0x08ca4001 /* 00002329 - 0000232a [ 2] */, // @@ -158,14 +158,13 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[108] = { 0x0ba00019 /* 00002e80 - 00002e99 [ 26] */, // 0x0ba6c058 /* 00002e9b - 00002ef3 [ 89] */, // 0x0bc000d5 /* 00002f00 - 00002fd5 [ 214] */, // - 0x0bfc000b /* 00002ff0 - 00002ffb [ 12] */, // - 0x0c00003e /* 00003000 - 0000303e [ 63] */, // + 0x0bfc004e /* 00002ff0 - 0000303e [ 79] */, // 0x0c104055 /* 00003041 - 00003096 [ 86] */, // 0x0c264066 /* 00003099 - 000030ff [ 103] */, // 0x0c41402a /* 00003105 - 0000312f [ 43] */, // 0x0c4c405d /* 00003131 - 0000318e [ 94] */, // 0x0c640053 /* 00003190 - 000031e3 [ 84] */, // - 0x0c7c002e /* 000031f0 - 0000321e [ 47] */, // + 0x0c7bc02f /* 000031ef - 0000321e [ 48] */, // 0x0c880027 /* 00003220 - 00003247 [ 40] */, // 0x0c943fff /* 00003250 - 0000724f [16384] */, // 0x1c94323c /* 00007250 - 0000a48c [12861] */, // @@ -238,7 +237,7 @@ inline constexpr uint32_t __table_upper_bound = 0x0003fffd; /// Returns the estimated width of a Unicode code point. /// -/// \pre The code point is a valid Unicode code point. +/// \\pre The code point is a valid Unicode code point. [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int __estimated_width(const char32_t __code_point) noexcept { // Since __table_upper_bound contains the unshifted range do the // comparison without shifting. diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h b/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h index 43a074dd8d..052ea98c3c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h +++ b/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h @@ -101,15 +101,27 @@ _LIBCPP_HIDE_FROM_ABI void __write_escape_ill_formed_code_unit(basic_string<_Cha } template <class _CharT> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool __is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool +__is_escaped_sequence_written(basic_string<_CharT>& __str, bool __last_escaped, char32_t __value) { # ifdef _LIBCPP_HAS_NO_UNICODE // For ASCII assume everything above 127 is printable. if (__value > 127) return false; # endif + // [format.string.escaped]/2.2.1.2.1 + // CE is UTF-8, UTF-16, or UTF-32 and C corresponds to a Unicode scalar + // value whose Unicode property General_Category has a value in the groups + // Separator (Z) or Other (C), as described by UAX #44 of the Unicode Standard, if (!__escaped_output_table::__needs_escape(__value)) - return false; + // [format.string.escaped]/2.2.1.2.2 + // CE is UTF-8, UTF-16, or UTF-32 and C corresponds to a Unicode scalar + // value with the Unicode property Grapheme_Extend=Yes as described by UAX + // #44 of the Unicode Standard and C is not immediately preceded in S by a + // character P appended to E without translation to an escape sequence, + if (!__last_escaped || __extended_grapheme_custer_property_boundary::__get_property(__value) != + __extended_grapheme_custer_property_boundary::__property::__Extend) + return false; __formatter::__write_well_formed_escaped_code_unit(__str, __value); return true; @@ -124,8 +136,8 @@ enum class __escape_quotation_mark { __apostrophe, __double_quote }; // [format.string.escaped]/2 template <class _CharT> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool -__is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value, __escape_quotation_mark __mark) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool __is_escaped_sequence_written( + basic_string<_CharT>& __str, char32_t __value, bool __last_escaped, __escape_quotation_mark __mark) { // 2.2.1.1 - Mapped character in [tab:format.escape.sequences] switch (__value) { case _CharT('\t'): @@ -167,7 +179,7 @@ __is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value, __e // TODO FMT determine what to do with shift sequences. // 2.2.1.2.1 and 2.2.1.2.2 - Escape - return __formatter::__is_escaped_sequence_written(__str, __formatter::__to_char32(__value)); + return __formatter::__is_escaped_sequence_written(__str, __last_escaped, __formatter::__to_char32(__value)); } template <class _CharT> @@ -175,11 +187,15 @@ _LIBCPP_HIDE_FROM_ABI void __escape(basic_string<_CharT>& __str, basic_string_view<_CharT> __values, __escape_quotation_mark __mark) { __unicode::__code_point_view<_CharT> __view{__values.begin(), __values.end()}; + // When the first code unit has the property Grapheme_Extend=Yes it needs to + // be escaped. This happens when the previous code unit was also escaped. + bool __escape = true; while (!__view.__at_end()) { auto __first = __view.__position(); typename __unicode::__consume_result __result = __view.__consume(); if (__result.__status == __unicode::__consume_result::__ok) { - if (!__formatter::__is_escaped_sequence_written(__str, __result.__code_point, __mark)) + __escape = __formatter::__is_escaped_sequence_written(__str, __result.__code_point, __escape, __mark); + if (!__escape) // 2.2.1.3 - Add the character ranges::copy(__first, __view.__position(), std::back_insert_iterator(__str)); } else { diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h index 1fded441a2..3996460c52 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h @@ -95,7 +95,7 @@ __mu(_Ti& __ti, tuple<_Uj...>& __uj) { return std::__mu_expand(__ti, __uj, __indices()); } -template <bool IsPh, class _Ti, class _Uj> +template <bool _IsPh, class _Ti, class _Uj> struct __mu_return2 {}; template <class _Ti, class _Uj> @@ -105,8 +105,8 @@ struct __mu_return2<true, _Ti, _Uj> { template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type - __mu(_Ti&, _Uj& __uj) { +typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type +__mu(_Ti&, _Uj& __uj) { const size_t __indx = is_placeholder<_Ti>::value - 1; return std::forward<typename tuple_element<__indx, _Uj>::type>(std::get<__indx>(__uj)); } @@ -120,7 +120,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti, return __ti; } -template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh, class _TupleUj> +template <class _Ti, bool _IsReferenceWrapper, bool _IsBindEx, bool _IsPh, class _TupleUj> struct __mu_return_impl; template <bool _Invokable, class _Ti, class... _Uj> @@ -225,8 +225,8 @@ public: template <class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type - operator()(_Args&&... __args) const { + typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type + operator()(_Args&&... __args) const { return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...)); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h index ce26d3b706..e44768d228 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h @@ -52,7 +52,7 @@ struct __bind_back_t : __perfect_forward<__bind_back_op<tuple_size_v<_BoundArgs> template <class _Fn, class... _Args> requires is_constructible_v<decay_t<_Fn>, _Fn> && is_move_constructible_v<decay_t<_Fn>> && - (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...) + (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...) _LIBCPP_HIDE_FROM_ABI constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) noexcept( noexcept(__bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>( std::forward<_Fn>(__f), std::forward_as_tuple(std::forward<_Args>(__args)...)))) @@ -62,6 +62,20 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) n std::forward<_Fn>(__f), std::forward_as_tuple(std::forward<_Args>(__args)...)); } +# if _LIBCPP_STD_VER >= 23 +template <class _Fn, class... _Args> +_LIBCPP_HIDE_FROM_ABI constexpr auto bind_back(_Fn&& __f, _Args&&... __args) { + static_assert(is_constructible_v<decay_t<_Fn>, _Fn>, "bind_back requires decay_t<F> to be constructible from F"); + static_assert(is_move_constructible_v<decay_t<_Fn>>, "bind_back requires decay_t<F> to be move constructible"); + static_assert((is_constructible_v<decay_t<_Args>, _Args> && ...), + "bind_back requires all decay_t<Args> to be constructible from respective Args"); + static_assert((is_move_constructible_v<decay_t<_Args>> && ...), + "bind_back requires all decay_t<Args> to be move constructible"); + return __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>( + std::forward<_Fn>(__f), std::forward_as_tuple(std::forward<_Args>(__args)...)); +} +# endif // _LIBCPP_STD_VER >= 23 + #endif // _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h index 11d0bac3f8..87ef3affe8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h @@ -29,9 +29,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD struct __bind_front_op { template <class... _Args> - _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const - noexcept(noexcept(std::invoke(std::forward<_Args>(__args)...))) - -> decltype(std::invoke(std::forward<_Args>(__args)...)) { + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const noexcept( + noexcept(std::invoke(std::forward<_Args>(__args)...))) -> decltype(std::invoke(std::forward<_Args>(__args)...)) { return std::invoke(std::forward<_Args>(__args)...); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/function.h b/contrib/libs/cxxsupp/libcxx/include/__functional/function.h index 1faa9e92eb..c7b98035e3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/function.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/function.h @@ -55,7 +55,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD // bad_function_call _LIBCPP_DIAGNOSTIC_PUSH +# if !_LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables") +# endif class _LIBCPP_EXPORTED_FROM_ABI bad_function_call : public exception { public: _LIBCPP_HIDE_FROM_ABI bad_function_call() _NOEXCEPT = default; @@ -64,7 +66,7 @@ public: // Note that when a key function is not used, every translation unit that uses // bad_function_call will end up containing a weak definition of the vtable and // typeinfo. -# ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION +# if _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION ~bad_function_call() _NOEXCEPT override; # else _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_function_call() _NOEXCEPT override {} @@ -230,10 +232,10 @@ class _LIBCPP_TEMPLATE_VIS __base; template <class _Rp, class... _ArgTypes> class __base<_Rp(_ArgTypes...)> { - __base(const __base&); - __base& operator=(const __base&); - public: + __base(const __base&) = delete; + __base& operator=(const __base&) = delete; + _LIBCPP_HIDE_FROM_ABI __base() {} _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~__base() {} virtual __base* __clone() const = 0; @@ -514,7 +516,7 @@ struct __policy { } _LIBCPP_HIDE_FROM_ABI static const __policy* __create_empty() { - static const _LIBCPP_CONSTEXPR __policy __policy = { + static constexpr __policy __policy = { nullptr, nullptr, true, @@ -541,7 +543,7 @@ private: template <typename _Fun> _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ false_type) { - static const _LIBCPP_CONSTEXPR __policy __policy = { + static constexpr __policy __policy = { &__large_clone<_Fun>, &__large_destroy<_Fun>, false, @@ -556,7 +558,7 @@ private: template <typename _Fun> _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ true_type) { - static const _LIBCPP_CONSTEXPR __policy __policy = { + static constexpr __policy __policy = { nullptr, nullptr, false, diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h b/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h index b7be367bd5..8468de3dae 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h @@ -44,7 +44,7 @@ struct __is_identity<reference_wrapper<const __identity> > : true_type {}; struct identity { template <class _Tp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept { return std::forward<_Tp>(__t); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h b/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h index 13fc94f71c..b2d62f2e3e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h @@ -11,7 +11,6 @@ #define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT #include <__config> -#include <__type_traits/integral_constant.h> #include <__type_traits/void_t.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -23,10 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 14 template <class _Tp, class, class = void> -struct __is_transparent : false_type {}; +inline const bool __is_transparent_v = false; template <class _Tp, class _Up> -struct __is_transparent<_Tp, _Up, __void_t<typename _Tp::is_transparent> > : true_type {}; +inline const bool __is_transparent_v<_Tp, _Up, __void_t<typename _Tp::is_transparent> > = true; #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h index 349a6ce3a7..ee07a71774 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h @@ -38,8 +38,8 @@ public: template <class... _ArgTypes> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - typename __invoke_return<type, _ArgTypes...>::type - operator()(_ArgTypes&&... __args) const { + typename __invoke_return<type, _ArgTypes...>::type + operator()(_ArgTypes&&... __args) const { return std::__invoke(__f_, std::forward<_ArgTypes>(__args)...); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fun_ref.h b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fun_ref.h index fe43c46560..c344420b02 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fun_ref.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fun_ref.h @@ -89,8 +89,8 @@ public: }; template <class _Sp, class _Tp, class _Ap> -class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t - : public __binary_function<const _Tp*, _Ap, _Sp> { +class _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t : public __binary_function<const _Tp*, _Ap, _Sp> { _Sp (_Tp::*__p_)(_Ap) const; public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h b/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h index 7ddc00650f..0a6320f19d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h @@ -13,8 +13,7 @@ #include <__config> #include <__functional/binary_function.h> #include <__functional/unary_function.h> -#include <__type_traits/integral_constant.h> -#include <__type_traits/operation_traits.h> +#include <__type_traits/desugars_to.h> #include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -41,18 +40,18 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(plus); // The non-transparent std::plus specialization is only equivalent to a raw plus // operator when we don't perform an implicit conversion when calling it. template <class _Tp> -struct __desugars_to<__plus_tag, plus<_Tp>, _Tp, _Tp> : true_type {}; +inline const bool __desugars_to_v<__plus_tag, plus<_Tp>, _Tp, _Tp> = true; template <class _Tp, class _Up> -struct __desugars_to<__plus_tag, plus<void>, _Tp, _Up> : true_type {}; +inline const bool __desugars_to_v<__plus_tag, plus<void>, _Tp, _Up> = true; #if _LIBCPP_STD_VER >= 14 template <> struct _LIBCPP_TEMPLATE_VIS plus<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) + std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) + std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) + std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) + std::forward<_T2>(__u)) { return std::forward<_T1>(__t) + std::forward<_T2>(__u); } typedef void is_transparent; @@ -77,8 +76,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS minus<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) - std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) - std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) - std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) - std::forward<_T2>(__u)) { return std::forward<_T1>(__t) - std::forward<_T2>(__u); } typedef void is_transparent; @@ -103,8 +102,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS multiplies<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) * std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) * std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) * std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) * std::forward<_T2>(__u)) { return std::forward<_T1>(__t) * std::forward<_T2>(__u); } typedef void is_transparent; @@ -129,8 +128,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS divides<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) / std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) / std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) / std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) / std::forward<_T2>(__u)) { return std::forward<_T1>(__t) / std::forward<_T2>(__u); } typedef void is_transparent; @@ -155,8 +154,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS modulus<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) % std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) % std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) % std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) % std::forward<_T2>(__u)) { return std::forward<_T1>(__t) % std::forward<_T2>(__u); } typedef void is_transparent; @@ -179,7 +178,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS negate<void> { template <class _Tp> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const - noexcept(noexcept(-std::forward<_Tp>(__x))) -> decltype(-std::forward<_Tp>(__x)) { + noexcept(noexcept(-std::forward<_Tp>(__x))) // + -> decltype(-std::forward<_Tp>(__x)) { return -std::forward<_Tp>(__x); } typedef void is_transparent; @@ -206,8 +206,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS bit_and<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) & std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) & std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) & + std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) & std::forward<_T2>(__u)) { return std::forward<_T1>(__t) & std::forward<_T2>(__u); } typedef void is_transparent; @@ -225,7 +225,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS bit_not<void> { template <class _Tp> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const - noexcept(noexcept(~std::forward<_Tp>(__x))) -> decltype(~std::forward<_Tp>(__x)) { + noexcept(noexcept(~std::forward<_Tp>(__x))) // + -> decltype(~std::forward<_Tp>(__x)) { return ~std::forward<_Tp>(__x); } typedef void is_transparent; @@ -250,8 +251,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS bit_or<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) | std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) | std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) | std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) | std::forward<_T2>(__u)) { return std::forward<_T1>(__t) | std::forward<_T2>(__u); } typedef void is_transparent; @@ -276,8 +277,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS bit_xor<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) ^ std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) ^ std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) ^ std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) ^ std::forward<_T2>(__u)) { return std::forward<_T1>(__t) ^ std::forward<_T2>(__u); } typedef void is_transparent; @@ -304,8 +305,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS equal_to<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) == std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) == std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) == std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) == std::forward<_T2>(__u)) { return std::forward<_T1>(__t) == std::forward<_T2>(__u); } typedef void is_transparent; @@ -315,11 +316,11 @@ struct _LIBCPP_TEMPLATE_VIS equal_to<void> { // The non-transparent std::equal_to specialization is only equivalent to a raw equality // comparison when we don't perform an implicit conversion when calling it. template <class _Tp> -struct __desugars_to<__equal_tag, equal_to<_Tp>, _Tp, _Tp> : true_type {}; +inline const bool __desugars_to_v<__equal_tag, equal_to<_Tp>, _Tp, _Tp> = true; // In the transparent case, we do not enforce that template <class _Tp, class _Up> -struct __desugars_to<__equal_tag, equal_to<void>, _Tp, _Up> : true_type {}; +inline const bool __desugars_to_v<__equal_tag, equal_to<void>, _Tp, _Up> = true; #if _LIBCPP_STD_VER >= 14 template <class _Tp = void> @@ -339,8 +340,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS not_equal_to<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) != std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) != std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) != std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) != std::forward<_T2>(__u)) { return std::forward<_T1>(__t) != std::forward<_T2>(__u); } typedef void is_transparent; @@ -360,17 +361,23 @@ struct _LIBCPP_TEMPLATE_VIS less : __binary_function<_Tp, _Tp, bool> { }; _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less); +template <class _Tp> +inline const bool __desugars_to_v<__less_tag, less<_Tp>, _Tp, _Tp> = true; + #if _LIBCPP_STD_VER >= 14 template <> struct _LIBCPP_TEMPLATE_VIS less<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) < std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) < std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) < std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) < std::forward<_T2>(__u)) { return std::forward<_T1>(__t) < std::forward<_T2>(__u); } typedef void is_transparent; }; + +template <class _Tp> +inline const bool __desugars_to_v<__less_tag, less<>, _Tp, _Tp> = true; #endif #if _LIBCPP_STD_VER >= 14 @@ -391,8 +398,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS less_equal<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) <= std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) <= std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) <= std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) <= std::forward<_T2>(__u)) { return std::forward<_T1>(__t) <= std::forward<_T2>(__u); } typedef void is_transparent; @@ -417,8 +424,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS greater_equal<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) >= std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) >= std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) >= + std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) >= std::forward<_T2>(__u)) { return std::forward<_T1>(__t) >= std::forward<_T2>(__u); } typedef void is_transparent; @@ -443,8 +450,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS greater<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) > std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) > std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) > std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) > std::forward<_T2>(__u)) { return std::forward<_T1>(__t) > std::forward<_T2>(__u); } typedef void is_transparent; @@ -471,8 +478,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS logical_and<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) && std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) && std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) && std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) && std::forward<_T2>(__u)) { return std::forward<_T1>(__t) && std::forward<_T2>(__u); } typedef void is_transparent; @@ -495,7 +502,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS logical_not<void> { template <class _Tp> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const - noexcept(noexcept(!std::forward<_Tp>(__x))) -> decltype(!std::forward<_Tp>(__x)) { + noexcept(noexcept(!std::forward<_Tp>(__x))) // + -> decltype(!std::forward<_Tp>(__x)) { return !std::forward<_Tp>(__x); } typedef void is_transparent; @@ -520,8 +528,8 @@ template <> struct _LIBCPP_TEMPLATE_VIS logical_or<void> { template <class _T1, class _T2> _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const - noexcept(noexcept(std::forward<_T1>(__t) || std::forward<_T2>(__u))) - -> decltype(std::forward<_T1>(__t) || std::forward<_T2>(__u)) { + noexcept(noexcept(std::forward<_T1>(__t) || std::forward<_T2>(__u))) // + -> decltype(std::forward<_T1>(__t) || std::forward<_T2>(__u)) { return std::forward<_T1>(__t) || std::forward<_T2>(__u); } typedef void is_transparent; diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_binary_function.h b/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_binary_function.h index 51a7c3fe0f..e345250dcd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_binary_function.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_binary_function.h @@ -22,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) template <class _Arg1, class _Arg2, class _Result> -class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function - : public __binary_function<_Arg1, _Arg2, _Result> { +class _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function : public __binary_function<_Arg1, _Arg2, _Result> { _Result (*__f_)(_Arg1, _Arg2); public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_unary_function.h b/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_unary_function.h index 0338e76717..3a5d153d36 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_unary_function.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/pointer_to_unary_function.h @@ -22,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) template <class _Arg, class _Result> -class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function - : public __unary_function<_Arg, _Result> { +class _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function : public __unary_function<_Arg, _Result> { _Result (*__f_)(_Arg); public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h b/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h index 38b2801804..27f06eadd0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h @@ -13,8 +13,7 @@ #include <__concepts/equality_comparable.h> #include <__concepts/totally_ordered.h> #include <__config> -#include <__type_traits/integral_constant.h> -#include <__type_traits/operation_traits.h> +#include <__type_traits/desugars_to.h> #include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -98,7 +97,10 @@ struct greater_equal { // For ranges we do not require that the types on each side of the equality // operator are of the same type template <class _Tp, class _Up> -struct __desugars_to<__equal_tag, ranges::equal_to, _Tp, _Up> : true_type {}; +inline const bool __desugars_to_v<__equal_tag, ranges::equal_to, _Tp, _Up> = true; + +template <class _Tp, class _Up> +inline const bool __desugars_to_v<__less_tag, ranges::less, _Tp, _Up> = true; #endif // _LIBCPP_STD_VER >= 20 diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h b/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h index 94b39e3bc7..3570e2673c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h @@ -10,11 +10,14 @@ #ifndef _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H #define _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H +#include <__compare/synth_three_way.h> +#include <__concepts/boolean_testable.h> #include <__config> #include <__functional/invoke.h> #include <__functional/weak_result_type.h> #include <__memory/addressof.h> #include <__type_traits/enable_if.h> +#include <__type_traits/is_const.h> #include <__type_traits/remove_cvref.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> @@ -36,7 +39,7 @@ private: type* __f_; static void __fun(_Tp&) _NOEXCEPT; - static void __fun(_Tp&&) = delete; + static void __fun(_Tp&&) = delete; // NOLINT(modernize-use-equals-delete) ; This is llvm.org/PR54276 public: template <class _Up, @@ -64,6 +67,54 @@ public: { return std::__invoke(get(), std::forward<_ArgTypes>(__args)...); } + +#if _LIBCPP_STD_VER >= 26 + + // [refwrap.comparisons], comparisons + + _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper __y) + requires requires { + { __x.get() == __y.get() } -> __boolean_testable; + } + { + return __x.get() == __y.get(); + } + + _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, const _Tp& __y) + requires requires { + { __x.get() == __y } -> __boolean_testable; + } + { + return __x.get() == __y; + } + + _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper<const _Tp> __y) + requires(!is_const_v<_Tp>) && requires { + { __x.get() == __y.get() } -> __boolean_testable; + } + { + return __x.get() == __y.get(); + } + + _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, reference_wrapper __y) + requires requires { std::__synth_three_way(__x.get(), __y.get()); } + { + return std::__synth_three_way(__x.get(), __y.get()); + } + + _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, const _Tp& __y) + requires requires { std::__synth_three_way(__x.get(), __y); } + { + return std::__synth_three_way(__x.get(), __y); + } + + _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, reference_wrapper<const _Tp> __y) + requires(!is_const_v<_Tp>) && requires { std::__synth_three_way(__x.get(), __y.get()); } + { + return std::__synth_three_way(__x.get(), __y.get()); + } + +#endif // _LIBCPP_STD_VER >= 26 }; #if _LIBCPP_STD_VER >= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/unary_negate.h b/contrib/libs/cxxsupp/libcxx/include/__functional/unary_negate.h index d130b7d728..5bd487a97b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__functional/unary_negate.h +++ b/contrib/libs/cxxsupp/libcxx/include/__functional/unary_negate.h @@ -22,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) template <class _Predicate> -class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate - : public __unary_function<typename _Predicate::argument_type, bool> { +class _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX17 unary_negate : public __unary_function<typename _Predicate::argument_type, bool> { _Predicate __pred_; public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h index 82c865d58c..48350709d4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h +++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h @@ -18,6 +18,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD +class _LIBCPP_EXPORTED_FROM_ABI ios_base; + template <class _CharT, class _Traits = char_traits<_CharT> > class _LIBCPP_TEMPLATE_VIS basic_ios; diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h index 03b78ad2bd..d68b2c2b63 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h +++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___FWD_MEMORY_RESOURCE_H #define _LIBCPP___FWD_MEMORY_RESOURCE_H -#include <__availability> #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h index 320c4e4c81..2418e1f9b2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h +++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___FWD_STRING_H #define _LIBCPP___FWD_STRING_H -#include <__availability> #include <__config> #include <__fwd/memory.h> #include <__fwd/memory_resource.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__hash_table b/contrib/libs/cxxsupp/libcxx/include/__hash_table index a705117d01..0257585285 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__hash_table +++ b/contrib/libs/cxxsupp/libcxx/include/__hash_table @@ -240,9 +240,9 @@ public: private: static_assert(!is_const<__node_type>::value, "_NodePtr should never be a pointer to const"); - static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value), + static_assert(is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value, "_VoidPtr does not point to unqualified void type"); - static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value), + static_assert(is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value, "_VoidPtr does not rebind to _NodePtr."); }; @@ -700,11 +700,11 @@ private: // check for sane allocator pointer rebinding semantics. Rebinding the // allocator for a new pointer type should be exactly the same as rebinding // the pointer using 'pointer_traits'. - static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value), + static_assert(is_same<__node_pointer, typename __node_traits::pointer>::value, "Allocator does not rebind pointers in a sane manner."); typedef __rebind_alloc<__node_traits, __first_node> __node_base_allocator; typedef allocator_traits<__node_base_allocator> __node_base_traits; - static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), + static_assert(is_same<__node_base_pointer, typename __node_base_traits::pointer>::value, "Allocator does not rebind pointers in a sane manner."); private: @@ -928,13 +928,12 @@ public: _LIBCPP_HIDE_FROM_ABI void swap(__hash_table& __u) #if _LIBCPP_STD_VER <= 11 - _NOEXCEPT_(__is_nothrow_swappable<hasher>::value&& __is_nothrow_swappable<key_equal>::value && + _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || - __is_nothrow_swappable<__pointer_allocator>::value) && - (!__node_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value)); + __is_nothrow_swappable_v<__pointer_allocator>) && + (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)); #else - _NOEXCEPT_(__is_nothrow_swappable<hasher>::value&& __is_nothrow_swappable<key_equal>::value); + _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>); #endif _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return max_size(); } @@ -1101,8 +1100,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u, const template <class _Tp, class _Hash, class _Equal, class _Alloc> __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() { #if defined(_LIBCPP_CXX03_LANG) - static_assert((is_copy_constructible<key_equal>::value), "Predicate must be copy-constructible."); - static_assert((is_copy_constructible<hasher>::value), "Hasher must be copy-constructible."); + static_assert(is_copy_constructible<key_equal>::value, "Predicate must be copy-constructible."); + static_assert(is_copy_constructible<hasher>::value, "Hasher must be copy-constructible."); #endif __deallocate_node(__p1_.first().__next_); @@ -1228,7 +1227,7 @@ template <class _InputIterator> void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first, _InputIterator __last) { typedef iterator_traits<_InputIterator> _ITraits; typedef typename _ITraits::value_type _ItValueType; - static_assert((is_same<_ItValueType, __container_value_type>::value), + static_assert(is_same<_ItValueType, __container_value_type>::value, "__assign_unique may only be called with the containers value type"); if (bucket_count() != 0) { @@ -1985,12 +1984,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(const _Key& __k) c template <class _Tp, class _Hash, class _Equal, class _Alloc> void __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u) #if _LIBCPP_STD_VER <= 11 - _NOEXCEPT_(__is_nothrow_swappable<hasher>::value&& __is_nothrow_swappable<key_equal>::value && + _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || - __is_nothrow_swappable<__pointer_allocator>::value) && - (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value)) + __is_nothrow_swappable_v<__pointer_allocator>) && + (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)) #else - _NOEXCEPT_(__is_nothrow_swappable<hasher>::value&& __is_nothrow_swappable<key_equal>::value) + _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>) #endif { _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR( diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h index 5c6090eeb4..acc4f60bf6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h @@ -54,8 +54,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(const _Cp& __c) -> # if _LIBCPP_STD_VER >= 14 template <class _Cp> -_LIBCPP_HIDE_FROM_ABI constexpr auto cbegin(const _Cp& __c) noexcept(noexcept(std::begin(__c))) - -> decltype(std::begin(__c)) { +_LIBCPP_HIDE_FROM_ABI constexpr auto +cbegin(const _Cp& __c) noexcept(noexcept(std::begin(__c))) -> decltype(std::begin(__c)) { return std::begin(__c); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h index 5bcefeb512..4c51bdefd8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h @@ -170,14 +170,14 @@ public: } else { // Otherwise, if `n` is non-negative, while `bool(i != bound_sentinel)` is true, increments `i` but at // most `n` times. - while (__i != ___bound_sentinel && __n > 0) { + while (__n > 0 && __i != ___bound_sentinel) { ++__i; --__n; } // Otherwise, while `bool(i != bound_sentinel)` is true, decrements `i` but at most `-n` times. if constexpr (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>) { - while (__i != ___bound_sentinel && __n < 0) { + while (__n < 0 && __i != ___bound_sentinel) { --__i; ++__n; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/aliasing_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/aliasing_iterator.h new file mode 100644 index 0000000000..94ba577078 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/aliasing_iterator.h @@ -0,0 +1,127 @@ +//===----------------------------------------------------------------------===// +// +// 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___ITERATOR_ALIASING_ITERATOR_H +#define _LIBCPP___ITERATOR_ALIASING_ITERATOR_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__memory/pointer_traits.h> +#include <__type_traits/is_trivial.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +// This iterator wrapper is used to type-pun an iterator to return a different type. This is done without UB by not +// actually punning the type, but instead inspecting the object representation of the base type and copying that into +// an instance of the alias type. For that reason the alias type has to be trivial. The alias is returned as a prvalue +// when derferencing the iterator, since it is temporary storage. This wrapper is used to vectorize some algorithms. + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BaseIter, class _Alias> +struct __aliasing_iterator_wrapper { + class __iterator { + _BaseIter __base_ = nullptr; + + using __iter_traits = iterator_traits<_BaseIter>; + using __base_value_type = typename __iter_traits::value_type; + + static_assert(__has_random_access_iterator_category<_BaseIter>::value, + "The base iterator has to be a random access iterator!"); + + public: + using iterator_category = random_access_iterator_tag; + using value_type = _Alias; + using difference_type = ptrdiff_t; + using reference = value_type&; + using pointer = value_type*; + + static_assert(is_trivial<value_type>::value); + static_assert(sizeof(__base_value_type) == sizeof(value_type)); + + _LIBCPP_HIDE_FROM_ABI __iterator() = default; + _LIBCPP_HIDE_FROM_ABI __iterator(_BaseIter __base) _NOEXCEPT : __base_(__base) {} + + _LIBCPP_HIDE_FROM_ABI __iterator& operator++() _NOEXCEPT { + ++__base_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI __iterator operator++(int) _NOEXCEPT { + __iterator __tmp(*this); + ++__base_; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI __iterator& operator--() _NOEXCEPT { + --__base_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI __iterator operator--(int) _NOEXCEPT { + __iterator __tmp(*this); + --__base_; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI friend __iterator operator+(__iterator __iter, difference_type __n) _NOEXCEPT { + return __iterator(__iter.__base_ + __n); + } + + _LIBCPP_HIDE_FROM_ABI friend __iterator operator+(difference_type __n, __iterator __iter) _NOEXCEPT { + return __iterator(__n + __iter.__base_); + } + + _LIBCPP_HIDE_FROM_ABI __iterator& operator+=(difference_type __n) _NOEXCEPT { + __base_ += __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI friend __iterator operator-(__iterator __iter, difference_type __n) _NOEXCEPT { + return __iterator(__iter.__base_ - __n); + } + + _LIBCPP_HIDE_FROM_ABI friend difference_type operator-(__iterator __lhs, __iterator __rhs) _NOEXCEPT { + return __lhs.__base_ - __rhs.__base_; + } + + _LIBCPP_HIDE_FROM_ABI __iterator& operator-=(difference_type __n) _NOEXCEPT { + __base_ -= __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI _BaseIter __base() const _NOEXCEPT { return __base_; } + + _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { + _Alias __val; + __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + return __val; + } + + _LIBCPP_HIDE_FROM_ABI value_type operator[](difference_type __n) const _NOEXCEPT { return *(*this + __n); } + + _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __iterator& __lhs, const __iterator& __rhs) _NOEXCEPT { + return __lhs.__base_ == __rhs.__base_; + } + + _LIBCPP_HIDE_FROM_ABI friend bool operator!=(const __iterator& __lhs, const __iterator& __rhs) _NOEXCEPT { + return __lhs.__base_ != __rhs.__base_; + } + }; +}; + +// This is required to avoid ADL instantiations on _BaseT +template <class _BaseT, class _Alias> +using __aliasing_iterator = typename __aliasing_iterator_wrapper<_BaseT, _Alias>::__iterator; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ALIASING_ITERATOR_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h index 15e87f01bf..b5dcfe515c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h @@ -84,8 +84,8 @@ private: // // Since it is non-standard for iterators to have this constructor, ___bounded_iter must // be created via `std::__make_bounded_iter`. - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit ___bounded_iter( - _Iterator __current, _Iterator __begin, _Iterator __end) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit ___bounded_iter(_Iterator __current, _Iterator __begin, _Iterator __end) : __current_(__current), __begin_(__begin), __end_(__end) { _LIBCPP_ASSERT_INTERNAL( __begin <= __current, "___bounded_iter(current, begin, end): current and begin are inconsistent"); diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h index 7b3f4610d5..199de2cc73 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h @@ -124,7 +124,7 @@ public: } template <class _I2 = _Iter> - _LIBCPP_HIDE_FROM_ABI decltype(auto) operator->() const + _LIBCPP_HIDE_FROM_ABI auto operator->() const requires indirectly_readable<const _I2> && (requires(const _I2& __i) { __i.operator->(); } || is_reference_v<iter_reference_t<_I2>> || constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>) diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h index 008c52fa87..ea2832e3b9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h @@ -129,7 +129,7 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI decltype(auto) operator++(int) { + _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator++(int) { _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end."); --__count_; # ifndef _LIBCPP_HAS_NO_EXCEPTIONS diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h index cdb561e684..ba3536b686 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h @@ -68,7 +68,7 @@ concept __cpp17_default_constructible = is_default_constructible_v<_Tp>; template <class _Iter> concept __cpp17_iterator = __cpp17_copy_constructible<_Iter> && __cpp17_copy_assignable<_Iter> && __cpp17_destructible<_Iter> && - (is_signed_v<__iter_diff_t<_Iter>> || is_void_v<__iter_diff_t<_Iter>>)&&requires(_Iter __iter) { + (is_signed_v<__iter_diff_t<_Iter>> || is_void_v<__iter_diff_t<_Iter>>) && requires(_Iter __iter) { { *__iter }; { ++__iter } -> same_as<_Iter&>; }; @@ -157,29 +157,31 @@ concept __cpp17_random_access_iterator = _LIBCPP_END_NAMESPACE_STD # ifndef _LIBCPP_DISABLE_ITERATOR_CHECKS -# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t) static_assert(::std::__cpp17_input_iterator<iter_t>); -# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t) \ - static_assert(::std::__cpp17_output_iterator<iter_t, write_t>); -# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t) static_assert(::std::__cpp17_forward_iterator<iter_t>); -# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t) \ - static_assert(::std::__cpp17_bidirectional_iterator<iter_t>); -# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t) \ - static_assert(::std::__cpp17_random_access_iterator<iter_t>); +# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) \ + static_assert(::std::__cpp17_input_iterator<iter_t>, message) +# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) \ + static_assert(::std::__cpp17_output_iterator<iter_t, write_t>, message) +# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) \ + static_assert(::std::__cpp17_forward_iterator<iter_t>, message) +# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) \ + static_assert(::std::__cpp17_bidirectional_iterator<iter_t>, message) +# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) \ + static_assert(::std::__cpp17_random_access_iterator<iter_t>, message) # else -# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t) -# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t) +# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) static_assert(true) # endif #else // _LIBCPP_STD_VER >= 20 -# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t) -# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t) -# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t) +# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) static_assert(true) +# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) static_assert(true) #endif // _LIBCPP_STD_VER >= 20 diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h index 3986739061..b7c1603652 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h @@ -23,12 +23,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Cont> -constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) _NOEXCEPT_(noexcept(__c.data())) -> decltype(__c.data()) { +constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) { return __c.data(); } template <class _Cont> -constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) _NOEXCEPT_(noexcept(__c.data())) -> decltype(__c.data()) { +constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) { return __c.data(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h index 3ca0aff6be..773f277695 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h @@ -23,18 +23,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Cont> -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI constexpr auto empty(const _Cont& __c) - _NOEXCEPT_(noexcept(__c.empty())) -> decltype(__c.empty()) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto +empty(const _Cont& __c) noexcept(noexcept(__c.empty())) -> decltype(__c.empty()) { return __c.empty(); } template <class _Tp, size_t _Sz> -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI constexpr bool empty(const _Tp (&)[_Sz]) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; } template <class _Ep> -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI constexpr bool empty(initializer_list<_Ep> __il) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h index 52c3f095e7..01ab1b97d6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h @@ -42,7 +42,7 @@ void iter_swap(_I1, _I2) = delete; template <class _T1, class _T2> concept __unqualified_iter_swap = - (__class_or_enum<remove_cvref_t<_T1>> || __class_or_enum<remove_cvref_t<_T2>>)&&requires(_T1&& __x, _T2&& __y) { + (__class_or_enum<remove_cvref_t<_T1>> || __class_or_enum<remove_cvref_t<_T2>>) && requires(_T1&& __x, _T2&& __y) { // NOLINTNEXTLINE(libcpp-robust-against-adl) iter_swap ADL calls should only be made through ranges::iter_swap iter_swap(std::forward<_T1>(__x), std::forward<_T2>(__y)); }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h index eefd5b3748..a1c53e9bd2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h @@ -105,9 +105,8 @@ public: typedef iterator_type pointer; typedef typename iterator_traits<iterator_type>::reference __reference; - typedef typename conditional< is_reference<__reference>::value, - __libcpp_remove_reference_t<__reference>&&, - __reference >::type reference; + typedef __conditional_t<is_reference<__reference>::value, __libcpp_remove_reference_t<__reference>&&, __reference> + reference; #endif // _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit move_iterator(_Iter __i) : __current_(std::move(__i)) {} @@ -292,8 +291,8 @@ operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { #if _LIBCPP_STD_VER >= 20 template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2> inline _LIBCPP_HIDE_FROM_ABI constexpr auto -operator<=>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) - -> compare_three_way_result_t<_Iter1, _Iter2> { +operator<=>(const move_iterator<_Iter1>& __x, + const move_iterator<_Iter2>& __y) -> compare_three_way_result_t<_Iter1, _Iter2> { return __x.base() <=> __y.base(); } #endif // _LIBCPP_STD_VER >= 20 @@ -330,6 +329,12 @@ operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterato } #endif // _LIBCPP_STD_VER >= 20 +#if _LIBCPP_STD_VER >= 20 +template <class _Iter1, class _Iter2> + requires(!sized_sentinel_for<_Iter1, _Iter2>) +inline constexpr bool disable_sized_sentinel_for<move_iterator<_Iter1>, move_iterator<_Iter2>> = true; +#endif // _LIBCPP_STD_VER >= 20 + template <class _Iter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter> make_move_iterator(_Iter __i) { return move_iterator<_Iter>(std::move(__i)); diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h index 3fb2a42499..a2e35286e4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h @@ -184,7 +184,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i) noexcept( - is_nothrow_copy_constructible_v<_Iter>&& noexcept(ranges::iter_move(--std::declval<_Iter&>()))) { + is_nothrow_copy_constructible_v<_Iter> && noexcept(ranges::iter_move(--std::declval<_Iter&>()))) { auto __tmp = __i.base(); return ranges::iter_move(--__tmp); } @@ -192,9 +192,8 @@ public: template <indirectly_swappable<_Iter> _Iter2> _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y) noexcept( - is_nothrow_copy_constructible_v<_Iter> && - is_nothrow_copy_constructible_v<_Iter2>&& noexcept( - ranges::iter_swap(--std::declval<_Iter&>(), --std::declval<_Iter2&>()))) { + is_nothrow_copy_constructible_v<_Iter> && is_nothrow_copy_constructible_v<_Iter2> && + noexcept(ranges::iter_swap(--std::declval<_Iter&>(), --std::declval<_Iter2&>()))) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); ranges::iter_swap(--__xtmp, --__ytmp); @@ -285,8 +284,8 @@ operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& #ifndef _LIBCPP_CXX03_LANG template <class _Iter1, class _Iter2> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto -operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) - -> decltype(__y.base() - __x.base()) { +operator-(const reverse_iterator<_Iter1>& __x, + const reverse_iterator<_Iter2>& __y) -> decltype(__y.base() - __x.base()) { return __y.base() - __x.base(); } #else diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h index eac3ccf522..876e6963f7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h @@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Cont> -_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) { +_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) noexcept(noexcept(__c.size())) -> decltype(__c.size()) { return __c.size(); } @@ -35,9 +35,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr size_t size(const _Tp (&)[_Sz]) noexcept { # if _LIBCPP_STD_VER >= 20 template <class _Cont> -_LIBCPP_HIDE_FROM_ABI constexpr auto ssize(const _Cont& __c) - _NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()))) - -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> { +_LIBCPP_HIDE_FROM_ABI constexpr auto +ssize(const _Cont& __c) noexcept(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>( + __c.size()))) -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> { return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h index 3124826189..252d13b26c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h @@ -186,8 +186,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.base() - __y.base()) #else - typename __wrap_iter<_Iter1>::difference_type - operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +typename __wrap_iter<_Iter1>::difference_type +operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT #endif // C++03 { return __x.base() - __y.base(); diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale b/contrib/libs/cxxsupp/libcxx/include/__locale index 6692046386..8784b24340 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale +++ b/contrib/libs/cxxsupp/libcxx/include/__locale @@ -16,6 +16,7 @@ #include <__mutex/once_flag.h> #include <__type_traits/make_unsigned.h> #include <__utility/no_destroy.h> +#include <__utility/private_constructor_tag.h> #include <atomic> #include <cctype> #include <clocale> @@ -49,6 +50,9 @@ _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale&); class _LIBCPP_EXPORTED_FROM_ABI locale { public: + // locale is essentially a shared_ptr that doesn't support weak_ptrs and never got a move constructor. + using __trivially_relocatable = locale; + // types: class _LIBCPP_EXPORTED_FROM_ABI facet; class _LIBCPP_EXPORTED_FROM_ABI id; @@ -98,8 +102,7 @@ private: template <class> friend struct __no_destroy; - struct __private_tag {}; - _LIBCPP_HIDE_FROM_ABI explicit locale(__private_tag, __imp* __loc) : __locale_(__loc) {} + _LIBCPP_HIDE_FROM_ABI explicit locale(__private_constructor_tag, __imp* __loc) : __locale_(__loc) {} void __install_ctor(const locale&, facet*, long); static locale& __global(); @@ -1248,10 +1251,10 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>; #endif -extern template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS - codecvt_byname<char16_t, char, mbstate_t>; // deprecated in C++20 -extern template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS - codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++20 +extern template class _LIBCPP_DEPRECATED_IN_CXX20 +_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>; // deprecated in C++20 +extern template class _LIBCPP_DEPRECATED_IN_CXX20 +_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++20 #ifndef _LIBCPP_HAS_NO_CHAR8_T extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>; // C++20 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>; // C++20 diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api.h index 1974b9d458..2e1594d8e5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api.h @@ -95,18 +95,4 @@ except that locale_t is used instead of the current global locale. The variadic functions may be implemented as templates with a parameter pack instead of variadic functions. */ -/* -// TODO: These symbols are never actually used, but defined by one or more implementations. They should be removed. -long strtol_l(const char* str, char** str_end, locale_t); -unsigned long strtoul_l(const char* str, char** str_end, locale_t); -long long wcstoll_l(const wchar_t* str, wchar_t** str_end, int base, locale_t); -unsigned long long wcstoull_l(const wchar_t* str, wchar_t** str_end, int base, locale_t); -long double wcstold_l(const wchar_t* str, wchar_t** str_end, int base, locale_t); -int sprintf_l(char* str, const char* format, locale_t, ...); -int vsprintf_l(char* str, const char* format, locale_t, va_list); -int vsnprintf_l(char* str, size_t size, const char* format, locale_t, va_list); -int isblank_l(int ch, locale_t); - -*/ - #endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/android.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/android.h index c2dea1e731..9965d8bbf6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/android.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/android.h @@ -10,63 +10,41 @@ #ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_ANDROID_H #define _LIBCPP___LOCALE_LOCALE_BASE_API_ANDROID_H -#if defined(__BIONIC__) +#include <stdlib.h> -# ifdef __cplusplus +// FIXME: Is this actually required? extern "C" { -# endif - -# include <stdlib.h> -# include <xlocale.h> - -# ifdef __cplusplus +#include <xlocale.h> } -# endif - -# if defined(__ANDROID__) -# include <android/api-level.h> -# if __ANDROID_API__ < 21 -# include <__support/xlocale/__posix_l_fallback.h> -# endif +#include <android/api-level.h> +#if __ANDROID_API__ < 21 +# include <__support/xlocale/__posix_l_fallback.h> +#endif // If we do not have this header, we are in a platform build rather than an NDK // build, which will always be at least as new as the ToT NDK, in which case we // don't need any of the inlines below since libc provides them. -# if __has_include(<android/ndk-version.h>) -# include <android/ndk-version.h> +#if __has_include(<android/ndk-version.h>) +# include <android/ndk-version.h> // In NDK versions later than 16, locale-aware functions are provided by // legacy_stdlib_inlines.h -# if __NDK_MAJOR__ <= 16 -# if __ANDROID_API__ < 21 -# include <__support/xlocale/__strtonum_fallback.h> -# elif __ANDROID_API__ < 26 - -# if defined(__cplusplus) -extern "C" { -# endif +# if __NDK_MAJOR__ <= 16 +# if __ANDROID_API__ < 21 +# include <__support/xlocale/__strtonum_fallback.h> +# elif __ANDROID_API__ < 26 -inline _LIBCPP_HIDE_FROM_ABI_C float strtof_l(const char* __nptr, char** __endptr, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) { return ::strtof(__nptr, __endptr); } -inline _LIBCPP_HIDE_FROM_ABI_C double strtod_l(const char* __nptr, char** __endptr, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) { return ::strtod(__nptr, __endptr); } -inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) { - return ::strtol(__nptr, __endptr, __base); -} - -# if defined(__cplusplus) -} -# endif - -# endif // __ANDROID_API__ < 26 +# endif // __ANDROID_API__ < 26 -# endif // __NDK_MAJOR__ <= 16 -# endif // __has_include(<android/ndk-version.h>) -# endif // defined(__ANDROID__) +# endif // __NDK_MAJOR__ <= 16 +#endif // __has_include(<android/ndk-version.h>) -#endif // defined(__BIONIC__) #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_ANDROID_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/fuchsia.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/fuchsia.h index f999bead23..4c3440f981 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/fuchsia.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/fuchsia.h @@ -10,13 +10,9 @@ #ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_FUCHSIA_H #define _LIBCPP___LOCALE_LOCALE_BASE_API_FUCHSIA_H -#if defined(__Fuchsia__) - -# include <__support/xlocale/__posix_l_fallback.h> -# include <__support/xlocale/__strtonum_fallback.h> -# include <cstdlib> -# include <cwchar> - -#endif // defined(__Fuchsia__) +#include <__support/xlocale/__posix_l_fallback.h> +#include <__support/xlocale/__strtonum_fallback.h> +#include <cstdlib> +#include <cwchar> #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_FUCHSIA_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/ibm.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/ibm.h index c5d7f34186..01af201944 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/ibm.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/ibm.h @@ -20,10 +20,6 @@ #include "cstdlib" -#ifdef __cplusplus -extern "C" { -#endif - #if defined(__MVS__) # include <wctype.h> // POSIX routines @@ -62,11 +58,6 @@ inline _LIBCPP_HIDE_FROM_ABI long long strtoll_l(const char* __nptr, char** __en return ::strtoll(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t locale) { - __setAndRestore __newloc(locale); - return ::strtol(__nptr, __endptr, __base); -} - inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t locale) { __setAndRestore __newloc(locale); return ::strtod(__nptr, __endptr); @@ -88,12 +79,8 @@ strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t locale) { return ::strtoull(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI unsigned long strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t locale) { - __setAndRestore __newloc(locale); - return ::strtoul(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI int vasprintf(char** strp, const char* fmt, va_list ap) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char* fmt, va_list ap) { const size_t buff_size = 256; if ((*strp = (char*)malloc(buff_size)) == NULL) { return -1; @@ -118,7 +105,4 @@ inline _LIBCPP_HIDE_FROM_ABI int vasprintf(char** strp, const char* fmt, va_list return str_size; } -#ifdef __cplusplus -} -#endif #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_IBM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h index b7e3be756e..2baacb51cd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h @@ -30,9 +30,8 @@ struct __libcpp_locale_guard { locale_t __old_loc_; -private: - __libcpp_locale_guard(__libcpp_locale_guard const&); - __libcpp_locale_guard& operator=(__libcpp_locale_guard const&); + __libcpp_locale_guard(__libcpp_locale_guard const&) = delete; + __libcpp_locale_guard& operator=(__libcpp_locale_guard const&) = delete; }; #elif defined(_LIBCPP_MSVCRT_LIKE) struct __libcpp_locale_guard { diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/musl.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/musl.h index e4121ec1a9..bf7b849d58 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/musl.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/musl.h @@ -20,34 +20,12 @@ #include <cstdlib> #include <cwchar> -#ifdef __cplusplus -extern "C" { -#endif - -inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoll(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long -strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoull(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI_C long long wcstoll_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) { - return ::wcstoll(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long -wcstoull_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) { - return ::wcstoull(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C long double wcstold_l(const wchar_t* __nptr, wchar_t** __endptr, locale_t) { - return ::wcstold(__nptr, __endptr); -} - -#ifdef __cplusplus -} -#endif - #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_MUSL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/newlib.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/newlib.h index 8d030cb732..a8c1cff16e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/newlib.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/newlib.h @@ -9,14 +9,4 @@ #ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_NEWLIB_H #define _LIBCPP___LOCALE_LOCALE_BASE_API_NEWLIB_H -#if defined(_NEWLIB_VERSION) - -# if !defined(__NEWLIB__) || __NEWLIB__ < 2 || __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5 -# include <__support/xlocale/__nop_locale_mgmt.h> -# include <__support/xlocale/__posix_l_fallback.h> -# include <__support/xlocale/__strtonum_fallback.h> -# endif - -#endif // _NEWLIB_VERSION - #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_NEWLIB_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/openbsd.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/openbsd.h index 623abdb4db..0c05d6a0f7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/openbsd.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/openbsd.h @@ -16,20 +16,4 @@ #include <ctype.h> #include <cwctype> -#ifdef __cplusplus -extern "C" { -#endif - -inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) { - return ::strtol(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t) { - return ::strtoul(__nptr, __endptr, __base); -} - -#ifdef __cplusplus -} -#endif - #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_OPENBSD_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/win32.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/win32.h index 5dfacfb9c1..f66baffb69 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/win32.h +++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/win32.h @@ -225,15 +225,11 @@ _LIBCPP_EXPORTED_FROM_ABI size_t strftime_l(char* ret, size_t n, const char* for # define strftime_l _strftime_l #endif #define sscanf_l(__s, __l, __f, ...) _sscanf_l(__s, __f, __l, __VA_ARGS__) -#define sprintf_l(__s, __l, __f, ...) _sprintf_l(__s, __f, __l, __VA_ARGS__) -#define vsprintf_l(__s, __l, __f, ...) _vsprintf_l(__s, __f, __l, __VA_ARGS__) -#define vsnprintf_l(__s, __n, __l, __f, ...) _vsnprintf_l(__s, __n, __f, __l, __VA_ARGS__) _LIBCPP_EXPORTED_FROM_ABI int snprintf_l(char* __ret, size_t __n, locale_t __loc, const char* __format, ...); _LIBCPP_EXPORTED_FROM_ABI int asprintf_l(char** __ret, locale_t __loc, const char* __format, ...); _LIBCPP_EXPORTED_FROM_ABI int vasprintf_l(char** __ret, locale_t __loc, const char* __format, va_list __ap); // not-so-pressing FIXME: use locale to determine blank characters -inline int isblank_l(int __c, locale_t /*loc*/) { return (__c == ' ' || __c == '\t'); } inline int iswblank_l(wint_t __c, locale_t /*loc*/) { return (__c == L' ' || __c == L'\t'); } #endif // _LIBCPP___LOCALE_LOCALE_BASE_API_WIN32_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/abs.h b/contrib/libs/cxxsupp/libcxx/include/__math/abs.h index 6004690f4c..ab82a2800f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/abs.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/abs.h @@ -23,19 +23,19 @@ namespace __math { // fabs -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT { return __builtin_fabsf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT { return __builtin_fabsf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT { return __builtin_fabs(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT { return __builtin_fabsl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double fabs(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double fabs(_A1 __x) _NOEXCEPT { return __builtin_fabs((double)__x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/copysign.h b/contrib/libs/cxxsupp/libcxx/include/__math/copysign.h index 2219297e8b..b38690bb58 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/copysign.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/copysign.h @@ -25,17 +25,16 @@ namespace __math { // copysign -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float copysign(float __x, float __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float copysign(float __x, float __y) _NOEXCEPT { return ::__builtin_copysignf(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double copysign(long double __x, long double __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double copysign(long double __x, long double __y) _NOEXCEPT { return ::__builtin_copysignl(__x, __y); } template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type -copysign(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type copysign(_A1 __x, _A2 __y) _NOEXCEPT { return ::__builtin_copysign(__x, __y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/exponential_functions.h b/contrib/libs/cxxsupp/libcxx/include/__math/exponential_functions.h index f8d611b9e4..109c334997 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/exponential_functions.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/exponential_functions.h @@ -160,7 +160,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double pow(long double __x, long double __y) _ template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type pow(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::pow((__result_type)__x, (__result_type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/fdim.h b/contrib/libs/cxxsupp/libcxx/include/__math/fdim.h index 6f90809302..dc1b4ecc07 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/fdim.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/fdim.h @@ -37,7 +37,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double fdim(long double __x, long double __y) template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fdim(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::fdim((__result_type)__x, (__result_type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/fma.h b/contrib/libs/cxxsupp/libcxx/include/__math/fma.h index 9e14f72dca..6ba7a5a2d2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/fma.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/fma.h @@ -42,9 +42,9 @@ template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2, _A3>::type fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2, _A3>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value && - _IsSame<_A3, __result_type>::value)), - ""); + static_assert( + !(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value && _IsSame<_A3, __result_type>::value), + ""); return __builtin_fma((__result_type)__x, (__result_type)__y, (__result_type)__z); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/hypot.h b/contrib/libs/cxxsupp/libcxx/include/__math/hypot.h index 8e2c0f5b6b..1bf193a9ab 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/hypot.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/hypot.h @@ -37,7 +37,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y) template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type hypot(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::hypot((__result_type)__x, (__result_type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/inverse_trigonometric_functions.h b/contrib/libs/cxxsupp/libcxx/include/__math/inverse_trigonometric_functions.h index 30b1440b0b..cd98b46a6a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/inverse_trigonometric_functions.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/inverse_trigonometric_functions.h @@ -88,7 +88,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double atan2(long double __y, long double __x) template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type atan2(_A1 __y, _A2 __x) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::atan2((__result_type)__y, (__result_type)__x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/min_max.h b/contrib/libs/cxxsupp/libcxx/include/__math/min_max.h index 381b2af4a5..27997b4491 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/min_max.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/min_max.h @@ -25,45 +25,45 @@ namespace __math { // fmax -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT { return __builtin_fmaxf(__x, __y); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fmax(double __x, double __y) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fmax(double __x, double __y) _NOEXCEPT { return __builtin_fmax(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmax(long double __x, long double __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fmax(long double __x, long double __y) _NOEXCEPT { return __builtin_fmaxl(__x, __y); } template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmax(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmax(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::fmax((__result_type)__x, (__result_type)__y); } // fmin -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fmin(float __x, float __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmin(float __x, float __y) _NOEXCEPT { return __builtin_fminf(__x, __y); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fmin(double __x, double __y) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fmin(double __x, double __y) _NOEXCEPT { return __builtin_fmin(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmin(long double __x, long double __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fmin(long double __x, long double __y) _NOEXCEPT { return __builtin_fminl(__x, __y); } template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmin(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmin(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::fmin((__result_type)__x, (__result_type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/modulo.h b/contrib/libs/cxxsupp/libcxx/include/__math/modulo.h index f6cdb956cf..c8ea506f37 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/modulo.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/modulo.h @@ -39,7 +39,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double fmod(long double __x, long double __y) template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmod(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::fmod((__result_type)__x, (__result_type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/remainder.h b/contrib/libs/cxxsupp/libcxx/include/__math/remainder.h index 025fb53aaa..0fbf0b8ef9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/remainder.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/remainder.h @@ -40,7 +40,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double remainder(long double __x, long double template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type remainder(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::remainder((__result_type)__x, (__result_type)__y); } @@ -62,7 +62,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double remquo(long double __x, long double __y template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::remquo((__result_type)__x, (__result_type)__y, __z); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/roots.h b/contrib/libs/cxxsupp/libcxx/include/__math/roots.h index faee688bc9..359fd747cf 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/roots.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/roots.h @@ -39,19 +39,19 @@ inline _LIBCPP_HIDE_FROM_ABI double sqrt(_A1 __x) _NOEXCEPT { // cbrt -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float cbrt(float __x) _NOEXCEPT { return __builtin_cbrtf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float cbrt(float __x) _NOEXCEPT { return __builtin_cbrtf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double cbrt(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double cbrt(double __x) _NOEXCEPT { return __builtin_cbrt(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double cbrt(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double cbrt(long double __x) _NOEXCEPT { return __builtin_cbrtl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double cbrt(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double cbrt(_A1 __x) _NOEXCEPT { return __builtin_cbrt((double)__x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/rounding_functions.h b/contrib/libs/cxxsupp/libcxx/include/__math/rounding_functions.h index 7943b6f3aa..f7246ba7fe 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/rounding_functions.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/rounding_functions.h @@ -26,37 +26,37 @@ namespace __math { // ceil -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float ceil(float __x) _NOEXCEPT { return __builtin_ceilf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float ceil(float __x) _NOEXCEPT { return __builtin_ceilf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double ceil(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double ceil(double __x) _NOEXCEPT { return __builtin_ceil(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double __x) _NOEXCEPT { return __builtin_ceill(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double ceil(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double ceil(_A1 __x) _NOEXCEPT { return __builtin_ceil((double)__x); } // floor -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float floor(float __x) _NOEXCEPT { return __builtin_floorf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float floor(float __x) _NOEXCEPT { return __builtin_floorf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double floor(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double floor(double __x) _NOEXCEPT { return __builtin_floor(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double floor(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double floor(long double __x) _NOEXCEPT { return __builtin_floorl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double floor(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double floor(_A1 __x) _NOEXCEPT { return __builtin_floor((double)__x); } @@ -126,21 +126,21 @@ inline _LIBCPP_HIDE_FROM_ABI long lround(_A1 __x) _NOEXCEPT { // nearbyint -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float nearbyint(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float nearbyint(float __x) _NOEXCEPT { return __builtin_nearbyintf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double nearbyint(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double nearbyint(double __x) _NOEXCEPT { return __builtin_nearbyint(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double nearbyint(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double nearbyint(long double __x) _NOEXCEPT { return __builtin_nearbyintl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double nearbyint(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double nearbyint(_A1 __x) _NOEXCEPT { return __builtin_nearbyint((double)__x); } @@ -160,7 +160,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double nextafter(long double __x, long double template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type nextafter(_A1 __x, _A2 __y) _NOEXCEPT { using __result_type = typename __promote<_A1, _A2>::type; - static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); + static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), ""); return __math::nextafter((__result_type)__x, (__result_type)__y); } @@ -186,55 +186,55 @@ inline _LIBCPP_HIDE_FROM_ABI double nexttoward(_A1 __x, long double __y) _NOEXCE // rint -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float rint(float __x) _NOEXCEPT { return __builtin_rintf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float rint(float __x) _NOEXCEPT { return __builtin_rintf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double rint(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double rint(double __x) _NOEXCEPT { return __builtin_rint(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double rint(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double rint(long double __x) _NOEXCEPT { return __builtin_rintl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEPT { return __builtin_rint((double)__x); } // round -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { return __builtin_round(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double round(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double round(long double __x) _NOEXCEPT { return __builtin_roundl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCEPT { return __builtin_round((double)__x); } // trunc -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_trunc(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { return __builtin_trunc(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double trunc(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double trunc(long double __x) _NOEXCEPT { return __builtin_truncl(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double trunc(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double trunc(_A1 __x) _NOEXCEPT { return __builtin_trunc((double)__x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__math/traits.h b/contrib/libs/cxxsupp/libcxx/include/__math/traits.h index b271b8fecb..9fdf4096b2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__math/traits.h +++ b/contrib/libs/cxxsupp/libcxx/include/__math/traits.h @@ -29,55 +29,55 @@ namespace __math { // signbit template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __builtin_signbit(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value && is_signed<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __x < 0; } template <class _A1, __enable_if_t<is_integral<_A1>::value && !is_signed<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1) _NOEXCEPT { return false; } // isfinite template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1 __x) _NOEXCEPT { return __builtin_isfinite((typename __promote<_A1>::type)__x); } template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && !numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) _NOEXCEPT { return true; } // isinf template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { return __builtin_isinf((typename __promote<_A1>::type)__x); } template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && !numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1) _NOEXCEPT { return false; } #ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { return __builtin_isinf(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT { return __builtin_isinf(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT { return __builtin_isinf(__x); } #endif @@ -85,26 +85,26 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI // isnan template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT { return __builtin_isnan(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT { return false; } #ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { return __builtin_isnan(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isnan(double __x) _NOEXCEPT { return __builtin_isnan(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT { return __builtin_isnan(__x); } #endif @@ -112,19 +112,19 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI // isnormal template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __builtin_isnormal(__x); } template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __x != 0; } // isgreater template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_isgreater((type)__x, (type)__y); } @@ -132,7 +132,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 _ // isgreaterequal template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_isgreaterequal((type)__x, (type)__y); } @@ -140,7 +140,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, // isless template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_isless((type)__x, (type)__y); } @@ -148,7 +148,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) // islessequal template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_islessequal((type)__x, (type)__y); } @@ -156,7 +156,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 // islessgreater template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_islessgreater((type)__x, (type)__y); } @@ -164,7 +164,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _ // isunordered template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) _NOEXCEPT { using type = typename __promote<_A1, _A2>::type; return __builtin_isunordered((type)__x, (type)__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__mdspan/extents.h b/contrib/libs/cxxsupp/libcxx/include/__mdspan/extents.h index f6bcd940ee..fea0decd8c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mdspan/extents.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mdspan/extents.h @@ -137,9 +137,9 @@ private: // static mapping of indices to the position in the dynamic values array using _DynamicIdxMap = __static_partial_sums<static_cast<size_t>(_Values == _DynTag)...>; - template <size_t... Indices> - _LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<Indices...>) noexcept { - return _DynamicValues{((void)Indices, 0)...}; + template <size_t... _Indices> + _LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<_Indices...>) noexcept { + return _DynamicValues{((void)_Indices, 0)...}; } public: @@ -165,7 +165,7 @@ public: template <class... _DynVals> requires(sizeof...(_DynVals) != __size_dynamic_) _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array(_DynVals... __vals) { - static_assert((sizeof...(_DynVals) == __size_), "Invalid number of values."); + static_assert(sizeof...(_DynVals) == __size_, "Invalid number of values."); _TDynamic __values[__size_] = {static_cast<_TDynamic>(__vals)...}; for (size_t __i = 0; __i < __size_; __i++) { _TStatic __static_val = _StaticValues::__get(__i); @@ -185,7 +185,7 @@ public: template <class _Tp, size_t _Size> requires(_Size != __size_dynamic_) _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array(const span<_Tp, _Size>& __vals) { - static_assert((_Size == __size_) || (__size_ == dynamic_extent)); + static_assert(_Size == __size_ || __size_ == dynamic_extent); for (size_t __i = 0; __i < __size_; __i++) { _TStatic __static_val = _StaticValues::__get(__i); if (__static_val == _DynTag) { @@ -455,8 +455,15 @@ template <class _IndexType, size_t _Rank> using dextents = typename __mdspan_detail::__make_dextents<_IndexType, _Rank>::type; // Deduction guide for extents +# if _LIBCPP_STD_VER >= 26 template <class... _IndexTypes> -extents(_IndexTypes...) -> extents<size_t, size_t(((void)sizeof(_IndexTypes), dynamic_extent))...>; + requires(is_convertible_v<_IndexTypes, size_t> && ...) +explicit extents(_IndexTypes...) -> extents<size_t, __maybe_static_ext<_IndexTypes>...>; +# else +template <class... _IndexTypes> + requires(is_convertible_v<_IndexTypes, size_t> && ...) +explicit extents(_IndexTypes...) -> extents<size_t, size_t(((void)sizeof(_IndexTypes), dynamic_extent))...>; +# endif namespace __mdspan_detail { diff --git a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_left.h b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_left.h index fd644fa0c5..d058cbccff 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_left.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_left.h @@ -67,7 +67,7 @@ private: return true; } - static_assert((extents_type::rank_dynamic() > 0) || __required_span_size_is_representable(extents_type()), + static_assert(extents_type::rank_dynamic() > 0 || __required_span_size_is_representable(extents_type()), "layout_left::mapping product of static extents must be representable as index_type."); public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_right.h b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_right.h index 8e64d07dd5..6842e9dc37 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_right.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_right.h @@ -66,7 +66,7 @@ private: return true; } - static_assert((extents_type::rank_dynamic() > 0) || __required_span_size_is_representable(extents_type()), + static_assert(extents_type::rank_dynamic() > 0 || __required_span_size_is_representable(extents_type()), "layout_right::mapping product of static extents must be representable as index_type."); public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_stride.h b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_stride.h index 77934bfa11..86148ac849 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_stride.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_stride.h @@ -149,7 +149,7 @@ private: } } - static_assert((extents_type::rank_dynamic() > 0) || __required_span_size_is_representable(extents_type()), + static_assert(extents_type::rank_dynamic() > 0 || __required_span_size_is_representable(extents_type()), "layout_stride::mapping product of static extents must be representable as index_type."); public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__mdspan/mdspan.h b/contrib/libs/cxxsupp/libcxx/include/__mdspan/mdspan.h index d9a0108d6d..1ff4fd4ba4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mdspan/mdspan.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mdspan/mdspan.h @@ -266,10 +266,17 @@ private: friend class mdspan; }; +# if _LIBCPP_STD_VER >= 26 template <class _ElementType, class... _OtherIndexTypes> requires((is_convertible_v<_OtherIndexTypes, size_t> && ...) && (sizeof...(_OtherIndexTypes) > 0)) -explicit mdspan(_ElementType*, _OtherIndexTypes...) - -> mdspan<_ElementType, dextents<size_t, sizeof...(_OtherIndexTypes)>>; +explicit mdspan(_ElementType*, + _OtherIndexTypes...) -> mdspan<_ElementType, extents<size_t, __maybe_static_ext<_OtherIndexTypes>...>>; +# else +template <class _ElementType, class... _OtherIndexTypes> + requires((is_convertible_v<_OtherIndexTypes, size_t> && ...) && (sizeof...(_OtherIndexTypes) > 0)) +explicit mdspan(_ElementType*, + _OtherIndexTypes...) -> mdspan<_ElementType, dextents<size_t, sizeof...(_OtherIndexTypes)>>; +# endif template <class _Pointer> requires(is_pointer_v<remove_reference_t<_Pointer>>) diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h index b2e5dd3ff9..df73d9a2e9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h @@ -35,9 +35,9 @@ struct __allocation_result { }; template <class _Alloc> -_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR - __allocation_result<typename allocator_traits<_Alloc>::pointer> - __allocate_at_least(_Alloc& __alloc, size_t __n) { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR __allocation_result<typename allocator_traits<_Alloc>::pointer> +__allocate_at_least(_Alloc& __alloc, size_t __n) { return {__alloc.allocate(__n), __n}; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h index b63a80933b..c276b4542e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h @@ -14,6 +14,7 @@ #include <__memory/addressof.h> #include <__memory/allocate_at_least.h> #include <__memory/allocator_traits.h> +#include <__type_traits/is_const.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_same.h> #include <__type_traits/is_void.h> @@ -36,8 +37,6 @@ class allocator; // Specializing allocator<void> is deprecated, but not using it. template <> class _LIBCPP_TEMPLATE_VIS allocator<void> { -# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) - public: _LIBCPP_DEPRECATED_IN_CXX17 typedef void* pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer; @@ -47,13 +46,12 @@ public: struct _LIBCPP_DEPRECATED_IN_CXX17 rebind { typedef allocator<_Up> other; }; -# endif }; +// TODO(LLVM 20): Remove the escape hatch +# ifdef _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST template <> class _LIBCPP_TEMPLATE_VIS allocator<const void> { -# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) - public: _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer; @@ -63,9 +61,9 @@ public: struct _LIBCPP_DEPRECATED_IN_CXX17 rebind { typedef allocator<_Up> other; }; -# endif }; -#endif +# endif // _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST +#endif // _LIBCPP_STD_VER <= 17 // This class provides a non-trivial default constructor to the class that derives from it // if the condition is satisfied. @@ -94,6 +92,7 @@ struct __non_trivial_if<true, _Unique> { template <class _Tp> class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> > { + static_assert(!is_const<_Tp>::value, "std::allocator does not support const types"); static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types"); public: @@ -110,7 +109,7 @@ public: template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator(const allocator<_Up>&) _NOEXCEPT {} - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* allocate(size_t __n) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* allocate(size_t __n) { if (__n > allocator_traits<allocator>::max_size(*this)) __throw_bad_array_new_length(); if (__libcpp_is_constant_evaluated()) { @@ -153,8 +152,7 @@ public: return std::addressof(__x); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 _Tp* - allocate(size_t __n, const void*) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 _Tp* allocate(size_t __n, const void*) { return allocate(__n); } @@ -171,6 +169,8 @@ public: #endif }; +// TODO(LLVM 20): Remove the escape hatch +#ifdef _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST template <class _Tp> class _LIBCPP_TEMPLATE_VIS allocator<const _Tp> : private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> > { @@ -181,16 +181,16 @@ public: typedef ptrdiff_t difference_type; typedef const _Tp value_type; typedef true_type propagate_on_container_move_assignment; -#if _LIBCPP_STD_VER <= 23 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_ALLOCATOR_MEMBERS) +# if _LIBCPP_STD_VER <= 23 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_ALLOCATOR_MEMBERS) _LIBCPP_DEPRECATED_IN_CXX23 typedef true_type is_always_equal; -#endif +# endif _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default; template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator(const allocator<_Up>&) _NOEXCEPT {} - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const _Tp* allocate(size_t __n) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const _Tp* allocate(size_t __n) { if (__n > allocator_traits<allocator>::max_size(*this)) __throw_bad_array_new_length(); if (__libcpp_is_constant_evaluated()) { @@ -200,11 +200,11 @@ public: } } -#if _LIBCPP_STD_VER >= 23 +# if _LIBCPP_STD_VER >= 23 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr allocation_result<const _Tp*> allocate_at_least(size_t __n) { return {allocate(__n), __n}; } -#endif +# endif _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void deallocate(const _Tp* __p, size_t __n) { if (__libcpp_is_constant_evaluated()) { @@ -215,7 +215,7 @@ public: } // C++20 Removed members -#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) +# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference; @@ -230,8 +230,7 @@ public: return std::addressof(__x); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 const _Tp* - allocate(size_t __n, const void*) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 const _Tp* allocate(size_t __n, const void*) { return allocate(__n); } @@ -245,8 +244,9 @@ public: } _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI void destroy(pointer __p) { __p->~_Tp(); } -#endif +# endif }; +#endif // _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST template <class _Tp, class _Up> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h index efdaa5e4ed..ac564f0e6f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h @@ -16,6 +16,7 @@ #include <__type_traits/enable_if.h> #include <__type_traits/is_constructible.h> #include <__type_traits/is_empty.h> +#include <__type_traits/is_same.h> #include <__type_traits/make_unsigned.h> #include <__type_traits/remove_reference.h> #include <__type_traits/void_t.h> @@ -275,13 +276,13 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits { }; #endif // _LIBCPP_CXX03_LANG - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer allocate(allocator_type& __a, size_type __n) { return __a.allocate(__n); } template <class _Ap = _Alloc, __enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value, int> = 0> - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) { _LIBCPP_SUPPRESS_DEPRECATED_PUSH return __a.allocate(__n, __hint); @@ -290,7 +291,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits { template <class _Ap = _Alloc, class = void, __enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value, int> = 0> - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) { return __a.allocate(__n); } @@ -372,6 +373,14 @@ template <class _Traits, class _Tp> using __rebind_alloc = typename _Traits::template rebind_alloc<_Tp>::other; #endif +template <class _Alloc> +struct __check_valid_allocator : true_type { + using _Traits = std::allocator_traits<_Alloc>; + static_assert(is_same<_Alloc, __rebind_alloc<_Traits, typename _Traits::value_type> >::value, + "[allocator.requirements] states that rebinding an allocator to the same type should result in the " + "original allocator"); +}; + // __is_default_allocator template <class _Tp> struct __is_default_allocator : false_type {}; @@ -407,18 +416,6 @@ struct __is_cpp17_copy_insertable< __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value > > : __is_cpp17_move_insertable<_Alloc> {}; -// ASan choices -#ifndef _LIBCPP_HAS_NO_ASAN -# define _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS 1 -#endif - -#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS -template <class _Alloc> -struct __asan_annotate_container_with_allocator : true_type {}; -template <class _Tp> -struct __asan_annotate_container_with_allocator<allocator<_Tp> > : true_type {}; -#endif - #undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h b/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h index 328849d7cc..40e5cfc35f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h @@ -150,7 +150,7 @@ public: } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void swap(__compressed_pair& __x) - _NOEXCEPT_(__is_nothrow_swappable<_T1>::value&& __is_nothrow_swappable<_T2>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) { using std::swap; swap(first(), __x.first()); swap(second(), __x.second()); @@ -160,7 +160,7 @@ public: template <class _T1, class _T2> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y) - _NOEXCEPT_(__is_nothrow_swappable<_T1>::value&& __is_nothrow_swappable<_T2>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) { __x.swap(__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h b/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h index 91d17134db..eb02132480 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h @@ -44,7 +44,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __ #endif template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* __location, _Args&&... __args) { #if _LIBCPP_STD_VER >= 20 return std::construct_at(__location, std::forward<_Args>(__args)...); #else diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h b/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h index 1082e37853..fcd2c3edd9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h @@ -202,16 +202,16 @@ struct _IsFancyPointer { // enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers template <class _Pointer, __enable_if_t< _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value, int> = 0> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR - __decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))> - __to_address(const _Pointer& __p) _NOEXCEPT { +_LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR __decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))> +__to_address(const _Pointer& __p) _NOEXCEPT { return __to_address_helper<_Pointer>::__call(__p); } template <class _Pointer, class> struct __to_address_helper { - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static decltype(std::__to_address( - std::declval<const _Pointer&>().operator->())) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR static decltype(std::__to_address(std::declval<const _Pointer&>().operator->())) __call(const _Pointer& __p) _NOEXCEPT { return std::__to_address(__p.operator->()); } @@ -220,8 +220,8 @@ struct __to_address_helper { template <class _Pointer> struct __to_address_helper<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))> { - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static decltype(pointer_traits<_Pointer>::to_address( - std::declval<const _Pointer&>())) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR static decltype(pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>())) __call(const _Pointer& __p) _NOEXCEPT { return pointer_traits<_Pointer>::to_address(__p); } @@ -234,8 +234,8 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr auto to_address(_Tp* __p) noexcept { } template <class _Pointer> -inline _LIBCPP_HIDE_FROM_ABI constexpr auto to_address(const _Pointer& __p) noexcept - -> decltype(std::__to_address(__p)) { +inline _LIBCPP_HIDE_FROM_ABI constexpr auto +to_address(const _Pointer& __p) noexcept -> decltype(std::__to_address(__p)) { return std::__to_address(__p); } #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h index fa25116b1a..146b2059e8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h @@ -291,7 +291,7 @@ struct __shared_ptr_emplace : __shared_weak_count { class _Allocator = _Alloc, __enable_if_t<!is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&... __args) : __storage_(std::move(__a)) { - using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type; + using _TpAlloc = typename __allocator_traits_rebind<_Alloc, __remove_cv_t<_Tp> >::type; _TpAlloc __tmp(*__get_alloc()); allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), std::forward<_Args>(__args)...); } @@ -310,7 +310,7 @@ private: template <class _Allocator = _Alloc, __enable_if_t<!is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI void __on_zero_shared_impl() _NOEXCEPT { - using _TpAlloc = typename __allocator_traits_rebind<_Allocator, _Tp>::type; + using _TpAlloc = typename __allocator_traits_rebind<_Allocator, __remove_cv_t<_Tp> >::type; _TpAlloc __tmp(*__get_alloc()); allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem()); } @@ -435,6 +435,9 @@ struct __shared_ptr_deleter_ctor_reqs { __well_formed_deleter<_Dp, _Yp*>::value; }; +template <class _Dp> +using __shared_ptr_nullptr_deleter_ctor_reqs = _And<is_move_constructible<_Dp>, __well_formed_deleter<_Dp, nullptr_t> >; + #if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI) # define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__)) #else @@ -443,6 +446,8 @@ struct __shared_ptr_deleter_ctor_reqs { template <class _Tp> class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr { + struct __nullptr_sfinae_tag {}; + public: #if _LIBCPP_STD_VER >= 17 typedef weak_ptr<_Tp> weak_type; @@ -451,6 +456,10 @@ public: typedef _Tp element_type; #endif + // A shared_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require + // any bookkeeping, so it's always trivially relocatable. + using __trivially_relocatable = shared_ptr; + private: element_type* __ptr_; __shared_weak_count* __cntrl_; @@ -531,7 +540,11 @@ public: } template <class _Dp> - _LIBCPP_HIDE_FROM_ABI shared_ptr(nullptr_t __p, _Dp __d) : __ptr_(nullptr) { + _LIBCPP_HIDE_FROM_ABI shared_ptr( + nullptr_t __p, + _Dp __d, + __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag()) + : __ptr_(nullptr) { #ifndef _LIBCPP_HAS_NO_EXCEPTIONS try { #endif // _LIBCPP_HAS_NO_EXCEPTIONS @@ -551,7 +564,12 @@ public: } template <class _Dp, class _Alloc> - _LIBCPP_HIDE_FROM_ABI shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a) : __ptr_(nullptr) { + _LIBCPP_HIDE_FROM_ABI shared_ptr( + nullptr_t __p, + _Dp __d, + _Alloc __a, + __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag()) + : __ptr_(nullptr) { #ifndef _LIBCPP_HAS_NO_EXCEPTIONS try { #endif // _LIBCPP_HAS_NO_EXCEPTIONS @@ -626,8 +644,8 @@ public: #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template <class _Yp, __enable_if_t<is_convertible<_Yp*, element_type*>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI shared_ptr(auto_ptr<_Yp>&& __r) : __ptr_(__r.get()) { - typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>()); + typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<__remove_cv_t<_Yp> > > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<__remove_cv_t<_Yp> >()); __enable_weak_this(__r.get(), __r.get()); __r.release(); } @@ -804,7 +822,7 @@ public: private: template <class _Yp, bool = is_function<_Yp>::value> struct __shared_ptr_default_allocator { - typedef allocator<_Yp> type; + typedef allocator<__remove_cv_t<_Yp> > type; }; template <class _Yp> @@ -862,7 +880,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(_Args&&... __args) { - return std::allocate_shared<_Tp>(allocator<_Tp>(), std::forward<_Args>(__args)...); + return std::allocate_shared<_Tp>(allocator<__remove_cv_t<_Tp> >(), std::forward<_Args>(__args)...); } #if _LIBCPP_STD_VER >= 20 @@ -876,7 +894,7 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() { - return std::allocate_shared_for_overwrite<_Tp>(allocator<_Tp>()); + return std::allocate_shared_for_overwrite<_Tp>(allocator<__remove_cv_t<_Tp>>()); } #endif // _LIBCPP_STD_VER >= 20 @@ -1333,6 +1351,10 @@ public: typedef _Tp element_type; #endif + // A weak_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require + // any bookkeeping, so it's always trivially relocatable. + using __trivially_relocatable = weak_ptr; + private: element_type* __ptr_; __shared_weak_count* __cntrl_; diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h index f2c5090563..b17e082a43 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h @@ -26,7 +26,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value) + _NOEXCEPT_(__is_nothrow_swappable_v<_Alloc>) #endif { using std::swap; @@ -42,7 +42,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value) + _NOEXCEPT_(__is_nothrow_swappable_v<_Alloc>) #endif { std::__swap_allocator( diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/temporary_buffer.h b/contrib/libs/cxxsupp/libcxx/include/__memory/temporary_buffer.h index e3797caff8..88799ca95c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/temporary_buffer.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/temporary_buffer.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t> +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT { pair<_Tp*, ptrdiff_t> __r(0, 0); const ptrdiff_t __m = diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h index ff747e3374..8dd000ba0c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h @@ -184,8 +184,8 @@ public: : __ptr_(__value_init_tag(), __value_init_tag()) {} template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> > - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(pointer __p) _NOEXCEPT - : __ptr_(__p, __value_init_tag()) {} + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p, __value_init_tag()) {} template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT @@ -360,8 +360,8 @@ public: bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy>, class = _EnableIfPointerConvertible<_Pp> > - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Pp __p) _NOEXCEPT - : __ptr_(__p, __value_init_tag()) {} + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Pp __p) _NOEXCEPT : __ptr_(__p, __value_init_tag()) {} template <class _Pp, bool _Dummy = true, @@ -472,7 +472,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void swap(unique_ptr& __u) _NOEXCEPT { __ptr_.swap(__u.__ptr_); } }; -template <class _Tp, class _Dp, __enable_if_t<__is_swappable<_Dp>::value, int> = 0> +template <class _Tp, class _Dp, __enable_if_t<__is_swappable_v<_Dp>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT { __x.swap(__y); @@ -518,8 +518,8 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const unique_ptr<_T1, _D1>& __x, co template <class _T1, class _D1, class _T2, class _D2> requires three_way_comparable_with<typename unique_ptr<_T1, _D1>::pointer, typename unique_ptr<_T2, _D2>::pointer> _LIBCPP_HIDE_FROM_ABI - compare_three_way_result_t<typename unique_ptr<_T1, _D1>::pointer, typename unique_ptr<_T2, _D2>::pointer> - operator<=>(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) { +compare_three_way_result_t<typename unique_ptr<_T1, _D1>::pointer, typename unique_ptr<_T2, _D2>::pointer> +operator<=>(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) { return compare_three_way()(__x.get(), __y.get()); } #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h index 9b7262bec5..5e5819d4c2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h @@ -184,20 +184,18 @@ __uses_allocator_construction_args(const _Alloc& __alloc, _Type&& __value) noexc struct __pair_constructor { using _PairMutable = remove_cv_t<_Pair>; - _LIBCPP_HIDE_FROM_ABI constexpr auto __do_construct(const _PairMutable& __pair) const { + _LIBCPP_HIDDEN constexpr auto __do_construct(const _PairMutable& __pair) const { return std::__make_obj_using_allocator<_PairMutable>(__alloc_, __pair); } - _LIBCPP_HIDE_FROM_ABI constexpr auto __do_construct(_PairMutable&& __pair) const { + _LIBCPP_HIDDEN constexpr auto __do_construct(_PairMutable&& __pair) const { return std::__make_obj_using_allocator<_PairMutable>(__alloc_, std::move(__pair)); } const _Alloc& __alloc_; _Type& __value_; - _LIBCPP_HIDE_FROM_ABI constexpr operator _PairMutable() const { - return __do_construct(std::forward<_Type>(this->__value_)); - } + _LIBCPP_HIDDEN constexpr operator _PairMutable() const { return __do_construct(std::forward<_Type>(__value_)); } }; return std::make_tuple(__pair_constructor{__alloc, __value}); diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h index 418f36dc9b..ea85e50cd5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H #define _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H -#include <__availability> #include <__config> #include <__fwd/memory_resource.h> #include <cstddef> @@ -32,9 +31,8 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource { public: virtual ~memory_resource(); - _LIBCPP_NODISCARD_AFTER_CXX17 - [[using __gnu__: __returns_nonnull__, __alloc_size__(2), __alloc_align__(3)]] _LIBCPP_HIDE_FROM_ABI void* - allocate(size_t __bytes, size_t __align = __max_align) { + [[nodiscard]] [[using __gnu__: __returns_nonnull__, __alloc_size__(2), __alloc_align__(3)]] + _LIBCPP_HIDE_FROM_ABI void* allocate(size_t __bytes, size_t __align = __max_align) { return do_allocate(__bytes, __align); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h index 0c83f1ebc8..f45b30fdb3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H #define _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H -#include <__availability> #include <__config> #include <__memory/addressof.h> #include <__memory_resource/memory_resource.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h index 823c1503c2..a71096d3e4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h @@ -10,7 +10,6 @@ #define _LIBCPP___MEMORY_RESOURCE_POLYMORPHIC_ALLOCATOR_H #include <__assert> -#include <__availability> #include <__config> #include <__fwd/pair.h> #include <__memory_resource/memory_resource.h> @@ -61,7 +60,7 @@ public: // [mem.poly.allocator.mem] - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _ValueType* allocate(size_t __n) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ValueType* allocate(size_t __n) { if (__n > __max_size()) { __throw_bad_array_new_length(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h index b261fb0b19..50a673c286 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H #define _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H -#include <__availability> #include <__config> #include <__memory_resource/memory_resource.h> #include <__memory_resource/pool_options.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h index 81d5f9ec4d..783db84262 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h @@ -9,7 +9,6 @@ #ifndef _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H #define _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H -#include <__availability> #include <__config> #include <__memory_resource/memory_resource.h> #include <__memory_resource/pool_options.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h index c075512fb9..8340b9bbd4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h @@ -29,18 +29,17 @@ private: mutex_type& __m_; public: - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI explicit lock_guard(mutex_type& __m) - _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) + _LIBCPP_NODISCARD + _LIBCPP_HIDE_FROM_ABI explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) : __m_(__m) { __m_.lock(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t) + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) : __m_(__m) {} _LIBCPP_HIDE_FROM_ABI ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) { __m_.unlock(); } -private: lock_guard(lock_guard const&) = delete; lock_guard& operator=(lock_guard const&) = delete; }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h index c27ce4b24c..4a616ba51e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h +++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h @@ -36,26 +36,28 @@ private: bool __owns_; public: - _LIBCPP_HIDE_FROM_ABI unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} - _LIBCPP_HIDE_FROM_ABI explicit unique_lock(mutex_type& __m) : __m_(std::addressof(__m)), __owns_(true) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI explicit unique_lock(mutex_type& __m) + : __m_(std::addressof(__m)), __owns_(true) { __m_->lock(); } - _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT : __m_(std::addressof(__m)), __owns_(false) {} - _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, try_to_lock_t) + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, try_to_lock_t) : __m_(std::addressof(__m)), __owns_(__m.try_lock()) {} - _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, adopt_lock_t) : __m_(std::addressof(__m)), __owns_(true) {} + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, adopt_lock_t) + : __m_(std::addressof(__m)), __owns_(true) {} template <class _Clock, class _Duration> - _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t) + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t) : __m_(std::addressof(__m)), __owns_(__m.try_lock_until(__t)) {} template <class _Rep, class _Period> - _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d) + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d) : __m_(std::addressof(__m)), __owns_(__m.try_lock_for(__d)) {} _LIBCPP_HIDE_FROM_ABI ~unique_lock() { @@ -66,7 +68,9 @@ public: unique_lock(unique_lock const&) = delete; unique_lock& operator=(unique_lock const&) = delete; - _LIBCPP_HIDE_FROM_ABI unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI unique_lock(unique_lock&& __u) _NOEXCEPT + : __m_(__u.__m_), + __owns_(__u.__owns_) { __u.__m_ = nullptr; __u.__owns_ = false; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__node_handle b/contrib/libs/cxxsupp/libcxx/include/__node_handle index 24d2624c37..d0b35bfd19 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__node_handle +++ b/contrib/libs/cxxsupp/libcxx/include/__node_handle @@ -147,7 +147,7 @@ public: _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ptr_ != nullptr; } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const { return __ptr_ == nullptr; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return __ptr_ == nullptr; } _LIBCPP_HIDE_FROM_ABI void swap(__basic_node_handle& __other) noexcept( __alloc_traits::propagate_on_container_swap::value || __alloc_traits::is_always_equal::value) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h index 48df233805..9be6cf8516 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h @@ -10,7 +10,9 @@ #ifndef _LIBCPP___NUMERIC_GCD_LCM_H #define _LIBCPP___NUMERIC_GCD_LCM_H +#include <__algorithm/min.h> #include <__assert> +#include <__bit/countr.h> #include <__config> #include <__type_traits/common_type.h> #include <__type_traits/is_integral.h> @@ -35,7 +37,7 @@ struct __ct_abs; template <typename _Result, typename _Source> struct __ct_abs<_Result, _Source, true> { - _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { + constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { if (__t >= 0) return __t; if (__t == numeric_limits<_Source>::min()) @@ -46,20 +48,58 @@ struct __ct_abs<_Result, _Source, true> { template <typename _Result, typename _Source> struct __ct_abs<_Result, _Source, false> { - _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { return __t; } + constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { return __t; } }; template <class _Tp> -_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN _Tp __gcd(_Tp __m, _Tp __n) { - static_assert((!is_signed<_Tp>::value), ""); - return __n == 0 ? __m : std::__gcd<_Tp>(__n, __m % __n); +constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) { + static_assert(!is_signed<_Tp>::value, ""); + + // From: https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor + // + // If power of two divides both numbers, we can push it out. + // - gcd( 2^x * a, 2^x * b) = 2^x * gcd(a, b) + // + // If and only if exactly one number is even, we can divide that number by that power. + // - if a, b are odd, then gcd(2^x * a, b) = gcd(a, b) + // + // And standard gcd algorithm where instead of modulo, minus is used. + + if (__a < __b) { + _Tp __tmp = __b; + __b = __a; + __a = __tmp; + } + if (__b == 0) + return __a; + __a %= __b; // Make both argument of the same size, and early result in the easy case. + if (__a == 0) + return __b; + + int __az = std::__countr_zero(__a); + int __bz = std::__countr_zero(__b); + int __shift = std::min(__az, __bz); + __a >>= __az; + __b >>= __bz; + do { + _Tp __diff = __a - __b; + if (__a > __b) { + __a = __b; + __b = __diff; + } else { + __b = __b - __a; + } + if (__diff != 0) + __b >>= std::__countr_zero(__diff); + } while (__b != 0); + return __a << __shift; } template <class _Tp, class _Up> -_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) { - static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types"); - static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to gcd cannot be bool"); - static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to gcd cannot be bool"); +constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) { + static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to gcd must be integer types"); + static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to gcd cannot be bool"); + static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool"); using _Rp = common_type_t<_Tp, _Up>; using _Wp = make_unsigned_t<_Rp>; return static_cast<_Rp>( @@ -67,21 +107,23 @@ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up } template <class _Tp, class _Up> -_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) { - static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types"); - static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to lcm cannot be bool"); - static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to lcm cannot be bool"); +constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) { + static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to lcm must be integer types"); + static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to lcm cannot be bool"); + static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to lcm cannot be bool"); if (__m == 0 || __n == 0) return 0; using _Rp = common_type_t<_Tp, _Up>; _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / std::gcd(__m, __n); _Rp __val2 = __ct_abs<_Rp, _Up>()(__n); - _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm"); - return __val1 * __val2; + _Rp __res; + [[maybe_unused]] bool __overflow = __builtin_mul_overflow(__val1, __val2, &__res); + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(!__overflow, "Overflow in lcm"); + return __res; } -#endif // _LIBCPP_STD_VER +#endif // _LIBCPP_STD_VER >= 17 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl.h new file mode 100644 index 0000000000..7557686a36 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl.h @@ -0,0 +1,174 @@ +//===----------------------------------------------------------------------===// +// +// 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___NUMERIC_PSTL_H +#define _LIBCPP___NUMERIC_PSTL_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +# include <__functional/identity.h> +# include <__functional/operations.h> +# include <__iterator/cpp17_iterator_concepts.h> +# include <__iterator/iterator_traits.h> +# include <__pstl/backend.h> +# include <__pstl/dispatch.h> +# include <__pstl/handle_exception.h> +# include <__type_traits/enable_if.h> +# include <__type_traits/is_execution_policy.h> +# include <__type_traits/remove_cvref.h> +# include <__utility/forward.h> +# include <__utility/move.h> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _BinaryOperation, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp reduce( + _ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __op) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + std::move(__init), + std::move(__op)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp +reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__init), plus{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI __iter_value_type<_ForwardIterator> +reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + __iter_value_type<_ForwardIterator>(), + plus{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + class _BinaryOperation1, + class _BinaryOperation2, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init, + _BinaryOperation1 __reduce, + _BinaryOperation2 __transform) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "transform_reduce requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "transform_reduce requires ForwardIterators"); + using _Implementation = + __pstl::__dispatch<__pstl::__transform_reduce_binary, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__init), + std::move(__reduce), + std::move(__transform)); +} + +// This overload doesn't get a customization point because it's trivial to detect (through e.g. +// __desugars_to_v) when specializing the more general variant, which should always be preferred +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "transform_reduce requires ForwardIterators"); + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "transform_reduce requires ForwardIterators"); + using _Implementation = + __pstl::__dispatch<__pstl::__transform_reduce_binary, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__init), + plus{}, + multiplies{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _BinaryOperation, + class _UnaryOperation, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _Tp __init, + _BinaryOperation __reduce, + _UnaryOperation __transform) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "transform_reduce requires ForwardIterators"); + using _Implementation = __pstl::__dispatch<__pstl::__transform_reduce, __pstl::__current_configuration, _RawPolicy>; + return __pstl::__handle_exception<_Implementation>( + std::forward<_ExecutionPolicy>(__policy), + std::move(__first), + std::move(__last), + std::move(__init), + std::move(__reduce), + std::move(__transform)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___NUMERIC_PSTL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h deleted file mode 100644 index f9f666c2bb..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h +++ /dev/null @@ -1,109 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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___NUMERIC_PSTL_REDUCE_H -#define _LIBCPP___NUMERIC_PSTL_REDUCE_H - -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__functional/identity.h> -#include <__iterator/iterator_traits.h> -#include <__numeric/pstl_transform_reduce.h> -#include <__type_traits/is_execution_policy.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class> -void __pstl_reduce(); - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _BinaryOperation = plus<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_Tp> -__reduce(_ExecutionPolicy&& __policy, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _Tp&& __init, - _BinaryOperation&& __op = {}) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Tp __g_init, _BinaryOperation __g_op) { - return std::__transform_reduce( - __policy, std::move(__g_first), std::move(__g_last), std::move(__g_init), std::move(__g_op), __identity{}); - }, - std::move(__first), - std::move(__last), - std::move(__init), - std::move(__op)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _BinaryOperation = plus<>, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp -reduce(_ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _Tp __init, - _BinaryOperation __op = {}) { - auto __res = std::__reduce(__policy, std::move(__first), std::move(__last), std::move(__init), std::move(__op)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_value_type<_ForwardIterator>> -__reduce(_ExecutionPolicy&& __policy, _ForwardIterator&& __first, _ForwardIterator&& __last) noexcept { - return std::__pstl_frontend_dispatch( - _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce, _RawPolicy), - [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last) { - return std::__reduce( - __policy, std::move(__g_first), std::move(__g_last), __iter_value_type<_ForwardIterator>()); - }, - std::move(__first), - std::move(__last)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI __iter_value_type<_ForwardIterator> -reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) { - auto __res = std::__reduce(__policy, std::move(__first), std::move(__last)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___NUMERIC_PSTL_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h deleted file mode 100644 index 2f412d41f7..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h +++ /dev/null @@ -1,156 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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___NUMERIC_PSTL_TRANSFORM_REDUCE_H -#define _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H - -#include <__algorithm/pstl_backend.h> -#include <__algorithm/pstl_frontend_dispatch.h> -#include <__config> -#include <__functional/operations.h> -#include <__numeric/transform_reduce.h> -#include <__type_traits/is_execution_policy.h> -#include <__utility/move.h> -#include <optional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Tp, - class _BinaryOperation1, - class _BinaryOperation2, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI optional<_Tp> __transform_reduce( - _ExecutionPolicy&&, - _ForwardIterator1&& __first1, - _ForwardIterator1&& __last1, - _ForwardIterator2&& __first2, - _Tp&& __init, - _BinaryOperation1&& __reduce, - _BinaryOperation2&& __transform) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_transform_reduce<_RawPolicy>( - _Backend{}, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__init), - std::move(__reduce), - std::move(__transform)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Tp, - class _BinaryOperation1, - class _BinaryOperation2, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( - _ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _Tp __init, - _BinaryOperation1 __reduce, - _BinaryOperation2 __transform) { - auto __res = std::__transform_reduce( - __policy, - std::move(__first1), - std::move(__last1), - std::move(__first2), - std::move(__init), - std::move(__reduce), - std::move(__transform)); - - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -// This overload doesn't get a customization point because it's trivial to detect (through e.g. -// __desugars_to) when specializing the more general variant, which should always be preferred -template <class _ExecutionPolicy, - class _ForwardIterator1, - class _ForwardIterator2, - class _Tp, - enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( - _ExecutionPolicy&& __policy, - _ForwardIterator1 __first1, - _ForwardIterator1 __last1, - _ForwardIterator2 __first2, - _Tp __init) { - return std::transform_reduce(__policy, __first1, __last1, __first2, __init, plus{}, multiplies{}); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _BinaryOperation, - class _UnaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__remove_cvref_t<_Tp>> __transform_reduce( - _ExecutionPolicy&&, - _ForwardIterator&& __first, - _ForwardIterator&& __last, - _Tp&& __init, - _BinaryOperation&& __reduce, - _UnaryOperation&& __transform) noexcept { - using _Backend = typename __select_backend<_RawPolicy>::type; - return std::__pstl_transform_reduce<_RawPolicy>( - _Backend{}, - std::move(__first), - std::move(__last), - std::move(__init), - std::move(__reduce), - std::move(__transform)); -} - -template <class _ExecutionPolicy, - class _ForwardIterator, - class _Tp, - class _BinaryOperation, - class _UnaryOperation, - class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, - enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> -_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( - _ExecutionPolicy&& __policy, - _ForwardIterator __first, - _ForwardIterator __last, - _Tp __init, - _BinaryOperation __reduce, - _UnaryOperation __transform) { - auto __res = std::__transform_reduce( - __policy, std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform)); - if (!__res) - std::__throw_bad_alloc(); - return *std::move(__res); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/saturation_arithmetic.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/saturation_arithmetic.h index 41596a0c58..2390b42aae 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/saturation_arithmetic.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/saturation_arithmetic.h @@ -25,10 +25,10 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER >= 26 +#if _LIBCPP_STD_VER >= 20 template <__libcpp_integer _Tp> -_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept { if (_Tp __sum; !__builtin_add_overflow(__x, __y, &__sum)) return __sum; // Handle overflow @@ -46,7 +46,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept { } template <__libcpp_integer _Tp> -_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept { if (_Tp __sub; !__builtin_sub_overflow(__x, __y, &__sub)) return __sub; // Handle overflow @@ -65,7 +65,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept { } template <__libcpp_integer _Tp> -_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept { if (_Tp __mul; !__builtin_mul_overflow(__x, __y, &__mul)) return __mul; // Handle overflow @@ -81,7 +81,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept { } template <__libcpp_integer _Tp> -_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept { _LIBCPP_ASSERT_UNCATEGORIZED(__y != 0, "Division by 0 is undefined"); if constexpr (__libcpp_unsigned_integer<_Tp>) { return __x / __y; @@ -94,7 +94,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept { } template <__libcpp_integer _Rp, __libcpp_integer _Tp> -_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept { +_LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept { // Saturation is impossible edge case when ((min _Rp) < (min _Tp) && (max _Rp) > (max _Tp)) and it is expected to be // optimized out by the compiler. @@ -107,6 +107,35 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept { return static_cast<_Rp>(__x); } +#endif // _LIBCPP_STD_VER >= 20 + +#if _LIBCPP_STD_VER >= 26 + +template <__libcpp_integer _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept { + return std::__add_sat(__x, __y); +} + +template <__libcpp_integer _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept { + return std::__sub_sat(__x, __y); +} + +template <__libcpp_integer _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept { + return std::__mul_sat(__x, __y); +} + +template <__libcpp_integer _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept { + return std::__div_sat(__x, __y); +} + +template <__libcpp_integer _Rp, __libcpp_integer _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept { + return std::__saturate_cast<_Rp>(__x); +} + #endif // _LIBCPP_STD_VER >= 26 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__ostream/basic_ostream.h b/contrib/libs/cxxsupp/libcxx/include/__ostream/basic_ostream.h new file mode 100644 index 0000000000..4f7e9cfe1c --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ostream/basic_ostream.h @@ -0,0 +1,860 @@ +//===---------------------------------------------------------------------===// +// +// 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___OSTREAM_BASIC_OSTREAM_H +#define _LIBCPP___OSTREAM_BASIC_OSTREAM_H + +#include <__config> +#include <__exception/operations.h> +#include <__memory/shared_ptr.h> +#include <__memory/unique_ptr.h> +#include <__system_error/error_code.h> +#include <__type_traits/conjunction.h> +#include <__type_traits/enable_if.h> +#include <__type_traits/is_base_of.h> +#include <__type_traits/void_t.h> +#include <__utility/declval.h> +#include <bitset> +#include <cstddef> +#include <ios> +#include <locale> +#include <new> // for __throw_bad_alloc +#include <streambuf> +#include <string_view> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _CharT, class _Traits> +class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> { +public: + // types (inherited from basic_ios (27.5.4)): + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // 27.7.2.2 Constructor/destructor: + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb) { + this->init(__sb); + } + ~basic_ostream() override; + + basic_ostream(const basic_ostream& __rhs) = delete; + basic_ostream& operator=(const basic_ostream& __rhs) = delete; + +protected: + inline _LIBCPP_HIDE_FROM_ABI basic_ostream(basic_ostream&& __rhs); + + // 27.7.2.3 Assign/swap + inline _LIBCPP_HIDE_FROM_ABI basic_ostream& operator=(basic_ostream&& __rhs); + + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void swap(basic_ostream& __rhs) { + basic_ios<char_type, traits_type>::swap(__rhs); + } + +public: + // 27.7.2.4 Prefix/suffix: + class _LIBCPP_TEMPLATE_VIS sentry; + + // 27.7.2.6 Formatted output: + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&)) { + return __pf(*this); + } + + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& + operator<<(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) { + __pf(*this); + return *this; + } + + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(ios_base& (*__pf)(ios_base&)) { + __pf(*this); + return *this; + } + + basic_ostream& operator<<(bool __n); + basic_ostream& operator<<(short __n); + basic_ostream& operator<<(unsigned short __n); + basic_ostream& operator<<(int __n); + basic_ostream& operator<<(unsigned int __n); + basic_ostream& operator<<(long __n); + basic_ostream& operator<<(unsigned long __n); + basic_ostream& operator<<(long long __n); + basic_ostream& operator<<(unsigned long long __n); + basic_ostream& operator<<(float __f); + basic_ostream& operator<<(double __f); + basic_ostream& operator<<(long double __f); + basic_ostream& operator<<(const void* __p); + +#if _LIBCPP_STD_VER >= 23 + _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(const volatile void* __p) { + return operator<<(const_cast<const void*>(__p)); + } +#endif + + basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb); + +#if _LIBCPP_STD_VER >= 17 + // LWG 2221 - nullptr. This is not backported to older standards modes. + // See https://reviews.llvm.org/D127033 for more info on the rationale. + _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(nullptr_t) { return *this << "nullptr"; } +#endif + + // 27.7.2.7 Unformatted output: + basic_ostream& put(char_type __c); + basic_ostream& write(const char_type* __s, streamsize __n); + basic_ostream& flush(); + + // 27.7.2.5 seeks: + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 pos_type tellp(); + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(pos_type __pos); + inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(off_type __off, ios_base::seekdir __dir); + +protected: + _LIBCPP_HIDE_FROM_ABI basic_ostream() {} // extension, intentially does not initialize +}; + +template <class _CharT, class _Traits> +class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry { + bool __ok_; + basic_ostream<_CharT, _Traits>& __os_; + +public: + explicit sentry(basic_ostream<_CharT, _Traits>& __os); + ~sentry(); + sentry(const sentry&) = delete; + sentry& operator=(const sentry&) = delete; + + _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ok_; } +}; + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>::sentry::sentry(basic_ostream<_CharT, _Traits>& __os) : __ok_(false), __os_(__os) { + if (__os.good()) { + if (__os.tie()) + __os.tie()->flush(); + __ok_ = true; + } +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>::sentry::~sentry() { + if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf) && !uncaught_exception()) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + if (__os_.rdbuf()->pubsync() == -1) + __os_.setstate(ios_base::badbit); +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + } +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs) { + this->move(__rhs); +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs) { + swap(__rhs); + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>::~basic_ostream() {} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& +basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + if (__sb) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + _Ip __i(__sb); + _Ip __eof; + _Op __o(*this); + size_t __c = 0; + for (; __i != __eof; ++__i, ++__o, ++__c) { + *__o = *__i; + if (__o.failed()) + break; + } + if (__c == 0) + this->setstate(ios_base::failbit); +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_failbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + } else + this->setstate(ios_base::badbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(bool __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(short __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, + *this, + this->fill(), + __flags == ios_base::oct || __flags == ios_base::hex + ? static_cast<long>(static_cast<unsigned short>(__n)) + : static_cast<long>(__n)) + .failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(int __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, + *this, + this->fill(), + __flags == ios_base::oct || __flags == ios_base::hex + ? static_cast<long>(static_cast<unsigned int>(__n)) + : static_cast<long>(__n)) + .failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long long __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(float __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(double __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long double __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(const void* __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = std::use_facet<_Fp>(this->getloc()); + if (__f.put(*this, *this, this->fill(), __n).failed()) + this->setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +__put_character_sequence(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str, size_t __len) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + typename basic_ostream<_CharT, _Traits>::sentry __s(__os); + if (__s) { + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; + if (std::__pad_and_output( + _Ip(__os), + __str, + (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str, + __str + __len, + __os, + __os.fill()) + .failed()) + __os.setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + __os.__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return __os; +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) { + return std::__put_character_sequence(__os, &__c, 1); +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + typename basic_ostream<_CharT, _Traits>::sentry __s(__os); + if (__s) { + _CharT __c = __os.widen(__cn); + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; + if (std::__pad_and_output( + _Ip(__os), + &__c, + (__os.flags() & ios_base::adjustfield) == ios_base::left ? &__c + 1 : &__c, + &__c + 1, + __os, + __os.fill()) + .failed()) + __os.setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + __os.__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return __os; +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, char __c) { + return std::__put_character_sequence(__os, &__c, 1); +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, signed char __c) { + return std::__put_character_sequence(__os, (char*)&__c, 1); +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c) { + return std::__put_character_sequence(__os, (char*)&__c, 1); +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str) { + return std::__put_character_sequence(__os, __str, _Traits::length(__str)); +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + typename basic_ostream<_CharT, _Traits>::sentry __s(__os); + if (__s) { + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; + size_t __len = char_traits<char>::length(__strn); + const int __bs = 100; + _CharT __wbb[__bs]; + _CharT* __wb = __wbb; + unique_ptr<_CharT, void (*)(void*)> __h(0, free); + if (__len > __bs) { + __wb = (_CharT*)malloc(__len * sizeof(_CharT)); + if (__wb == 0) + __throw_bad_alloc(); + __h.reset(__wb); + } + for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p) + *__p = __os.widen(*__strn); + if (std::__pad_and_output( + _Ip(__os), + __wb, + (__os.flags() & ios_base::adjustfield) == ios_base::left ? __wb + __len : __wb, + __wb + __len, + __os, + __os.fill()) + .failed()) + __os.setstate(ios_base::badbit | ios_base::failbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + __os.__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return __os; +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, const char* __str) { + return std::__put_character_sequence(__os, __str, _Traits::length(__str)); +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& +operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str) { + const char* __s = (const char*)__str; + return std::__put_character_sequence(__os, __s, _Traits::length(__s)); +} + +template <class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& +operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str) { + const char* __s = (const char*)__str; + return std::__put_character_sequence(__os, __s, _Traits::length(__s)); +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::put(char_type __c) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __s(*this); + if (__s) { + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + _Op __o(*this); + *__o = __c; + if (__o.failed()) + this->setstate(ios_base::badbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + sentry __sen(*this); + if (__sen && __n) { + if (this->rdbuf()->sputn(__s, __n) != __n) + this->setstate(ios_base::badbit); + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::flush() { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + if (this->rdbuf()) { + sentry __s(*this); + if (__s) { + if (this->rdbuf()->pubsync() == -1) + this->setstate(ios_base::badbit); + } + } +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + this->__set_badbit_and_consider_rethrow(); + } +#endif // _LIBCPP_HAS_NO_EXCEPTIONS + return *this; +} + +template <class _CharT, class _Traits> +typename basic_ostream<_CharT, _Traits>::pos_type basic_ostream<_CharT, _Traits>::tellp() { + if (this->fail()) + return pos_type(-1); + return this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::seekp(pos_type __pos) { + sentry __s(*this); + if (!this->fail()) { + if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1)) + this->setstate(ios_base::failbit); + } + return *this; +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir) { + sentry __s(*this); + if (!this->fail()) { + if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1)) + this->setstate(ios_base::failbit); + } + return *this; +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { + __os.put(__os.widen('\n')); + __os.flush(); + return __os; +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) { + __os.put(_CharT()); + return __os; +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& flush(basic_ostream<_CharT, _Traits>& __os) { + __os.flush(); + return __os; +} + +template <class _Stream, class _Tp, class = void> +struct __is_ostreamable : false_type {}; + +template <class _Stream, class _Tp> +struct __is_ostreamable<_Stream, _Tp, decltype(std::declval<_Stream>() << std::declval<_Tp>(), void())> : true_type {}; + +template <class _Stream, + class _Tp, + __enable_if_t<_And<is_base_of<ios_base, _Stream>, __is_ostreamable<_Stream&, const _Tp&> >::value, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Stream&& operator<<(_Stream&& __os, const _Tp& __x) { + __os << __x; + return std::move(__os); +} + +template <class _CharT, class _Traits, class _Allocator> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const basic_string<_CharT, _Traits, _Allocator>& __str) { + return std::__put_character_sequence(__os, __str.data(), __str.size()); +} + +template <class _CharT, class _Traits> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __sv) { + return std::__put_character_sequence(__os, __sv.data(), __sv.size()); +} + +template <class _CharT, class _Traits> +inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec) { + return __os << __ec.category().name() << ':' << __ec.value(); +} + +template <class _CharT, class _Traits, class _Yp> +inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p) { + return __os << __p.get(); +} + +template < + class _CharT, + class _Traits, + class _Yp, + class _Dp, + __enable_if_t<is_same<void, + __void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>() + << std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value, + int> = 0> +inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) { + return __os << __p.get(); +} + +template <class _CharT, class _Traits, size_t _Size> +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) { + return __os << __x.template to_string<_CharT, _Traits>(std::use_facet<ctype<_CharT> >(__os.getloc()).widen('0'), + std::use_facet<ctype<_CharT> >(__os.getloc()).widen('1')); +} + +#if 0 && _LIBCPP_STD_VER >= 20 + +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete; + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete; + +# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS + +# ifndef _LIBCPP_HAS_NO_CHAR8_T +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char8_t) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete; + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete; + +template <class _Traits> +basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete; +# endif + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char16_t) = delete; + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete; + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete; + +template <class _Traits> +basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete; + +#endif // _LIBCPP_STD_VER >= 20 + +extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>; +#endif + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___OSTREAM_BASIC_OSTREAM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ostream/print.h b/contrib/libs/cxxsupp/libcxx/include/__ostream/print.h new file mode 100644 index 0000000000..8265ac0077 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ostream/print.h @@ -0,0 +1,179 @@ +//===---------------------------------------------------------------------===// +// +// 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___OSTREAM_PRINT_H +#define _LIBCPP___OSTREAM_PRINT_H + +#include <__config> +#include <__fwd/ostream.h> +#include <__iterator/ostreambuf_iterator.h> +#include <__ostream/basic_ostream.h> +#include <format> +#include <ios> +#include <locale> +#include <print> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER >= 23 + +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void +__vprint_nonunicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) { + // [ostream.formatted.print]/3 + // Effects: Behaves as a formatted output function + // ([ostream.formatted.reqmts]) of os, except that: + // - failure to generate output is reported as specified below, and + // - any exception thrown by the call to vformat is propagated without regard + // to the value of os.exceptions() and without turning on ios_base::badbit + // in the error state of os. + // After constructing a sentry object, the function initializes an automatic + // variable via + // string out = vformat(os.getloc(), fmt, args); + + ostream::sentry __s(__os); + if (__s) { + string __o = std::vformat(__os.getloc(), __fmt, __args); + if (__write_nl) + __o += '\n'; + + const char* __str = __o.data(); + size_t __len = __o.size(); + +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +# endif // _LIBCPP_HAS_NO_EXCEPTIONS + typedef ostreambuf_iterator<char> _Ip; + if (std::__pad_and_output( + _Ip(__os), + __str, + (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str, + __str + __len, + __os, + __os.fill()) + .failed()) + __os.setstate(ios_base::badbit | ios_base::failbit); + +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + __os.__set_badbit_and_consider_rethrow(); + } +# endif // _LIBCPP_HAS_NO_EXCEPTIONS + } +} + +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view __fmt, format_args __args) { + std::__vprint_nonunicode(__os, __fmt, __args, false); +} + +// Returns the FILE* associated with the __os. +// Returns a nullptr when no FILE* is associated with __os. +// This function is in the dylib since the type of the buffer associated +// with std::cout, std::cerr, and std::clog is only known in the dylib. +// +// This function implements part of the implementation-defined behavior +// of [ostream.formatted.print]/3 +// If the function is vprint_unicode and os is a stream that refers to +// a terminal capable of displaying Unicode which is determined in an +// implementation-defined manner, writes out to the terminal using the +// native Unicode API; +// Whether the returned FILE* is "a terminal capable of displaying Unicode" +// is determined in the same way as the print(FILE*, ...) overloads. +_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os); + +# ifndef _LIBCPP_HAS_NO_UNICODE +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) { +# if _LIBCPP_AVAILABILITY_HAS_PRINT == 0 + return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl); +# else + FILE* __file = std::__get_ostream_file(__os); + if (!__file || !__print::__is_terminal(__file)) + return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl); + + // [ostream.formatted.print]/3 + // If the function is vprint_unicode and os is a stream that refers to a + // terminal capable of displaying Unicode which is determined in an + // implementation-defined manner, writes out to the terminal using the + // native Unicode API; if out contains invalid code units, the behavior is + // undefined and implementations are encouraged to diagnose it. If the + // native Unicode API is used, the function flushes os before writing out. + // + // This is the path for the native API, start with flushing. + __os.flush(); + +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +# endif // _LIBCPP_HAS_NO_EXCEPTIONS + ostream::sentry __s(__os); + if (__s) { +# ifndef _LIBCPP_WIN32API + __print::__vprint_unicode_posix(__file, __fmt, __args, __write_nl, true); +# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) + __print::__vprint_unicode_windows(__file, __fmt, __args, __write_nl, true); +# else +# error "Windows builds with wchar_t disabled are not supported." +# endif + } + +# ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (...) { + __os.__set_badbit_and_consider_rethrow(); + } +# endif // _LIBCPP_HAS_NO_EXCEPTIONS +# endif // _LIBCPP_AVAILABILITY_HAS_PRINT +} + +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(ostream& __os, string_view __fmt, format_args __args) { + std::__vprint_unicode(__os, __fmt, __args, false); +} +# endif // _LIBCPP_HAS_NO_UNICODE + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI void print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) { +# ifndef _LIBCPP_HAS_NO_UNICODE + if constexpr (__print::__use_unicode_execution_charset) + std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), false); + else + std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false); +# else // _LIBCPP_HAS_NO_UNICODE + std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false); +# endif // _LIBCPP_HAS_NO_UNICODE +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI void println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) { +# ifndef _LIBCPP_HAS_NO_UNICODE + // Note the wording in the Standard is inefficient. The output of + // std::format is a std::string which is then copied. This solution + // just appends a newline at the end of the output. + if constexpr (__print::__use_unicode_execution_charset) + std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), true); + else + std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true); +# else // _LIBCPP_HAS_NO_UNICODE + std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true); +# endif // _LIBCPP_HAS_NO_UNICODE +} + +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void println(ostream& __os) { + std::print(__os, "\n"); +} + +#endif // _LIBCPP_STD_VER >= 23 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___OSTREAM_PRINT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backend.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backend.h new file mode 100644 index 0000000000..86d9f28c77 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backend.h @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKEND_H +#define _LIBCPP___PSTL_BACKEND_H + +#include <__config> +#include <__pstl/backend_fwd.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +#if defined(_LIBCPP_PSTL_BACKEND_SERIAL) +# include <__pstl/backends/default.h> +# include <__pstl/backends/serial.h> +#elif defined(_LIBCPP_PSTL_BACKEND_STD_THREAD) +# include <__pstl/backends/default.h> +# include <__pstl/backends/std_thread.h> +#elif defined(_LIBCPP_PSTL_BACKEND_LIBDISPATCH) +# include <__pstl/backends/default.h> +# include <__pstl/backends/libdispatch.h> +#endif + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKEND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backend_fwd.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backend_fwd.h new file mode 100644 index 0000000000..32c5da576f --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backend_fwd.h @@ -0,0 +1,301 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKEND_FWD_H +#define _LIBCPP___PSTL_BACKEND_FWD_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +// +// This header declares available PSTL backends and the functions that must be implemented in order for the +// PSTL algorithms to be provided. +// +// Backends often do not implement the full set of functions themselves -- a configuration of the PSTL is +// usually a set of backends "stacked" together which each implement some algorithms under some execution +// policies. It is only necessary for the "stack" of backends to implement all algorithms under all execution +// policies, but a single backend is not required to implement everything on its own. +// +// The signatures used by each backend function are documented below. +// +// Exception handling +// ================== +// +// PSTL backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from +// their implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions +// are turned into a program termination at the front-end level. When a backend returns a disengaged `optional` to the +// frontend, the frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to +// the user. +// + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class... _Backends> +struct __backend_configuration; + +struct __default_backend_tag; +struct __libdispatch_backend_tag; +struct __serial_backend_tag; +struct __std_thread_backend_tag; + +#if defined(_LIBCPP_PSTL_BACKEND_SERIAL) +using __current_configuration = __backend_configuration<__serial_backend_tag, __default_backend_tag>; +#elif defined(_LIBCPP_PSTL_BACKEND_STD_THREAD) +using __current_configuration = __backend_configuration<__std_thread_backend_tag, __default_backend_tag>; +#elif defined(_LIBCPP_PSTL_BACKEND_LIBDISPATCH) +using __current_configuration = __backend_configuration<__libdispatch_backend_tag, __default_backend_tag>; +#else + +// ...New vendors can add parallel backends here... + +# error "Invalid PSTL backend configuration" +#endif + +template <class _Backend, class _ExecutionPolicy> +struct __find_if; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<_ForwardIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __find_if_not; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<_ForwardIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __find; +// template <class _Policy, class _ForwardIterator, class _Tp> +// optional<_ForwardIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __any_of; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __all_of; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __none_of; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __is_partitioned; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __for_each; +// template <class _Policy, class _ForwardIterator, class _Function> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Function __func) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __for_each_n; +// template <class _Policy, class _ForwardIterator, class _Size, class _Function> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _Size __size, _Function __func) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __fill; +// template <class _Policy, class _ForwardIterator, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __fill_n; +// template <class _Policy, class _ForwardIterator, class _Size, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Tp const& __value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __replace; +// template <class _Policy, class _ForwardIterator, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _Tp const& __old, _Tp const& __new) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __replace_if; +// template <class _Policy, class _ForwardIterator, class _Predicate, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _Predicate __pred, _Tp const& __new_value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __generate; +// template <class _Policy, class _ForwardIterator, class _Generator> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Generator __gen) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __generate_n; +// template <class _Policy, class _ForwardIterator, class _Size, class _Generator> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Generator __gen) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __merge; +// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, +// _ForwardIterator2 __first2, _ForwardIterator2 __last2, +// _ForwardOutIterator __result, _Comp __comp) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __stable_sort; +// template <class _Policy, class _RandomAccessIterator, class _Comp> +// optional<__empty> +// operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __sort; +// template <class _Policy, class _RandomAccessIterator, class _Comp> +// optional<__empty> +// operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __transform; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _ForwardOutIterator __result, +// _UnaryOperation __op) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __transform_binary; +// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, +// class _ForwardOutIterator, +// class _BinaryOperation> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, +// _ForwardIterator2 __first2, +// _ForwardOutIterator __result, +// _BinaryOperation __op) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __replace_copy_if; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Predicate, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _ForwardOutIterator __out_it, +// _Predicate __pred, +// _Tp const& __new_value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __replace_copy; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Tp> +// optional<__empty> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _ForwardOutIterator __out_it, +// _Tp const& __old_value, +// _Tp const& __new_value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __move; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _ForwardOutIterator __out_it) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __copy; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _ForwardOutIterator __out_it) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __copy_n; +// template <class _Policy, class _ForwardIterator, class _Size, class _ForwardOutIterator> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _ForwardOutIterator __out_it) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __rotate_copy; +// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> +// optional<_ForwardOutIterator> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, +// _ForwardOutIterator __out_it) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __transform_reduce; +// template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation> +// optional<_Tp> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _Tp __init, +// _BinaryOperation __reduce, +// _UnaryOperation __transform) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __transform_reduce_binary; +// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, +// class _Tp, class _BinaryOperation1, class _BinaryOperation2> +// optional<_Tp> operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, +// _ForwardIterator2 __first2, +// _Tp __init, +// _BinaryOperation1 __reduce, +// _BinaryOperation2 __transform) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __count_if; +// template <class _Policy, class _ForwardIterator, class _Predicate> +// optional<__iter_diff_t<_ForwardIterator>> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __count; +// template <class _Policy, class _ForwardIterator, class _Tp> +// optional<__iter_diff_t<_ForwardIterator>> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __equal_3leg; +// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, +// _ForwardIterator2 __first2, +// _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __equal; +// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate> +// optional<bool> +// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, +// _ForwardIterator2 __first2, _ForwardIterator2 __last2, +// _Predicate __pred) const noexcept; + +template <class _Backend, class _ExecutionPolicy> +struct __reduce; +// template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation> +// optional<_Tp> +// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, +// _Tp __init, _BinaryOperation __op) const noexcept; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKEND_FWD_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/default.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/default.h new file mode 100644 index 0000000000..61a128805f --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/default.h @@ -0,0 +1,503 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKENDS_DEFAULT_H +#define _LIBCPP___PSTL_BACKENDS_DEFAULT_H + +#include <__algorithm/copy_n.h> +#include <__algorithm/equal.h> +#include <__algorithm/fill_n.h> +#include <__algorithm/for_each_n.h> +#include <__config> +#include <__functional/identity.h> +#include <__functional/not_fn.h> +#include <__functional/operations.h> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/dispatch.h> +#include <__utility/empty.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +// +// This file provides an incomplete PSTL backend that implements all of the PSTL algorithms +// based on a smaller set of basis operations. +// +// It is intended as a building block for other PSTL backends that implement some operations more +// efficiently but may not want to define the full set of PSTL algorithms. +// +// This backend implements all the PSTL algorithms based on the following basis operations: +// +// find_if family +// -------------- +// - find +// - find_if_not +// - any_of +// - all_of +// - none_of +// - is_partitioned +// +// for_each family +// --------------- +// - for_each_n +// - fill +// - fill_n +// - replace +// - replace_if +// - generate +// - generate_n +// +// merge family +// ------------ +// No other algorithms based on merge +// +// stable_sort family +// ------------------ +// - sort +// +// transform_reduce and transform_reduce_binary family +// --------------------------------------------------- +// - count_if +// - count +// - equal(3 legs) +// - equal +// - reduce +// +// transform and transform_binary family +// ------------------------------------- +// - replace_copy_if +// - replace_copy +// - move +// - copy +// - copy_n +// - rotate_copy +// + +////////////////////////////////////////////////////////////// +// find_if family +////////////////////////////////////////////////////////////// +template <class _ExecutionPolicy> +struct __find<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept { + using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>; + return _FindIf()( + __policy, std::move(__first), std::move(__last), [&](__iter_reference<_ForwardIterator> __element) { + return __element == __value; + }); + } +}; + +template <class _ExecutionPolicy> +struct __find_if_not<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>; + return _FindIf()(__policy, __first, __last, std::not_fn(std::forward<_Pred>(__pred))); + } +}; + +template <class _ExecutionPolicy> +struct __any_of<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>; + auto __res = _FindIf()(__policy, __first, __last, std::forward<_Pred>(__pred)); + if (!__res) + return nullopt; + return *__res != __last; + } +}; + +template <class _ExecutionPolicy> +struct __all_of<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + using _AnyOf = __dispatch<__any_of, __current_configuration, _ExecutionPolicy>; + auto __res = _AnyOf()(__policy, __first, __last, [&](__iter_reference<_ForwardIterator> __value) { + return !__pred(__value); + }); + if (!__res) + return nullopt; + return !*__res; + } +}; + +template <class _ExecutionPolicy> +struct __none_of<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + using _AnyOf = __dispatch<__any_of, __current_configuration, _ExecutionPolicy>; + auto __res = _AnyOf()(__policy, __first, __last, std::forward<_Pred>(__pred)); + if (!__res) + return nullopt; + return !*__res; + } +}; + +template <class _ExecutionPolicy> +struct __is_partitioned<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + using _FindIfNot = __dispatch<__find_if_not, __current_configuration, _ExecutionPolicy>; + auto __maybe_first = _FindIfNot()(__policy, std::move(__first), std::move(__last), __pred); + if (__maybe_first == nullopt) + return nullopt; + + __first = *__maybe_first; + if (__first == __last) + return true; + ++__first; + using _NoneOf = __dispatch<__none_of, __current_configuration, _ExecutionPolicy>; + return _NoneOf()(__policy, std::move(__first), std::move(__last), __pred); + } +}; + +////////////////////////////////////////////////////////////// +// for_each family +////////////////////////////////////////////////////////////// +template <class _ExecutionPolicy> +struct __for_each_n<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Size, class _Function> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _Size __size, _Function __func) const noexcept { + if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>; + _ForwardIterator __last = __first + __size; + return _ForEach()(__policy, std::move(__first), std::move(__last), std::move(__func)); + } else { + // Otherwise, use the serial algorithm to avoid doing two passes over the input + std::for_each_n(std::move(__first), __size, std::move(__func)); + return __empty{}; + } + } +}; + +template <class _ExecutionPolicy> +struct __fill<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept { + using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __value; }); + } +}; + +template <class _ExecutionPolicy> +struct __fill_n<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Size, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _Size __n, _Tp const& __value) const noexcept { + if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + using _Fill = __dispatch<__fill, __current_configuration, _ExecutionPolicy>; + _ForwardIterator __last = __first + __n; + return _Fill()(__policy, std::move(__first), std::move(__last), __value); + } else { + // Otherwise, use the serial algorithm to avoid doing two passes over the input + std::fill_n(std::move(__first), __n, __value); + return optional<__empty>{__empty{}}; + } + } +}; + +template <class _ExecutionPolicy> +struct __replace<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __old, _Tp const& __new) + const noexcept { + using _ReplaceIf = __dispatch<__replace_if, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ReplaceIf()( + __policy, std::move(__first), std::move(__last), [&](_Ref __element) { return __element == __old; }, __new); + } +}; + +template <class _ExecutionPolicy> +struct __replace_if<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> operator()( + _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred, _Tp const& __new_value) + const noexcept { + using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { + if (__pred(__element)) + __element = __new_value; + }); + } +}; + +template <class _ExecutionPolicy> +struct __generate<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Generator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator&& __gen) const noexcept { + using _ForEach = __dispatch<__for_each, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ForEach()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) { __element = __gen(); }); + } +}; + +template <class _ExecutionPolicy> +struct __generate_n<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Size, class _Generator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _Size __n, _Generator&& __gen) const noexcept { + using _ForEachN = __dispatch<__for_each_n, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ForEachN()(__policy, std::move(__first), __n, [&](_Ref __element) { __element = __gen(); }); + } +}; + +////////////////////////////////////////////////////////////// +// stable_sort family +////////////////////////////////////////////////////////////// +template <class _ExecutionPolicy> +struct __sort<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _RandomAccessIterator, class _Comp> + _LIBCPP_HIDE_FROM_ABI optional<__empty> operator()( + _Policy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp&& __comp) const noexcept { + using _StableSort = __dispatch<__stable_sort, __current_configuration, _ExecutionPolicy>; + return _StableSort()(__policy, std::move(__first), std::move(__last), std::forward<_Comp>(__comp)); + } +}; + +////////////////////////////////////////////////////////////// +// transform_reduce family +////////////////////////////////////////////////////////////// +template <class _ExecutionPolicy> +struct __count_if<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Predicate> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>> operator()( + _Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred) const noexcept { + using _TransformReduce = __dispatch<__transform_reduce, __current_configuration, _ExecutionPolicy>; + using _DiffT = __iter_diff_t<_ForwardIterator>; + using _Ref = __iter_reference<_ForwardIterator>; + return _TransformReduce()( + __policy, std::move(__first), std::move(__last), _DiffT{}, std::plus{}, [&](_Ref __element) -> _DiffT { + return __pred(__element) ? _DiffT(1) : _DiffT(0); + }); + } +}; + +template <class _ExecutionPolicy> +struct __count<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__iter_diff_t<_ForwardIterator>> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept { + using _CountIf = __dispatch<__count_if, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _CountIf()(__policy, std::move(__first), std::move(__last), [&](_Ref __element) -> bool { + return __element == __value; + }); + } +}; + +template <class _ExecutionPolicy> +struct __equal_3leg<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Predicate&& __pred) const noexcept { + using _TransformReduce = __dispatch<__transform_reduce_binary, __current_configuration, _ExecutionPolicy>; + return _TransformReduce()( + __policy, + std::move(__first1), + std::move(__last1), + std::move(__first2), + true, + std::logical_and{}, + std::forward<_Predicate>(__pred)); + } +}; + +template <class _ExecutionPolicy> +struct __equal<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _Predicate&& __pred) const noexcept { + if constexpr (__has_random_access_iterator_category<_ForwardIterator1>::value && + __has_random_access_iterator_category<_ForwardIterator2>::value) { + if (__last1 - __first1 != __last2 - __first2) + return false; + // Fall back to the 3 legged algorithm + using _Equal3Leg = __dispatch<__equal_3leg, __current_configuration, _ExecutionPolicy>; + return _Equal3Leg()( + __policy, std::move(__first1), std::move(__last1), std::move(__first2), std::forward<_Predicate>(__pred)); + } else { + // If we don't have random access, fall back to the serial algorithm cause we can't do much + return std::equal( + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + std::forward<_Predicate>(__pred)); + } + } +}; + +template <class _ExecutionPolicy> +struct __reduce<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_Tp> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation&& __op) + const noexcept { + using _TransformReduce = __dispatch<__transform_reduce, __current_configuration, _ExecutionPolicy>; + return _TransformReduce()( + __policy, + std::move(__first), + std::move(__last), + std::move(__init), + std::forward<_BinaryOperation>(__op), + __identity{}); + } +}; + +////////////////////////////////////////////////////////////// +// transform family +////////////////////////////////////////////////////////////// +template <class _ExecutionPolicy> +struct __replace_copy_if<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Pred, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __out_it, + _Pred&& __pred, + _Tp const& __new_value) const noexcept { + using _Transform = __dispatch<__transform, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + auto __res = + _Transform()(__policy, std::move(__first), std::move(__last), std::move(__out_it), [&](_Ref __element) { + return __pred(__element) ? __new_value : __element; + }); + if (__res == nullopt) + return nullopt; + return __empty{}; + } +}; + +template <class _ExecutionPolicy> +struct __replace_copy<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __out_it, + _Tp const& __old_value, + _Tp const& __new_value) const noexcept { + using _ReplaceCopyIf = __dispatch<__replace_copy_if, __current_configuration, _ExecutionPolicy>; + using _Ref = __iter_reference<_ForwardIterator>; + return _ReplaceCopyIf()( + __policy, + std::move(__first), + std::move(__last), + std::move(__out_it), + [&](_Ref __element) { return __element == __old_value; }, + __new_value); + } +}; + +// TODO: Use the std::copy/move shenanigans to forward to std::memmove +// Investigate whether we want to still forward to std::transform(policy) +// in that case for the execution::par part, or whether we actually want +// to run everything serially in that case. +template <class _ExecutionPolicy> +struct __move<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __out_it) + const noexcept { + using _Transform = __dispatch<__transform, __current_configuration, _ExecutionPolicy>; + return _Transform()(__policy, std::move(__first), std::move(__last), std::move(__out_it), [&](auto&& __element) { + return std::move(__element); + }); + } +}; + +// TODO: Use the std::copy/move shenanigans to forward to std::memmove +template <class _ExecutionPolicy> +struct __copy<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __out_it) + const noexcept { + using _Transform = __dispatch<__transform, __current_configuration, _ExecutionPolicy>; + return _Transform()(__policy, std::move(__first), std::move(__last), std::move(__out_it), __identity()); + } +}; + +template <class _ExecutionPolicy> +struct __copy_n<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Size, class _ForwardOutIterator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _Size __n, _ForwardOutIterator __out_it) const noexcept { + if constexpr (__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + using _Copy = __dispatch<__copy, __current_configuration, _ExecutionPolicy>; + _ForwardIterator __last = __first + __n; + return _Copy()(__policy, std::move(__first), std::move(__last), std::move(__out_it)); + } else { + // Otherwise, use the serial algorithm to avoid doing two passes over the input + return std::copy_n(std::move(__first), __n, std::move(__out_it)); + } + } +}; + +template <class _ExecutionPolicy> +struct __rotate_copy<__default_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, + _ForwardIterator __first, + _ForwardIterator __middle, + _ForwardIterator __last, + _ForwardOutIterator __out_it) const noexcept { + using _Copy = __dispatch<__copy, __current_configuration, _ExecutionPolicy>; + auto __result_mid = _Copy()(__policy, __middle, std::move(__last), std::move(__out_it)); + if (__result_mid == nullopt) + return nullopt; + return _Copy()(__policy, std::move(__first), std::move(__middle), *std::move(__result_mid)); + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKENDS_DEFAULT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/libdispatch.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/libdispatch.h new file mode 100644 index 0000000000..a0c3ad980e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/libdispatch.h @@ -0,0 +1,397 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKENDS_LIBDISPATCH_H +#define _LIBCPP___PSTL_BACKENDS_LIBDISPATCH_H + +#include <__algorithm/inplace_merge.h> +#include <__algorithm/lower_bound.h> +#include <__algorithm/max.h> +#include <__algorithm/merge.h> +#include <__algorithm/upper_bound.h> +#include <__atomic/atomic.h> +#include <__config> +#include <__exception/terminate.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/move_iterator.h> +#include <__memory/allocator.h> +#include <__memory/construct_at.h> +#include <__memory/unique_ptr.h> +#include <__numeric/reduce.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/any_of.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__pstl/cpu_algos/fill.h> +#include <__pstl/cpu_algos/find_if.h> +#include <__pstl/cpu_algos/for_each.h> +#include <__pstl/cpu_algos/merge.h> +#include <__pstl/cpu_algos/stable_sort.h> +#include <__pstl/cpu_algos/transform.h> +#include <__pstl/cpu_algos/transform_reduce.h> +#include <__utility/empty.h> +#include <__utility/exception_guard.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <cstddef> +#include <new> +#include <optional> + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +namespace __libdispatch { +// ::dispatch_apply is marked as __attribute__((nothrow)) because it doesn't let exceptions propagate, and neither do +// we. +// TODO: Do we want to add [[_Clang::__callback__(__func, __context, __)]]? +_LIBCPP_EXPORTED_FROM_ABI void +__dispatch_apply(size_t __chunk_count, void* __context, void (*__func)(void* __context, size_t __chunk)) noexcept; + +template <class _Func> +_LIBCPP_HIDE_FROM_ABI void __dispatch_apply(size_t __chunk_count, _Func __func) noexcept { + __libdispatch::__dispatch_apply(__chunk_count, &__func, [](void* __context, size_t __chunk) { + (*static_cast<_Func*>(__context))(__chunk); + }); +} + +struct __chunk_partitions { + ptrdiff_t __chunk_count_; // includes the first chunk + ptrdiff_t __chunk_size_; + ptrdiff_t __first_chunk_size_; +}; + +[[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI __chunk_partitions __partition_chunks(ptrdiff_t __size) noexcept; + +template <class _RandomAccessIterator, class _Functor> +_LIBCPP_HIDE_FROM_ABI optional<__empty> +__dispatch_parallel_for(__chunk_partitions __partitions, _RandomAccessIterator __first, _Functor __func) { + // Perform the chunked execution. + __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) { + auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_; + auto __index = + __chunk == 0 + ? 0 + : (__chunk * __partitions.__chunk_size_) + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_); + __func(__first + __index, __first + __index + __this_chunk_size); + }); + + return __empty{}; +} +} // namespace __libdispatch + +template <> +struct __cpu_traits<__libdispatch_backend_tag> { + template <class _RandomAccessIterator, class _Functor> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __for_each(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func) { + return __libdispatch::__dispatch_parallel_for( + __libdispatch::__partition_chunks(__last - __first), std::move(__first), std::move(__func)); + } + + template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIteratorOut> + struct __merge_range { + __merge_range(_RandomAccessIterator1 __mid1, _RandomAccessIterator2 __mid2, _RandomAccessIteratorOut __result) + : __mid1_(__mid1), __mid2_(__mid2), __result_(__result) {} + + _RandomAccessIterator1 __mid1_; + _RandomAccessIterator2 __mid2_; + _RandomAccessIteratorOut __result_; + }; + + template <typename _RandomAccessIterator1, + typename _RandomAccessIterator2, + typename _RandomAccessIterator3, + typename _Compare, + typename _LeafMerge> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __merge(_RandomAccessIterator1 __first1, + _RandomAccessIterator1 __last1, + _RandomAccessIterator2 __first2, + _RandomAccessIterator2 __last2, + _RandomAccessIterator3 __result, + _Compare __comp, + _LeafMerge __leaf_merge) noexcept { + __libdispatch::__chunk_partitions __partitions = + __libdispatch::__partition_chunks(std::max<ptrdiff_t>(__last1 - __first1, __last2 - __first2)); + + if (__partitions.__chunk_count_ == 0) + return __empty{}; + + if (__partitions.__chunk_count_ == 1) { + __leaf_merge(__first1, __last1, __first2, __last2, __result, __comp); + return __empty{}; + } + + using __merge_range_t = __merge_range<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3>; + auto const __n_ranges = __partitions.__chunk_count_ + 1; + + // TODO: use __uninitialized_buffer + auto __destroy = [=](__merge_range_t* __ptr) { + std::destroy_n(__ptr, __n_ranges); + std::allocator<__merge_range_t>().deallocate(__ptr, __n_ranges); + }; + + unique_ptr<__merge_range_t[], decltype(__destroy)> __ranges( + [&]() -> __merge_range_t* { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +#endif + return std::allocator<__merge_range_t>().allocate(__n_ranges); +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + } catch (const std::bad_alloc&) { + return nullptr; + } +#endif + }(), + __destroy); + + if (!__ranges) + return nullopt; + + // TODO: Improve the case where the smaller range is merged into just a few (or even one) chunks of the larger case + __merge_range_t* __r = __ranges.get(); + std::__construct_at(__r++, __first1, __first2, __result); + + bool __iterate_first_range = __last1 - __first1 > __last2 - __first2; + + auto __compute_chunk = [&](size_t __chunk_size) -> __merge_range_t { + auto [__mid1, __mid2] = [&] { + if (__iterate_first_range) { + auto __m1 = __first1 + __chunk_size; + auto __m2 = std::lower_bound(__first2, __last2, __m1[-1], __comp); + return std::make_pair(__m1, __m2); + } else { + auto __m2 = __first2 + __chunk_size; + auto __m1 = std::lower_bound(__first1, __last1, __m2[-1], __comp); + return std::make_pair(__m1, __m2); + } + }(); + + __result += (__mid1 - __first1) + (__mid2 - __first2); + __first1 = __mid1; + __first2 = __mid2; + return {std::move(__mid1), std::move(__mid2), __result}; + }; + + // handle first chunk + std::__construct_at(__r++, __compute_chunk(__partitions.__first_chunk_size_)); + + // handle 2 -> N - 1 chunks + for (ptrdiff_t __i = 0; __i != __partitions.__chunk_count_ - 2; ++__i) + std::__construct_at(__r++, __compute_chunk(__partitions.__chunk_size_)); + + // handle last chunk + std::__construct_at(__r, __last1, __last2, __result); + + __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __index) { + auto __first_iters = __ranges[__index]; + auto __last_iters = __ranges[__index + 1]; + __leaf_merge( + __first_iters.__mid1_, + __last_iters.__mid1_, + __first_iters.__mid2_, + __last_iters.__mid2_, + __first_iters.__result_, + __comp); + }); + + return __empty{}; + } + + template <class _RandomAccessIterator, class _Transform, class _Value, class _Combiner, class _Reduction> + _LIBCPP_HIDE_FROM_ABI static optional<_Value> __transform_reduce( + _RandomAccessIterator __first, + _RandomAccessIterator __last, + _Transform __transform, + _Value __init, + _Combiner __combiner, + _Reduction __reduction) { + if (__first == __last) + return __init; + + auto __partitions = __libdispatch::__partition_chunks(__last - __first); + + auto __destroy = [__count = __partitions.__chunk_count_](_Value* __ptr) { + std::destroy_n(__ptr, __count); + std::allocator<_Value>().deallocate(__ptr, __count); + }; + + // TODO: use __uninitialized_buffer + // TODO: allocate one element per worker instead of one element per chunk + unique_ptr<_Value[], decltype(__destroy)> __values( + std::allocator<_Value>().allocate(__partitions.__chunk_count_), __destroy); + + // __dispatch_apply is noexcept + __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) { + auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_; + auto __index = __chunk == 0 ? 0 + : (__chunk * __partitions.__chunk_size_) + + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_); + if (__this_chunk_size != 1) { + std::__construct_at( + __values.get() + __chunk, + __reduction(__first + __index + 2, + __first + __index + __this_chunk_size, + __combiner(__transform(__first + __index), __transform(__first + __index + 1)))); + } else { + std::__construct_at(__values.get() + __chunk, __transform(__first + __index)); + } + }); + + return std::reduce( + std::make_move_iterator(__values.get()), + std::make_move_iterator(__values.get() + __partitions.__chunk_count_), + std::move(__init), + __combiner); + } + + template <class _RandomAccessIterator, class _Comp, class _LeafSort> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp, _LeafSort __leaf_sort) { + const auto __size = __last - __first; + auto __partitions = __libdispatch::__partition_chunks(__size); + + if (__partitions.__chunk_count_ == 0) + return __empty{}; + + if (__partitions.__chunk_count_ == 1) { + __leaf_sort(__first, __last, __comp); + return __empty{}; + } + + using _Value = __iter_value_type<_RandomAccessIterator>; + + auto __destroy = [__size](_Value* __ptr) { + std::destroy_n(__ptr, __size); + std::allocator<_Value>().deallocate(__ptr, __size); + }; + + // TODO: use __uninitialized_buffer + unique_ptr<_Value[], decltype(__destroy)> __values(std::allocator<_Value>().allocate(__size), __destroy); + + // Initialize all elements to a moved-from state + // TODO: Don't do this - this can be done in the first merge - see https://llvm.org/PR63928 + std::__construct_at(__values.get(), std::move(*__first)); + for (__iter_diff_t<_RandomAccessIterator> __i = 1; __i != __size; ++__i) { + std::__construct_at(__values.get() + __i, std::move(__values.get()[__i - 1])); + } + *__first = std::move(__values.get()[__size - 1]); + + __libdispatch::__dispatch_parallel_for( + __partitions, + __first, + [&__leaf_sort, &__comp](_RandomAccessIterator __chunk_first, _RandomAccessIterator __chunk_last) { + __leaf_sort(std::move(__chunk_first), std::move(__chunk_last), __comp); + }); + + bool __objects_are_in_buffer = false; + do { + const auto __old_chunk_size = __partitions.__chunk_size_; + if (__partitions.__chunk_count_ % 2 == 1) { + auto __inplace_merge_chunks = [&__comp, &__partitions](auto __first_chunk_begin) { + std::inplace_merge( + __first_chunk_begin, + __first_chunk_begin + __partitions.__first_chunk_size_, + __first_chunk_begin + __partitions.__first_chunk_size_ + __partitions.__chunk_size_, + __comp); + }; + if (__objects_are_in_buffer) + __inplace_merge_chunks(__values.get()); + else + __inplace_merge_chunks(__first); + __partitions.__first_chunk_size_ += 2 * __partitions.__chunk_size_; + } else { + __partitions.__first_chunk_size_ += __partitions.__chunk_size_; + } + + __partitions.__chunk_size_ *= 2; + __partitions.__chunk_count_ /= 2; + + auto __merge_chunks = [__partitions, __old_chunk_size, &__comp](auto __from_first, auto __to_first) { + __libdispatch::__dispatch_parallel_for( + __partitions, + __from_first, + [__old_chunk_size, &__from_first, &__to_first, &__comp](auto __chunk_first, auto __chunk_last) { + std::merge(std::make_move_iterator(__chunk_first), + std::make_move_iterator(__chunk_last - __old_chunk_size), + std::make_move_iterator(__chunk_last - __old_chunk_size), + std::make_move_iterator(__chunk_last), + __to_first + (__chunk_first - __from_first), + __comp); + }); + }; + + if (__objects_are_in_buffer) + __merge_chunks(__values.get(), __first); + else + __merge_chunks(__first, __values.get()); + __objects_are_in_buffer = !__objects_are_in_buffer; + } while (__partitions.__chunk_count_ > 1); + + if (__objects_are_in_buffer) { + std::move(__values.get(), __values.get() + __size, __first); + } + + return __empty{}; + } + + _LIBCPP_HIDE_FROM_ABI static void __cancel_execution() {} + + static constexpr size_t __lane_size = 64; +}; + +// Mandatory implementations of the computational basis +template <class _ExecutionPolicy> +struct __find_if<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_find_if<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __for_each<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_for_each<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __merge<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_merge<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __stable_sort<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_stable_sort<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_binary<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_binary<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_reduce<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_reduce<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_reduce_binary<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_reduce_binary<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +// Not mandatory, but better optimized +template <class _ExecutionPolicy> +struct __any_of<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_any_of<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __fill<__libdispatch_backend_tag, _ExecutionPolicy> + : __cpu_parallel_fill<__libdispatch_backend_tag, _ExecutionPolicy> {}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKENDS_LIBDISPATCH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/serial.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/serial.h new file mode 100644 index 0000000000..5f24499899 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/serial.h @@ -0,0 +1,181 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKENDS_SERIAL_H +#define _LIBCPP___PSTL_BACKENDS_SERIAL_H + +#include <__algorithm/find_if.h> +#include <__algorithm/for_each.h> +#include <__algorithm/merge.h> +#include <__algorithm/stable_sort.h> +#include <__algorithm/transform.h> +#include <__config> +#include <__numeric/transform_reduce.h> +#include <__pstl/backend_fwd.h> +#include <__utility/empty.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +// +// This partial PSTL backend runs everything serially. +// +// TODO: Right now, the serial backend must be used with another backend +// like the "default backend" because it doesn't implement all the +// necessary PSTL operations. It would be better to dispatch all +// algorithms to their serial counterpart directly, since this can +// often be more efficient than the "default backend"'s implementation +// if we end up running serially anyways. +// + +template <class _ExecutionPolicy> +struct __find_if<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Pred> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator> + operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Pred&& __pred) const noexcept { + return std::find_if(std::move(__first), std::move(__last), std::forward<_Pred>(__pred)); + } +}; + +template <class _ExecutionPolicy> +struct __for_each<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Function> + _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Function&& __func) const noexcept { + std::for_each(std::move(__first), std::move(__last), std::forward<_Function>(__func)); + return __empty{}; + } +}; + +template <class _ExecutionPolicy> +struct __merge<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> operator()( + _Policy&&, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _ForwardOutIterator __outit, + _Comp&& __comp) const noexcept { + return std::merge( + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__last2), + std::move(__outit), + std::forward<_Comp>(__comp)); + } +}; + +template <class _ExecutionPolicy> +struct __stable_sort<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _RandomAccessIterator, class _Comp> + _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp&& __comp) const noexcept { + std::stable_sort(std::move(__first), std::move(__last), std::forward<_Comp>(__comp)); + return __empty{}; + } +}; + +template <class _ExecutionPolicy> +struct __transform<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> operator()( + _Policy&&, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __outit, _UnaryOperation&& __op) + const noexcept { + return std::transform( + std::move(__first), std::move(__last), std::move(__outit), std::forward<_UnaryOperation>(__op)); + } +}; + +template <class _ExecutionPolicy> +struct __transform_binary<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, + class _ForwardIterator1, + class _ForwardIterator2, + class _ForwardOutIterator, + class _BinaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&&, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardOutIterator __outit, + _BinaryOperation&& __op) const noexcept { + return std::transform( + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__outit), + std::forward<_BinaryOperation>(__op)); + } +}; + +template <class _ExecutionPolicy> +struct __transform_reduce<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_Tp> + operator()(_Policy&&, + _ForwardIterator __first, + _ForwardIterator __last, + _Tp __init, + _BinaryOperation&& __reduce, + _UnaryOperation&& __transform) const noexcept { + return std::transform_reduce( + std::move(__first), + std::move(__last), + std::move(__init), + std::forward<_BinaryOperation>(__reduce), + std::forward<_UnaryOperation>(__transform)); + } +}; + +template <class _ExecutionPolicy> +struct __transform_reduce_binary<__serial_backend_tag, _ExecutionPolicy> { + template <class _Policy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + class _BinaryOperation1, + class _BinaryOperation2> + _LIBCPP_HIDE_FROM_ABI optional<_Tp> operator()( + _Policy&&, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init, + _BinaryOperation1&& __reduce, + _BinaryOperation2&& __transform) const noexcept { + return std::transform_reduce( + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__init), + std::forward<_BinaryOperation1>(__reduce), + std::forward<_BinaryOperation2>(__transform)); + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKENDS_SERIAL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/std_thread.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/std_thread.h new file mode 100644 index 0000000000..49570bd30b --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/backends/std_thread.h @@ -0,0 +1,136 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_BACKENDS_STD_THREAD_H +#define _LIBCPP___PSTL_BACKENDS_STD_THREAD_H + +#include <__config> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/any_of.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__pstl/cpu_algos/fill.h> +#include <__pstl/cpu_algos/find_if.h> +#include <__pstl/cpu_algos/for_each.h> +#include <__pstl/cpu_algos/merge.h> +#include <__pstl/cpu_algos/stable_sort.h> +#include <__pstl/cpu_algos/transform.h> +#include <__pstl/cpu_algos/transform_reduce.h> +#include <__utility/empty.h> +#include <__utility/move.h> +#include <cstddef> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +// +// This partial backend implementation is for testing purposes only and not meant for production use. This will be +// replaced by a proper implementation once the PSTL implementation is somewhat stable. +// +// This is intended to be used on top of the "default backend". +// + +template <> +struct __cpu_traits<__std_thread_backend_tag> { + template <class _RandomAccessIterator, class _Fp> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __for_each(_RandomAccessIterator __first, _RandomAccessIterator __last, _Fp __f) { + __f(__first, __last); + return __empty{}; + } + + template <class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce> + _LIBCPP_HIDE_FROM_ABI static optional<_Tp> + __transform_reduce(_Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce) { + return __reduce(std::move(__first), std::move(__last), std::move(__init)); + } + + template <class _RandomAccessIterator, class _Compare, class _LeafSort> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort) { + __leaf_sort(__first, __last, __comp); + return __empty{}; + } + + _LIBCPP_HIDE_FROM_ABI static void __cancel_execution() {} + + template <class _RandomAccessIterator1, + class _RandomAccessIterator2, + class _RandomAccessIterator3, + class _Compare, + class _LeafMerge> + _LIBCPP_HIDE_FROM_ABI static optional<__empty> + __merge(_RandomAccessIterator1 __first1, + _RandomAccessIterator1 __last1, + _RandomAccessIterator2 __first2, + _RandomAccessIterator2 __last2, + _RandomAccessIterator3 __outit, + _Compare __comp, + _LeafMerge __leaf_merge) { + __leaf_merge(__first1, __last1, __first2, __last2, __outit, __comp); + return __empty{}; + } + + static constexpr size_t __lane_size = 64; +}; + +// Mandatory implementations of the computational basis +template <class _ExecutionPolicy> +struct __find_if<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_find_if<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __for_each<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_for_each<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __merge<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_merge<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __stable_sort<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_stable_sort<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_binary<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_binary<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_reduce<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_reduce<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __transform_reduce_binary<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_transform_reduce_binary<__std_thread_backend_tag, _ExecutionPolicy> {}; + +// Not mandatory, but better optimized +template <class _ExecutionPolicy> +struct __any_of<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_any_of<__std_thread_backend_tag, _ExecutionPolicy> {}; + +template <class _ExecutionPolicy> +struct __fill<__std_thread_backend_tag, _ExecutionPolicy> + : __cpu_parallel_fill<__std_thread_backend_tag, _ExecutionPolicy> {}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_BACKENDS_STD_THREAD_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/any_of.h index 13dff80086..b33c787a29 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/any_of.h @@ -6,37 +6,36 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H +#ifndef _LIBCPP___PSTL_CPU_ALGOS_ANY_OF_H +#define _LIBCPP___PSTL_CPU_ALGOS_ANY_OF_H #include <__algorithm/any_of.h> -#include <__algorithm/find_if.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> +#include <__assert> #include <__atomic/atomic.h> #include <__atomic/memory_order.h> #include <__config> -#include <__functional/operations.h> #include <__iterator/concepts.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> #include <__type_traits/is_execution_policy.h> #include <__utility/move.h> #include <__utility/pair.h> #include <cstdint> #include <optional> -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - _LIBCPP_PUSH_MACROS -# include <__undef_macros> +#include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { -template <class _Index, class _Brick> +template <class _Backend, class _Index, class _Brick> _LIBCPP_HIDE_FROM_ABI optional<bool> __parallel_or(_Index __first, _Index __last, _Brick __f) { std::atomic<bool> __found(false); - auto __ret = __par_backend::__parallel_for(__first, __last, [__f, &__found](_Index __i, _Index __j) { + auto __ret = __cpu_traits<_Backend>::__for_each(__first, __last, [__f, &__found](_Index __i, _Index __j) { if (!__found.load(std::memory_order_relaxed) && __f(__i, __j)) { __found.store(true, std::memory_order_relaxed); - __par_backend::__cancel_execution(); + __cpu_traits<_Backend>::__cancel_execution(); } }); if (!__ret) @@ -69,30 +68,32 @@ _LIBCPP_HIDE_FROM_ABI bool __simd_or(_Index __first, _DifferenceType __n, _Pred return false; } -template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate> -_LIBCPP_HIDE_FROM_ABI optional<bool> -__pstl_any_of(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return std::__parallel_or( - __first, __last, [&__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { - auto __res = std::__pstl_any_of<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, __brick_first, __brick_last, __pred); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - return *std::move(__res); - }); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return std::__simd_or(__first, __last - __first, __pred); - } else { - return std::any_of(__first, __last, __pred); +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_any_of { + template <class _Policy, class _ForwardIterator, class _Predicate> + _LIBCPP_HIDE_FROM_ABI optional<bool> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __pstl::__parallel_or<_Backend>( + __first, __last, [&__policy, &__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { + using _AnyOfUnseq = __pstl::__any_of<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + auto __res = _AnyOfUnseq()(std::__remove_parallel_policy(__policy), __brick_first, __brick_last, __pred); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + return *std::move(__res); + }); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __pstl::__simd_or(__first, __last - __first, __pred); + } else { + return std::any_of(__first, __last, __pred); + } } -} +}; +} // namespace __pstl _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H +#endif // _LIBCPP___PSTL_CPU_ALGOS_ANY_OF_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/cpu_traits.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/cpu_traits.h new file mode 100644 index 0000000000..0483d6918f --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/cpu_traits.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___PSTL_CPU_ALGOS_CPU_TRAITS_H +#define _LIBCPP___PSTL_CPU_ALGOS_CPU_TRAITS_H + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +// __cpu_traits +// +// This traits class encapsulates the basis operations for a CPU-based implementation of the PSTL. +// All the operations in the PSTL can be implemented from these basis operations, so a pure CPU backend +// only needs to customize these traits in order to get an implementation of the whole PSTL. +// +// Basis operations +// ================ +// +// template <class _RandomAccessIterator, class _Functor> +// optional<__empty> __for_each(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func); +// - __func must take a subrange of [__first, __last) that should be executed in serial +// +// template <class _Iterator, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduction> +// optional<_Tp> __transform_reduce(_Iterator __first, _Iterator __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduction); +// +// template <class _RandomAccessIterator1, +// class _RandomAccessIterator2, +// class _RandomAccessIterator3, +// class _Compare, +// class _LeafMerge> +// optional<_RandomAccessIterator3> __merge(_RandomAccessIterator1 __first1, +// _RandomAccessIterator1 __last1, +// _RandomAccessIterator2 __first2, +// _RandomAccessIterator2 __last2, +// _RandomAccessIterator3 __outit, +// _Compare __comp, +// _LeafMerge __leaf_merge); +// +// template <class _RandomAccessIterator, class _Comp, class _LeafSort> +// optional<__empty> __stable_sort(_RandomAccessIterator __first, +// _RandomAccessIterator __last, +// _Comp __comp, +// _LeafSort __leaf_sort); +// +// void __cancel_execution(); +// Cancel the execution of other jobs - they aren't needed anymore. This is not a binding request, +// some backends may not actually be able to cancel jobs. +// +// constexpr size_t __lane_size; +// Size of SIMD lanes. +// TODO: Merge this with __native_vector_size from __algorithm/simd_utils.h +// +// +// Exception handling +// ================== +// +// CPU backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from their +// implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions are +// turned into a program termination at the front-end level. When a backend returns a disengaged `optional` to the +// frontend, the frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to +// the user. + +template <class _Backend> +struct __cpu_traits; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_CPU_ALGOS_CPU_TRAITS_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/fill.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/fill.h new file mode 100644 index 0000000000..4e6d29b30c --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/fill.h @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_CPU_ALGOS_FILL_H +#define _LIBCPP___PSTL_CPU_ALGOS_FILL_H + +#include <__algorithm/fill.h> +#include <__assert> +#include <__config> +#include <__iterator/concepts.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/empty.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _Index, class _DifferenceType, class _Tp> +_LIBCPP_HIDE_FROM_ABI _Index __simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept { + _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED + _PSTL_PRAGMA_SIMD + for (_DifferenceType __i = 0; __i < __n; ++__i) + __first[__i] = __value; + return __first + __n; +} + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_fill { + template <class _Policy, class _ForwardIterator, class _Tp> + _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __cpu_traits<_Backend>::__for_each( + __first, __last, [&__policy, &__value](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { + using _FillUnseq = __pstl::__fill<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + [[maybe_unused]] auto __res = + _FillUnseq()(std::__remove_parallel_policy(__policy), __brick_first, __brick_last, __value); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + }); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + __pstl::__simd_fill_n(__first, __last - __first, __value); + return __empty{}; + } else { + std::fill(__first, __last, __value); + return __empty{}; + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___PSTL_CPU_ALGOS_FILL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/find_if.h index 170470e4fb..12b2e88971 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/find_if.h @@ -6,16 +6,18 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H -#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H +#ifndef _LIBCPP___PSTL_CPU_ALGOS_FIND_IF_H +#define _LIBCPP___PSTL_CPU_ALGOS_FIND_IF_H #include <__algorithm/find_if.h> -#include <__algorithm/pstl_backends/cpu_backends/backend.h> +#include <__assert> #include <__atomic/atomic.h> #include <__config> #include <__functional/operations.h> #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> #include <__type_traits/is_execution_policy.h> #include <__utility/move.h> #include <__utility/pair.h> @@ -26,14 +28,13 @@ # pragma GCC system_header #endif -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - _LIBCPP_PUSH_MACROS -# include <__undef_macros> +#include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { -template <class _Index, class _Brick, class _Compare> +template <class _Backend, class _Index, class _Brick, class _Compare> _LIBCPP_HIDE_FROM_ABI optional<_Index> __parallel_find(_Index __first, _Index __last, _Brick __f, _Compare __comp, bool __b_first) { typedef typename std::iterator_traits<_Index>::difference_type _DifferenceType; @@ -42,7 +43,7 @@ __parallel_find(_Index __first, _Index __last, _Brick __f, _Compare __comp, bool std::atomic<_DifferenceType> __extremum(__initial_dist); // TODO: find out what is better here: parallel_for or parallel_reduce auto __res = - __par_backend::__parallel_for(__first, __last, [__comp, __f, __first, &__extremum](_Index __i, _Index __j) { + __cpu_traits<_Backend>::__for_each(__first, __last, [__comp, __f, __first, &__extremum](_Index __i, _Index __j) { // See "Reducing Contention Through Priority Updates", PPoPP '13, for discussion of // why using a shared variable scales fairly well in this situation. if (__comp(__i - __first, __extremum)) { @@ -61,12 +62,12 @@ __parallel_find(_Index __first, _Index __last, _Brick __f, _Compare __comp, bool return __extremum.load() != __initial_dist ? __first + __extremum.load() : __last; } -template <class _Index, class _DifferenceType, class _Compare> +template <class _Backend, class _Index, class _DifferenceType, class _Compare> _LIBCPP_HIDE_FROM_ABI _Index __simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp) noexcept { // Experiments show good block sizes like this - const _DifferenceType __block_size = 8; - alignas(__lane_size) _DifferenceType __lane[__block_size] = {0}; + const _DifferenceType __block_size = 8; + alignas(__cpu_traits<_Backend>::__lane_size) _DifferenceType __lane[__block_size] = {0}; while (__end - __begin >= __block_size) { _DifferenceType __found = 0; _PSTL_PRAGMA_SIMD_REDUCTION(| : __found) for (_DifferenceType __i = __begin; __i < __begin + __block_size; ++__i) { @@ -97,37 +98,40 @@ __simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Co return __first + __end; } -template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate> -_LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator> -__pstl_find_if(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { - if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - return std::__parallel_find( - __first, - __last, - [&__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { - auto __res = std::__pstl_find_if<__remove_parallel_policy_t<_ExecutionPolicy>>( - __cpu_backend_tag{}, __brick_first, __brick_last, __pred); - _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); - return *std::move(__res); - }, - less<>{}, - true); - } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> && - __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { - using __diff_t = __iter_diff_t<_ForwardIterator>; - return std::__simd_first(__first, __diff_t(0), __last - __first, [&__pred](_ForwardIterator __iter, __diff_t __i) { - return __pred(__iter[__i]); - }); - } else { - return std::find_if(__first, __last, __pred); +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_find_if { + template <class _Policy, class _ForwardIterator, class _Predicate> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __pstl::__parallel_find<_Backend>( + __first, + __last, + [&__policy, &__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { + using _FindIfUnseq = __pstl::__find_if<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + auto __res = _FindIfUnseq()(std::__remove_parallel_policy(__policy), __brick_first, __brick_last, __pred); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + return *std::move(__res); + }, + less<>{}, + true); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + using __diff_t = __iter_diff_t<_ForwardIterator>; + return __pstl::__simd_first<_Backend>( + __first, __diff_t(0), __last - __first, [&__pred](_ForwardIterator __iter, __diff_t __i) { + return __pred(__iter[__i]); + }); + } else { + return std::find_if(__first, __last, __pred); + } } -} +}; +} // namespace __pstl _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 - -#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H +#endif // _LIBCPP___PSTL_CPU_ALGOS_FIND_IF_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/for_each.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/for_each.h new file mode 100644 index 0000000000..d4d7862135 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/for_each.h @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_CPU_ALGOS_FOR_EACH_H +#define _LIBCPP___PSTL_CPU_ALGOS_FOR_EACH_H + +#include <__algorithm/for_each.h> +#include <__assert> +#include <__config> +#include <__iterator/concepts.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/empty.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _Iterator, class _DifferenceType, class _Function> +_LIBCPP_HIDE_FROM_ABI _Iterator __simd_for_each(_Iterator __first, _DifferenceType __n, _Function __f) noexcept { + _PSTL_PRAGMA_SIMD + for (_DifferenceType __i = 0; __i < __n; ++__i) + __f(__first[__i]); + + return __first + __n; +} + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_for_each { + template <class _Policy, class _ForwardIterator, class _Function> + _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Function __func) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __cpu_traits<_Backend>::__for_each( + __first, __last, [&__policy, __func](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { + using _ForEachUnseq = __pstl::__for_each<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + [[maybe_unused]] auto __res = + _ForEachUnseq()(std::__remove_parallel_policy(__policy), __brick_first, __brick_last, __func); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + }); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + __pstl::__simd_for_each(__first, __last - __first, __func); + return __empty{}; + } else { + std::for_each(__first, __last, __func); + return __empty{}; + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___PSTL_CPU_ALGOS_FOR_EACH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/merge.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/merge.h new file mode 100644 index 0000000000..dfa4cbf69b --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/merge.h @@ -0,0 +1,85 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_CPU_ALGOS_MERGE_H +#define _LIBCPP___PSTL_CPU_ALGOS_MERGE_H + +#include <__algorithm/merge.h> +#include <__assert> +#include <__config> +#include <__iterator/concepts.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/move.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_merge { + template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> operator()( + _Policy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, + _ForwardOutIterator __result, + _Comp __comp) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && + __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && + __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { + auto __res = __cpu_traits<_Backend>::__merge( + __first1, + __last1, + __first2, + __last2, + __result, + __comp, + [&__policy](_ForwardIterator1 __g_first1, + _ForwardIterator1 __g_last1, + _ForwardIterator2 __g_first2, + _ForwardIterator2 __g_last2, + _ForwardOutIterator __g_result, + _Comp __g_comp) { + using _MergeUnseq = __pstl::__merge<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + [[maybe_unused]] auto __g_res = _MergeUnseq()( + std::__remove_parallel_policy(__policy), + std::move(__g_first1), + std::move(__g_last1), + std::move(__g_first2), + std::move(__g_last2), + std::move(__g_result), + std::move(__g_comp)); + _LIBCPP_ASSERT_INTERNAL(__g_res, "unsed/sed should never try to allocate!"); + }); + if (!__res) + return nullopt; + return __result + (__last1 - __first1) + (__last2 - __first2); + } else { + return std::merge(__first1, __last1, __first2, __last2, __result, __comp); + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_CPU_ALGOS_MERGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/stable_sort.h new file mode 100644 index 0000000000..8e64f3e537 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/stable_sort.h @@ -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 +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___PSTL_CPU_ALGOS_STABLE_SORT_H +#define _LIBCPP___PSTL_CPU_ALGOS_STABLE_SORT_H + +#include <__algorithm/stable_sort.h> +#include <__config> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/empty.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_stable_sort { + template <class _Policy, class _RandomAccessIterator, class _Comp> + _LIBCPP_HIDE_FROM_ABI optional<__empty> + operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy>) { + return __cpu_traits<_Backend>::__stable_sort( + __first, __last, __comp, [](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) { + std::stable_sort(__g_first, __g_last, __g_comp); + }); + } else { + std::stable_sort(__first, __last, __comp); + return __empty{}; + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___PSTL_CPU_ALGOS_STABLE_SORT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform.h new file mode 100644 index 0000000000..27ce8e27b2 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform.h @@ -0,0 +1,153 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_CPU_ALGOS_TRANSFORM_H +#define _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_H + +#include <__algorithm/transform.h> +#include <__assert> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/move.h> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function> +_LIBCPP_HIDE_FROM_ABI _Iterator2 +__simd_transform(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept { + _PSTL_PRAGMA_SIMD + for (_DifferenceType __i = 0; __i < __n; ++__i) + __f(__first1[__i], __first2[__i]); + return __first2 + __n; +} + +template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function> +_LIBCPP_HIDE_FROM_ABI _Iterator3 __simd_transform( + _Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept { + _PSTL_PRAGMA_SIMD + for (_DifferenceType __i = 0; __i < __n; ++__i) + __f(__first1[__i], __first2[__i], __first3[__i]); + return __first3 + __n; +} + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_transform { + template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _ForwardOutIterator __result, + _UnaryOperation __op) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value && + __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { + __cpu_traits<_Backend>::__for_each( + __first, + __last, + [&__policy, __op, __first, __result](_ForwardIterator __brick_first, _ForwardIterator __brick_last) { + using _TransformUnseq = __pstl::__transform<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + auto __res = _TransformUnseq()( + std::__remove_parallel_policy(__policy), + __brick_first, + __brick_last, + __result + (__brick_first - __first), + __op); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + return *std::move(__res); + }); + return __result + (__last - __first); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value && + __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { + return __pstl::__simd_transform( + __first, + __last - __first, + __result, + [&](__iter_reference<_ForwardIterator> __in_value, __iter_reference<_ForwardOutIterator> __out_value) { + __out_value = __op(__in_value); + }); + } else { + return std::transform(__first, __last, __result, __op); + } + } +}; + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_transform_binary { + template <class _Policy, + class _ForwardIterator1, + class _ForwardIterator2, + class _ForwardOutIterator, + class _BinaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_ForwardOutIterator> + operator()(_Policy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardOutIterator __result, + _BinaryOperation __op) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && + __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && + __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { + auto __res = __cpu_traits<_Backend>::__for_each( + __first1, + __last1, + [&__policy, __op, __first1, __first2, __result]( + _ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last) { + using _TransformBinaryUnseq = + __pstl::__transform_binary<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + return _TransformBinaryUnseq()( + std::__remove_parallel_policy(__policy), + __brick_first, + __brick_last, + __first2 + (__brick_first - __first1), + __result + (__brick_first - __first1), + __op); + }); + if (!__res) + return nullopt; + return __result + (__last1 - __first1); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && + __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value && + __has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) { + return __pstl::__simd_transform( + __first1, + __last1 - __first1, + __first2, + __result, + [&](__iter_reference<_ForwardIterator1> __in1, + __iter_reference<_ForwardIterator2> __in2, + __iter_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in1, __in2); }); + } else { + return std::transform(__first1, __last1, __first2, __result, __op); + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform_reduce.h new file mode 100644 index 0000000000..36ac1a9072 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/cpu_algos/transform_reduce.h @@ -0,0 +1,216 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_CPU_ALGOS_TRANSFORM_REDUCE_H +#define _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_REDUCE_H + +#include <__assert> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__numeric/transform_reduce.h> +#include <__pstl/backend_fwd.h> +#include <__pstl/cpu_algos/cpu_traits.h> +#include <__type_traits/desugars_to.h> +#include <__type_traits/is_arithmetic.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/move.h> +#include <cstddef> +#include <new> +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <typename _Backend, + typename _DifferenceType, + typename _Tp, + typename _BinaryOperation, + typename _UnaryOperation, + typename _UnaryResult = invoke_result_t<_UnaryOperation, _DifferenceType>, + __enable_if_t<__desugars_to_v<__plus_tag, _BinaryOperation, _Tp, _UnaryResult> && is_arithmetic_v<_Tp> && + is_arithmetic_v<_UnaryResult>, + int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp +__simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept { + _PSTL_PRAGMA_SIMD_REDUCTION(+ : __init) + for (_DifferenceType __i = 0; __i < __n; ++__i) + __init += __f(__i); + return __init; +} + +template <typename _Backend, + typename _Size, + typename _Tp, + typename _BinaryOperation, + typename _UnaryOperation, + typename _UnaryResult = invoke_result_t<_UnaryOperation, _Size>, + __enable_if_t<!(__desugars_to_v<__plus_tag, _BinaryOperation, _Tp, _UnaryResult> && is_arithmetic_v<_Tp> && + is_arithmetic_v<_UnaryResult>), + int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp +__simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept { + constexpr size_t __lane_size = __cpu_traits<_Backend>::__lane_size; + const _Size __block_size = __lane_size / sizeof(_Tp); + if (__n > 2 * __block_size && __block_size > 1) { + alignas(__lane_size) char __lane_buffer[__lane_size]; + _Tp* __lane = reinterpret_cast<_Tp*>(__lane_buffer); + + // initializer + _PSTL_PRAGMA_SIMD + for (_Size __i = 0; __i < __block_size; ++__i) { + ::new (__lane + __i) _Tp(__binary_op(__f(__i), __f(__block_size + __i))); + } + // main loop + _Size __i = 2 * __block_size; + const _Size __last_iteration = __block_size * (__n / __block_size); + for (; __i < __last_iteration; __i += __block_size) { + _PSTL_PRAGMA_SIMD + for (_Size __j = 0; __j < __block_size; ++__j) { + __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__i + __j)); + } + } + // remainder + _PSTL_PRAGMA_SIMD + for (_Size __j = 0; __j < __n - __last_iteration; ++__j) { + __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__last_iteration + __j)); + } + // combiner + for (_Size __j = 0; __j < __block_size; ++__j) { + __init = __binary_op(std::move(__init), std::move(__lane[__j])); + } + // destroyer + _PSTL_PRAGMA_SIMD + for (_Size __j = 0; __j < __block_size; ++__j) { + __lane[__j].~_Tp(); + } + } else { + for (_Size __i = 0; __i < __n; ++__i) { + __init = __binary_op(std::move(__init), __f(__i)); + } + } + return __init; +} + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_transform_reduce_binary { + template <class _Policy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + class _BinaryOperation1, + class _BinaryOperation2> + _LIBCPP_HIDE_FROM_ABI optional<_Tp> operator()( + _Policy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init, + _BinaryOperation1 __reduce, + _BinaryOperation2 __transform) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && + __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) { + return __cpu_traits<_Backend>::__transform_reduce( + __first1, + std::move(__last1), + [__first1, __first2, __transform](_ForwardIterator1 __iter) { + return __transform(*__iter, *(__first2 + (__iter - __first1))); + }, + std::move(__init), + std::move(__reduce), + [&__policy, __first1, __first2, __reduce, __transform]( + _ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last, _Tp __brick_init) { + using _TransformReduceBinaryUnseq = + __pstl::__transform_reduce_binary<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + return *_TransformReduceBinaryUnseq()( + std::__remove_parallel_policy(__policy), + __brick_first, + std::move(__brick_last), + __first2 + (__brick_first - __first1), + std::move(__brick_init), + std::move(__reduce), + std::move(__transform)); + }); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator1>::value && + __has_random_access_iterator_category_or_concept<_ForwardIterator2>::value) { + return __pstl::__simd_transform_reduce<_Backend>( + __last1 - __first1, std::move(__init), std::move(__reduce), [&](__iter_diff_t<_ForwardIterator1> __i) { + return __transform(__first1[__i], __first2[__i]); + }); + } else { + return std::transform_reduce( + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__init), + std::move(__reduce), + std::move(__transform)); + } + } +}; + +template <class _Backend, class _RawExecutionPolicy> +struct __cpu_parallel_transform_reduce { + template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation> + _LIBCPP_HIDE_FROM_ABI optional<_Tp> + operator()(_Policy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _Tp __init, + _BinaryOperation __reduce, + _UnaryOperation __transform) const noexcept { + if constexpr (__is_parallel_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __cpu_traits<_Backend>::__transform_reduce( + std::move(__first), + std::move(__last), + [__transform](_ForwardIterator __iter) { return __transform(*__iter); }, + std::move(__init), + __reduce, + [&__policy, __transform, __reduce](auto __brick_first, auto __brick_last, _Tp __brick_init) { + using _TransformReduceUnseq = + __pstl::__transform_reduce<_Backend, __remove_parallel_policy_t<_RawExecutionPolicy>>; + auto __res = _TransformReduceUnseq()( + std::__remove_parallel_policy(__policy), + std::move(__brick_first), + std::move(__brick_last), + std::move(__brick_init), + std::move(__reduce), + std::move(__transform)); + _LIBCPP_ASSERT_INTERNAL(__res, "unseq/seq should never try to allocate!"); + return *std::move(__res); + }); + } else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> && + __has_random_access_iterator_category_or_concept<_ForwardIterator>::value) { + return __pstl::__simd_transform_reduce<_Backend>( + __last - __first, + std::move(__init), + std::move(__reduce), + [=, &__transform](__iter_diff_t<_ForwardIterator> __i) { return __transform(__first[__i]); }); + } else { + return std::transform_reduce( + std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform)); + } + } +}; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/dispatch.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/dispatch.h new file mode 100644 index 0000000000..5e903f7524 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/dispatch.h @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// 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___PSTL_DISPATCH_H +#define _LIBCPP___PSTL_DISPATCH_H + +#include <__config> +#include <__pstl/backend_fwd.h> +#include <__type_traits/conditional.h> +#include <__type_traits/enable_if.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/type_identity.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <template <class, class> class _Algorithm, class _Backend, class _ExecutionPolicy, class = void> +constexpr bool __is_implemented_v = false; + +template <template <class, class> class _Algorithm, class _Backend, class _ExecutionPolicy> +constexpr bool __is_implemented_v<_Algorithm, + _Backend, + _ExecutionPolicy, + __enable_if_t<sizeof(_Algorithm<_Backend, _ExecutionPolicy>)>> = true; + +// Helpful to provide better error messages. This will show the algorithm and the execution policy +// in the compiler diagnostic. +template <template <class, class> class _Algorithm, class _ExecutionPolicy> +constexpr bool __cant_find_backend_for = false; + +template <template <class, class> class _Algorithm, class _BackendConfiguration, class _ExecutionPolicy> +struct __find_first_implemented; + +template <template <class, class> class _Algorithm, class _ExecutionPolicy> +struct __find_first_implemented<_Algorithm, __backend_configuration<>, _ExecutionPolicy> { + static_assert(__cant_find_backend_for<_Algorithm, _ExecutionPolicy>, + "Could not find a PSTL backend for the given algorithm and execution policy"); +}; + +template <template <class, class> class _Algorithm, class _B1, class... _Bn, class _ExecutionPolicy> +struct __find_first_implemented<_Algorithm, __backend_configuration<_B1, _Bn...>, _ExecutionPolicy> + : _If<__is_implemented_v<_Algorithm, _B1, _ExecutionPolicy>, + __type_identity<_Algorithm<_B1, _ExecutionPolicy>>, + __find_first_implemented<_Algorithm, __backend_configuration<_Bn...>, _ExecutionPolicy> > {}; + +template <template <class, class> class _Algorithm, class _BackendConfiguration, class _ExecutionPolicy> +using __dispatch = typename __find_first_implemented<_Algorithm, _BackendConfiguration, _ExecutionPolicy>::type; + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_DISPATCH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__pstl/handle_exception.h b/contrib/libs/cxxsupp/libcxx/include/__pstl/handle_exception.h new file mode 100644 index 0000000000..d6270958c3 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__pstl/handle_exception.h @@ -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 +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___PSTL_HANDLE_EXCEPTION_H +#define _LIBCPP___PSTL_HANDLE_EXCEPTION_H + +#include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <new> // __throw_bad_alloc +#include <optional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD +namespace __pstl { + +template <class _BackendFunction, class... _Args> +_LIBCPP_HIDE_FROM_ABI auto __handle_exception_impl(_Args&&... __args) noexcept { + return _BackendFunction{}(std::forward<_Args>(__args)...); +} + +// This function is used to call a backend PSTL algorithm from a frontend algorithm. +// +// All PSTL backend algorithms return an optional denoting whether there was an +// "infrastructure"-level failure (aka failure to allocate). This function takes +// care of unwrapping that and throwing `bad_alloc()` in case there was a problem +// in the underlying implementation. +// +// We must also be careful not to call any user code that could throw an exception +// (such as moving or copying iterators) in here since that should terminate the +// program, which is why we delegate to a noexcept helper below. +template <class _BackendFunction, class... _Args> +_LIBCPP_HIDE_FROM_ABI auto __handle_exception(_Args&&... __args) { + auto __result = __pstl::__handle_exception_impl<_BackendFunction>(std::forward<_Args>(__args)...); + if (__result == nullopt) + std::__throw_bad_alloc(); + else + return std::move(*__result); +} + +} // namespace __pstl +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___PSTL_HANDLE_EXCEPTION_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h index 9279fb66f6..07f5990672 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h +++ b/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h @@ -50,8 +50,8 @@ public: static const result_type _Min = _Engine::_Min; static const result_type _Max = _Engine::_Max; #else - static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min(); - static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max(); + static constexpr result_type _Min = _Engine::min(); + static constexpr result_type _Max = _Engine::max(); #endif _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h index fe9cb909b7..9d77649e9c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h +++ b/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h @@ -26,32 +26,60 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD +enum __lce_alg_type { + _LCE_Full, + _LCE_Part, + _LCE_Schrage, + _LCE_Promote, +}; + template <unsigned long long __a, unsigned long long __c, unsigned long long __m, unsigned long long _Mp, - bool _MightOverflow = (__a != 0 && __m != 0 && __m - 1 > (_Mp - __c) / __a), - bool _OverflowOK = ((__m & (__m - 1)) == 0ull), // m = 2^n - bool _SchrageOK = (__a != 0 && __m != 0 && __m % __a <= __m / __a)> // r <= q + bool _HasOverflow = (__a != 0ull && (__m & (__m - 1ull)) != 0ull), // a != 0, m != 0, m != 2^n + bool _Full = (!_HasOverflow || __m - 1ull <= (_Mp - __c) / __a), // (a * x + c) % m works + bool _Part = (!_HasOverflow || __m - 1ull <= _Mp / __a), // (a * x) % m works + bool _Schrage = (_HasOverflow && __m % __a <= __m / __a)> // r <= q struct __lce_alg_picker { - static_assert(!_MightOverflow || _OverflowOK || _SchrageOK, - "The current values of a, c, and m cannot generate a number " - "within bounds of linear_congruential_engine."); - - static _LIBCPP_CONSTEXPR const bool __use_schrage = _MightOverflow && !_OverflowOK && _SchrageOK; + static _LIBCPP_CONSTEXPR const __lce_alg_type __mode = + _Full ? _LCE_Full + : _Part ? _LCE_Part + : _Schrage ? _LCE_Schrage + : _LCE_Promote; + +#ifdef _LIBCPP_HAS_NO_INT128 + static_assert(_Mp != (unsigned long long)(-1) || _Full || _Part || _Schrage, + "The current values for a, c, and m are not currently supported on platforms without __int128"); +#endif }; template <unsigned long long __a, unsigned long long __c, unsigned long long __m, unsigned long long _Mp, - bool _UseSchrage = __lce_alg_picker<__a, __c, __m, _Mp>::__use_schrage> + __lce_alg_type _Mode = __lce_alg_picker<__a, __c, __m, _Mp>::__mode> struct __lce_ta; // 64 +#ifndef _LIBCPP_HAS_NO_INT128 +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, (unsigned long long)(-1), _LCE_Promote> { + typedef unsigned long long result_type; + _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __xp) { + __extension__ using __calc_type = unsigned __int128; + const __calc_type __a = static_cast<__calc_type>(_Ap); + const __calc_type __c = static_cast<__calc_type>(_Cp); + const __calc_type __m = static_cast<__calc_type>(_Mp); + const __calc_type __x = static_cast<__calc_type>(__xp); + return static_cast<result_type>((__a * __x + __c) % __m); + } +}; +#endif + template <unsigned long long __a, unsigned long long __c, unsigned long long __m> -struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), true> { +struct __lce_ta<__a, __c, __m, (unsigned long long)(-1), _LCE_Schrage> { typedef unsigned long long result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { // Schrage's algorithm @@ -66,7 +94,7 @@ struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), true> { }; template <unsigned long long __a, unsigned long long __m> -struct __lce_ta<__a, 0, __m, (unsigned long long)(~0), true> { +struct __lce_ta<__a, 0ull, __m, (unsigned long long)(-1), _LCE_Schrage> { typedef unsigned long long result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { // Schrage's algorithm @@ -80,21 +108,40 @@ struct __lce_ta<__a, 0, __m, (unsigned long long)(~0), true> { }; template <unsigned long long __a, unsigned long long __c, unsigned long long __m> -struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), false> { +struct __lce_ta<__a, __c, __m, (unsigned long long)(-1), _LCE_Part> { + typedef unsigned long long result_type; + _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { + // Use (((a*x) % m) + c) % m + __x = (__a * __x) % __m; + __x += __c - (__x >= __m - __c) * __m; + return __x; + } +}; + +template <unsigned long long __a, unsigned long long __c, unsigned long long __m> +struct __lce_ta<__a, __c, __m, (unsigned long long)(-1), _LCE_Full> { typedef unsigned long long result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { return (__a * __x + __c) % __m; } }; template <unsigned long long __a, unsigned long long __c> -struct __lce_ta<__a, __c, 0, (unsigned long long)(~0), false> { +struct __lce_ta<__a, __c, 0ull, (unsigned long long)(-1), _LCE_Full> { typedef unsigned long long result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { return __a * __x + __c; } }; // 32 +template <unsigned long long __a, unsigned long long __c, unsigned long long __m> +struct __lce_ta<__a, __c, __m, unsigned(-1), _LCE_Promote> { + typedef unsigned result_type; + _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { + return static_cast<result_type>(__lce_ta<__a, __c, __m, (unsigned long long)(-1)>::next(__x)); + } +}; + template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> -struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), true> { +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(-1), _LCE_Schrage> { typedef unsigned result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { const result_type __a = static_cast<result_type>(_Ap); @@ -112,7 +159,7 @@ struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), true> { }; template <unsigned long long _Ap, unsigned long long _Mp> -struct __lce_ta<_Ap, 0, _Mp, unsigned(~0), true> { +struct __lce_ta<_Ap, 0ull, _Mp, unsigned(-1), _LCE_Schrage> { typedef unsigned result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { const result_type __a = static_cast<result_type>(_Ap); @@ -128,7 +175,21 @@ struct __lce_ta<_Ap, 0, _Mp, unsigned(~0), true> { }; template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> -struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), false> { +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(-1), _LCE_Part> { + typedef unsigned result_type; + _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + const result_type __m = static_cast<result_type>(_Mp); + // Use (((a*x) % m) + c) % m + __x = (__a * __x) % __m; + __x += __c - (__x >= __m - __c) * __m; + return __x; + } +}; + +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(-1), _LCE_Full> { typedef unsigned result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { const result_type __a = static_cast<result_type>(_Ap); @@ -139,7 +200,7 @@ struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), false> { }; template <unsigned long long _Ap, unsigned long long _Cp> -struct __lce_ta<_Ap, _Cp, 0, unsigned(~0), false> { +struct __lce_ta<_Ap, _Cp, 0ull, unsigned(-1), _LCE_Full> { typedef unsigned result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { const result_type __a = static_cast<result_type>(_Ap); @@ -150,11 +211,11 @@ struct __lce_ta<_Ap, _Cp, 0, unsigned(~0), false> { // 16 -template <unsigned long long __a, unsigned long long __c, unsigned long long __m, bool __b> -struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b> { +template <unsigned long long __a, unsigned long long __c, unsigned long long __m, __lce_alg_type __mode> +struct __lce_ta<__a, __c, __m, (unsigned short)(-1), __mode> { typedef unsigned short result_type; _LIBCPP_HIDE_FROM_ABI static result_type next(result_type __x) { - return static_cast<result_type>(__lce_ta<__a, __c, __m, unsigned(~0)>::next(__x)); + return static_cast<result_type>(__lce_ta<__a, __c, __m, unsigned(-1)>::next(__x)); } }; @@ -178,7 +239,7 @@ public: private: result_type __x_; - static _LIBCPP_CONSTEXPR const result_type _Mp = result_type(~0); + static _LIBCPP_CONSTEXPR const result_type _Mp = result_type(-1); static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters"); static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters"); diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h b/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h index 7e9888768e..5cf84aeb8a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h +++ b/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h @@ -14,6 +14,7 @@ #include <__algorithm/max.h> #include <__config> #include <__iterator/iterator_traits.h> +#include <__type_traits/is_unsigned.h> #include <cstdint> #include <initializer_list> #include <vector> @@ -79,6 +80,11 @@ void seed_seq::__init(_InputIterator __first, _InputIterator __last) { template <class _RandomAccessIterator> void seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) { + using _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type; + static_assert(is_unsigned<_ValueType>::value && sizeof(_ValueType) >= sizeof(uint32_t), + "[rand.util.seedseq]/7 requires the value_type of the iterator to be an unsigned " + "integer capable of accommodating 32-bit quantities."); + if (__first != __last) { std::fill(__first, __last, 0x8b8b8b8b); const size_t __n = static_cast<size_t>(__last - __first); diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h index 3db4f11b40..c0a40c5e10 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h @@ -191,9 +191,8 @@ struct __fn { template <class _Tp> requires is_rvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::end(static_cast<const _Tp&&>(__t)))) - -> decltype(ranges::end(static_cast<const _Tp&&>(__t))) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept( + noexcept(ranges::end(static_cast<const _Tp&&>(__t)))) -> decltype(ranges::end(static_cast<const _Tp&&>(__t))) { return ranges::end(static_cast<const _Tp&&>(__t)); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h index b735bdc716..023cee6caa 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h @@ -39,9 +39,8 @@ namespace __all { struct __fn : __range_adaptor_closure<__fn> { template <class _Tp> requires ranges::view<decay_t<_Tp>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))) - -> decltype(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t))) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept( + noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))) -> decltype(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t))) { return _LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h index 2fc272e798..5849a6c368 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h @@ -111,7 +111,7 @@ namespace views { namespace __as_rvalue { struct __fn : __range_adaptor_closure<__fn> { template <class _Range> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range) noexcept(noexcept(as_rvalue_view(std::forward<_Range>(__range)))) -> decltype(/*--------------------------*/ as_rvalue_view(std::forward<_Range>(__range))) { return /*---------------------------------*/ as_rvalue_view(std::forward<_Range>(__range)); @@ -119,7 +119,7 @@ struct __fn : __range_adaptor_closure<__fn> { template <class _Range> requires same_as<range_rvalue_reference_t<_Range>, range_reference_t<_Range>> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range) noexcept(noexcept(views::all(std::forward<_Range>(__range)))) -> decltype(/*--------------------------*/ views::all(std::forward<_Range>(__range))) { return /*---------------------------------*/ views::all(std::forward<_Range>(__range)); diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/chunk_by_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/chunk_by_view.h index b04a23de99..00014d9f10 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/chunk_by_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/chunk_by_view.h @@ -205,7 +205,7 @@ namespace views { namespace __chunk_by { struct __fn { template <class _Range, class _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Pred&& __pred) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Pred&& __pred) const noexcept(noexcept(/**/ chunk_by_view(std::forward<_Range>(__range), std::forward<_Pred>(__pred)))) -> decltype(/*--*/ chunk_by_view(std::forward<_Range>(__range), std::forward<_Pred>(__pred))) { return /*-------------*/ chunk_by_view(std::forward<_Range>(__range), std::forward<_Pred>(__pred)); @@ -213,7 +213,7 @@ struct __fn { template <class _Pred> requires constructible_from<decay_t<_Pred>, _Pred> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Pred&& __pred) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Pred&& __pred) const noexcept(is_nothrow_constructible_v<decay_t<_Pred>, _Pred>) { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Pred>(__pred))); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h index 4b5b04c989..133236dd1d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h @@ -114,16 +114,14 @@ namespace __common { struct __fn : __range_adaptor_closure<__fn> { template <class _Range> requires common_range<_Range> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(views::all(std::forward<_Range>(__range)))) - -> decltype(views::all(std::forward<_Range>(__range))) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const noexcept( + noexcept(views::all(std::forward<_Range>(__range)))) -> decltype(views::all(std::forward<_Range>(__range))) { return views::all(std::forward<_Range>(__range)); } template <class _Range> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(common_view{std::forward<_Range>(__range)})) - -> decltype(common_view{std::forward<_Range>(__range)}) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const noexcept(noexcept(common_view{ + std::forward<_Range>(__range)})) -> decltype(common_view{std::forward<_Range>(__range)}) { return common_view{std::forward<_Range>(__range)}; } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h index 83d76f8fd2..e365deca4e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h @@ -51,9 +51,8 @@ struct __fn { } template <random_access_iterator _It> - _LIBCPP_HIDE_FROM_ABI static constexpr auto - __go(_It __it, iter_difference_t<_It> __count) noexcept(noexcept(subrange(__it, __it + __count))) - -> decltype(subrange(__it, __it + __count)) { + _LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_It __it, iter_difference_t<_It> __count) noexcept( + noexcept(subrange(__it, __it + __count))) -> decltype(subrange(__it, __it + __count)) { return subrange(__it, __it + __count); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h index 131f6cdad8..50db3cffee 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h @@ -83,9 +83,8 @@ struct __fn { template <class _Tp> requires is_rvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::data(static_cast<const _Tp&&>(__t)))) - -> decltype(ranges::data(static_cast<const _Tp&&>(__t))) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept( + noexcept(ranges::data(static_cast<const _Tp&&>(__t)))) -> decltype(ranges::data(static_cast<const _Tp&&>(__t))) { return ranges::data(static_cast<const _Tp&&>(__t)); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h index 83bb598b0a..853e22a402 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h @@ -266,7 +266,7 @@ struct __fn { class _RawRange = remove_cvref_t<_Range>, class _Dist = range_difference_t<_Range>> requires (__is_repeat_specialization<_RawRange> && sized_range<_RawRange>) - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const noexcept(noexcept(views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))))) -> decltype( views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n)))) { return views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))); } @@ -277,7 +277,7 @@ struct __fn { class _RawRange = remove_cvref_t<_Range>, class _Dist = range_difference_t<_Range>> requires (__is_repeat_specialization<_RawRange> && !sized_range<_RawRange>) - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&&) const noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Range>(__range)))) -> decltype( _LIBCPP_AUTO_CAST(std::forward<_Range>(__range))) @@ -289,14 +289,14 @@ struct __fn { template <class _Range, convertible_to<range_difference_t<_Range>> _Np, class _RawRange = remove_cvref_t<_Range>> // Note: without specifically excluding the other cases, GCC sees this overload as ambiguous with the other // overloads. - requires( - !(__is_empty_view<_RawRange> || + requires(!(__is_empty_view<_RawRange> || # if _LIBCPP_STD_VER >= 23 - __is_repeat_specialization<_RawRange> || + __is_repeat_specialization<_RawRange> || # endif - (__is_subrange_specialization_with_store_size<_RawRange> && sized_range<_RawRange> && - random_access_range<_RawRange>) || - (__is_passthrough_specialization<_RawRange> && sized_range<_RawRange> && random_access_range<_RawRange>))) + (__is_subrange_specialization_with_store_size<_RawRange> && sized_range<_RawRange> && + random_access_range<_RawRange>) || + (__is_passthrough_specialization<_RawRange> && sized_range<_RawRange> && + random_access_range<_RawRange>))) [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const noexcept(noexcept(drop_view(std::forward<_Range>(__range), std::forward<_Np>(__n)))) -> decltype(drop_view(std::forward<_Range>(__range), std::forward<_Np>(__n))) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h index 9e6f724241..c0f5ed936a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h @@ -22,7 +22,6 @@ #include <__concepts/semiregular.h> #include <__concepts/totally_ordered.h> #include <__config> -#include <__functional/ranges_operations.h> #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> @@ -313,8 +312,8 @@ public: : __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) { // Validate the precondition if possible. if constexpr (totally_ordered_with<_Start, _BoundSentinel>) { - _LIBCPP_ASSERT_UNCATEGORIZED( - ranges::less_equal()(__value_, __bound_sentinel_), "Precondition violated: value is greater than bound."); + _LIBCPP_ASSERT_VALID_INPUT_RANGE( + bool(__value_ <= __bound_sentinel_), "iota_view: bound must be reachable from value"); } } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h index 6aedfdabff..db031fe5f8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h @@ -403,8 +403,8 @@ template <class _Range, class _Pattern> lazy_split_view(_Range&&, _Pattern&&) -> lazy_split_view<views::all_t<_Range>, views::all_t<_Pattern>>; template <input_range _Range> -lazy_split_view(_Range&&, range_value_t<_Range>) - -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>; +lazy_split_view(_Range&&, + range_value_t<_Range>) -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>; namespace views { namespace __lazy_split_view { diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h index 726b7eda01..2da246f24e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h @@ -19,6 +19,7 @@ #include <__functional/invoke.h> #include <__ranges/concepts.h> #include <__type_traits/decay.h> +#include <__type_traits/is_class.h> #include <__type_traits/is_nothrow_constructible.h> #include <__type_traits/remove_cvref.h> #include <__utility/forward.h> @@ -35,12 +36,15 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 +namespace ranges { + // CRTP base that one can derive from in order to be considered a range adaptor closure // by the library. When deriving from this class, a pipe operator will be provided to // make the following hold: // - `x | f` is equivalent to `f(x)` // - `f1 | f2` is an adaptor closure `g` such that `g(x)` is equivalent to `f2(f1(x))` template <class _Tp> + requires is_class_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> struct __range_adaptor_closure; // Type that wraps an arbitrary function object and makes it into a range adaptor closure, @@ -52,27 +56,42 @@ struct __range_adaptor_closure_t : _Fn, __range_adaptor_closure<__range_adaptor_ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__range_adaptor_closure_t); template <class _Tp> -concept _RangeAdaptorClosure = derived_from<remove_cvref_t<_Tp>, __range_adaptor_closure<remove_cvref_t<_Tp>>>; +_Tp __derived_from_range_adaptor_closure(__range_adaptor_closure<_Tp>*); template <class _Tp> -struct __range_adaptor_closure { - template <ranges::viewable_range _View, _RangeAdaptorClosure _Closure> - requires same_as<_Tp, remove_cvref_t<_Closure>> && invocable<_Closure, _View> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto) - operator|(_View&& __view, _Closure&& __closure) noexcept(is_nothrow_invocable_v<_Closure, _View>) { - return std::invoke(std::forward<_Closure>(__closure), std::forward<_View>(__view)); - } - - template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure> - requires same_as<_Tp, remove_cvref_t<_Closure>> && constructible_from<decay_t<_Closure>, _Closure> && - constructible_from<decay_t<_OtherClosure>, _OtherClosure> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) noexcept( - is_nothrow_constructible_v<decay_t<_Closure>, _Closure> && - is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) { - return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); - } +concept _RangeAdaptorClosure = !ranges::range<remove_cvref_t<_Tp>> && requires { + // Ensure that `remove_cvref_t<_Tp>` is derived from `__range_adaptor_closure<remove_cvref_t<_Tp>>` and isn't derived + // from `__range_adaptor_closure<U>` for any other type `U`. + { ranges::__derived_from_range_adaptor_closure((remove_cvref_t<_Tp>*)nullptr) } -> same_as<remove_cvref_t<_Tp>>; }; +template <ranges::range _Range, _RangeAdaptorClosure _Closure> + requires invocable<_Closure, _Range> +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) +operator|(_Range&& __range, _Closure&& __closure) noexcept(is_nothrow_invocable_v<_Closure, _Range>) { + return std::invoke(std::forward<_Closure>(__closure), std::forward<_Range>(__range)); +} + +template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure> + requires constructible_from<decay_t<_Closure>, _Closure> && constructible_from<decay_t<_OtherClosure>, _OtherClosure> +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) noexcept( + is_nothrow_constructible_v<decay_t<_Closure>, _Closure> && + is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) { + return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); +} + +template <class _Tp> + requires is_class_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> +struct __range_adaptor_closure {}; + +# if _LIBCPP_STD_VER >= 23 +template <class _Tp> + requires is_class_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> +class range_adaptor_closure : public __range_adaptor_closure<_Tp> {}; +# endif // _LIBCPP_STD_VER >= 23 + +} // namespace ranges + #endif // _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h index 6213332a54..5329d778dd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h @@ -43,7 +43,7 @@ class ref_view : public view_interface<ref_view<_Range>> { _Range* __range_; static void __fun(_Range&); - static void __fun(_Range&&) = delete; + static void __fun(_Range&&) = delete; // NOLINT(modernize-use-equals-delete) ; This is llvm.org/PR54276 public: template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h index 5edbc4e316..02b4c5999a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h @@ -104,9 +104,8 @@ struct __fn { template <class _Tp> requires is_rvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::rend(static_cast<const _Tp&&>(__t)))) - -> decltype(ranges::rend(static_cast<const _Tp&&>(__t))) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept( + noexcept(ranges::rend(static_cast<const _Tp&&>(__t)))) -> decltype(ranges::rend(static_cast<const _Tp&&>(__t))) { return ranges::rend(static_cast<const _Tp&&>(__t)); } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h index 5caea757a3..53e4beb270 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h @@ -22,6 +22,7 @@ #include <__ranges/iota_view.h> #include <__ranges/movable_box.h> #include <__ranges/view_interface.h> +#include <__type_traits/decay.h> #include <__type_traits/is_object.h> #include <__type_traits/make_unsigned.h> #include <__type_traits/remove_cv.h> @@ -127,8 +128,8 @@ private: _LIBCPP_NO_UNIQUE_ADDRESS _Bound __bound_ = _Bound(); }; -template <class _Tp, class _Bound> -repeat_view(_Tp, _Bound) -> repeat_view<_Tp, _Bound>; +template <class _Tp, class _Bound = unreachable_sentinel_t> +repeat_view(_Tp, _Bound = _Bound()) -> repeat_view<_Tp, _Bound>; // [range.repeat.iterator] template <move_constructible _Tp, semiregular _Bound> @@ -229,13 +230,13 @@ namespace views { namespace __repeat { struct __fn { template <class _Tp> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Tp&& __value) - noexcept(noexcept(ranges::repeat_view(std::forward<_Tp>(__value)))) - -> decltype( ranges::repeat_view(std::forward<_Tp>(__value))) - { return ranges::repeat_view(std::forward<_Tp>(__value)); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Tp&& __value) + noexcept(noexcept(ranges::repeat_view<decay_t<_Tp>>(std::forward<_Tp>(__value)))) + -> decltype( ranges::repeat_view<decay_t<_Tp>>(std::forward<_Tp>(__value))) + { return ranges::repeat_view<decay_t<_Tp>>(std::forward<_Tp>(__value)); } template <class _Tp, class _Bound> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Tp&& __value, _Bound&& __bound_sentinel) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Tp&& __value, _Bound&& __bound_sentinel) noexcept(noexcept(ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel)))) -> decltype( ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel))) { return ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h index ddbe890841..796f5be223 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h @@ -181,9 +181,8 @@ struct __fn : __range_adaptor_closure<__fn> { template <class _Range> requires(!__is_reverse_view<remove_cvref_t<_Range>> && !__is_sized_reverse_subrange<remove_cvref_t<_Range>> && !__is_unsized_reverse_subrange<remove_cvref_t<_Range>>) - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(reverse_view{std::forward<_Range>(__range)})) - -> decltype(reverse_view{std::forward<_Range>(__range)}) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range) const noexcept(noexcept(reverse_view{ + std::forward<_Range>(__range)})) -> decltype(reverse_view{std::forward<_Range>(__range)}) { return reverse_view{std::forward<_Range>(__range)}; } }; diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h index 98f17be04f..ce3606aedf 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h @@ -200,7 +200,7 @@ namespace __split_view { struct __fn { // clang-format off template <class _Range, class _Pattern> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Pattern&& __pattern) const noexcept(noexcept(split_view(std::forward<_Range>(__range), std::forward<_Pattern>(__pattern)))) -> decltype( split_view(std::forward<_Range>(__range), std::forward<_Pattern>(__pattern))) @@ -209,7 +209,7 @@ struct __fn { template <class _Pattern> requires constructible_from<decay_t<_Pattern>, _Pattern> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Pattern&& __pattern) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Pattern&& __pattern) const noexcept(is_nothrow_constructible_v<decay_t<_Pattern>, _Pattern>) { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Pattern>(__pattern))); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h index 051bc31139..aba584ef93 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h @@ -200,12 +200,11 @@ template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) -> subrange<_Iter, _Sent, subrange_kind::sized>; template <borrowed_range _Range> -subrange(_Range&&) - -> subrange<iterator_t<_Range>, - sentinel_t<_Range>, - (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>) - ? subrange_kind::sized - : subrange_kind::unsized>; +subrange(_Range&&) -> subrange<iterator_t<_Range>, + sentinel_t<_Range>, + (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>) + ? subrange_kind::sized + : subrange_kind::unsized>; template <borrowed_range _Range> subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>) diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h index 83ed5ca0eb..27ca8155a6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h @@ -308,7 +308,7 @@ struct __fn { class _RawRange = remove_cvref_t<_Range>, class _Dist = range_difference_t<_Range>> requires(__is_repeat_specialization<_RawRange> && sized_range<_RawRange>) - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const noexcept(noexcept(views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))))) -> decltype( views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n)))) { return views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))); } @@ -319,7 +319,7 @@ struct __fn { class _RawRange = remove_cvref_t<_Range>, class _Dist = range_difference_t<_Range>> requires(__is_repeat_specialization<_RawRange> && !sized_range<_RawRange>) - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const noexcept(noexcept(views::repeat(*__range.__value_, static_cast<_Dist>(__n)))) -> decltype( views::repeat(*__range.__value_, static_cast<_Dist>(__n))) { return views::repeat(*__range.__value_, static_cast<_Dist>(__n)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h index 67818c521b..e0abe6290b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h @@ -24,6 +24,7 @@ #include <__ranges/concepts.h> #include <__ranges/from_range.h> #include <__ranges/range_adaptor.h> +#include <__ranges/ref_view.h> #include <__ranges/size.h> #include <__ranges/transform_view.h> #include <__type_traits/add_pointer.h> @@ -85,7 +86,7 @@ concept __always_false = false; // `ranges::to` base template -- the `_Container` type is a simple type template parameter. template <class _Container, input_range _Range, class... _Args> requires(!view<_Container>) -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Container to(_Range&& __range, _Args&&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Container to(_Range&& __range, _Args&&... __args) { // Mandates: C is a cv-unqualified class type. static_assert(!is_const_v<_Container>, "The target container cannot be const-qualified, please remove the const"); static_assert( @@ -129,7 +130,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Container to(_Range&& __r // Try the recursive case. } else if constexpr (input_range<range_reference_t<_Range>>) { return ranges::to<_Container>( - __range | views::transform([](auto&& __elem) { + ref_view(__range) | views::transform([](auto&& __elem) { return ranges::to<range_value_t<_Container>>(std::forward<decltype(__elem)>(__elem)); }), std::forward<_Args>(__args)...); @@ -192,7 +193,7 @@ struct _Deducer { // `ranges::to` specialization -- `_Container` is a template template parameter requiring deduction to figure out the // container element type. template <template <class...> class _Container, input_range _Range, class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Range&& __range, _Args&&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Range&& __range, _Args&&... __args) { using _DeduceExpr = typename _Deducer<_Container, _Range, _Args...>::type; return ranges::to<_DeduceExpr>(std::forward<_Range>(__range), std::forward<_Args>(__args)...); } @@ -201,7 +202,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Range&& __range, // parameter. template <class _Container, class... _Args> requires(!view<_Container>) -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) { // Mandates: C is a cv-unqualified class type. static_assert(!is_const_v<_Container>, "The target container cannot be const-qualified, please remove the const"); static_assert( @@ -219,7 +220,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) // Range adaptor closure object 2 -- wrapping the `ranges::to` version where `_Container` is a template template // parameter. template <template <class...> class _Container, class... _Args> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) { // clang-format off auto __to_func = []<input_range _Range, class... _Tail, class _DeducedExpr = typename _Deducer<_Container, _Range, _Tail...>::type> diff --git a/contrib/libs/cxxsupp/libcxx/include/__split_buffer b/contrib/libs/cxxsupp/libcxx/include/__split_buffer index b638cb0063..2725b7d436 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__split_buffer +++ b/contrib/libs/cxxsupp/libcxx/include/__split_buffer @@ -24,12 +24,14 @@ #include <__memory/pointer_traits.h> #include <__memory/swap_allocator.h> #include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/conditional.h> #include <__type_traits/enable_if.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_nothrow_assignable.h> #include <__type_traits/is_nothrow_constructible.h> #include <__type_traits/is_swappable.h> #include <__type_traits/is_trivially_destructible.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/remove_reference.h> #include <__utility/forward.h> #include <__utility/move.h> @@ -64,6 +66,15 @@ public: using iterator = pointer; using const_iterator = const_pointer; + // A __split_buffer contains the following members which may be trivially relocatable: + // - pointer: may be trivially relocatable, so it's checked + // - allocator_type: may be trivially relocatable, so it's checked + // __split_buffer doesn't have any self-references, so it's trivially relocatable if its members are. + using __trivially_relocatable = __conditional_t< + __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value, + __split_buffer, + void>; + pointer __first_; pointer __begin_; pointer __end_; @@ -187,7 +198,7 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT; _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x) - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__alloc_rr>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const; @@ -200,8 +211,8 @@ private: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {} struct _ConstructTransaction { - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction( - pointer* __p, size_type __n) _NOEXCEPT + _LIBCPP_CONSTEXPR_SINCE_CXX20 + _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT : __pos_(*__p), __end_(*__p + __n), __dest_(__p) {} @@ -414,7 +425,7 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c) template <class _Tp, class _Allocator> _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x) - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__alloc_rr>::value) { + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>) { std::swap(__first_, __x.__first_); std::swap(__begin_, __x.__begin_); std::swap(__end_, __x.__end_); diff --git a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_callback.h b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_callback.h index 9e5b0338d4..760cf2bb55 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_callback.h +++ b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_callback.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H #define _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H -#include <__availability> #include <__concepts/constructible.h> #include <__concepts/destructible.h> #include <__concepts/invocable.h> @@ -21,6 +20,7 @@ #include <__type_traits/is_nothrow_constructible.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/private_constructor_tag.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -49,13 +49,13 @@ public: requires constructible_from<_Callback, _Cb> _LIBCPP_HIDE_FROM_ABI explicit stop_callback(const stop_token& __st, _Cb&& __cb) noexcept(is_nothrow_constructible_v<_Callback, _Cb>) - : stop_callback(__private_tag{}, __st.__state_, std::forward<_Cb>(__cb)) {} + : stop_callback(__private_constructor_tag{}, __st.__state_, std::forward<_Cb>(__cb)) {} template <class _Cb> requires constructible_from<_Callback, _Cb> _LIBCPP_HIDE_FROM_ABI explicit stop_callback(stop_token&& __st, _Cb&& __cb) noexcept(is_nothrow_constructible_v<_Callback, _Cb>) - : stop_callback(__private_tag{}, std::move(__st.__state_), std::forward<_Cb>(__cb)) {} + : stop_callback(__private_constructor_tag{}, std::move(__st.__state_), std::forward<_Cb>(__cb)) {} _LIBCPP_HIDE_FROM_ABI ~stop_callback() { if (__state_) { @@ -74,10 +74,8 @@ private: friend __stop_callback_base; - struct __private_tag {}; - template <class _StatePtr, class _Cb> - _LIBCPP_HIDE_FROM_ABI explicit stop_callback(__private_tag, _StatePtr&& __state, _Cb&& __cb) noexcept( + _LIBCPP_HIDE_FROM_ABI explicit stop_callback(__private_constructor_tag, _StatePtr&& __state, _Cb&& __cb) noexcept( is_nothrow_constructible_v<_Callback, _Cb>) : __stop_callback_base([](__stop_callback_base* __cb_base) noexcept { // stop callback is supposed to only be called once diff --git a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_source.h b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_source.h index 1080069cf3..7069746278 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_source.h +++ b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_source.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___STOP_TOKEN_STOP_SOURCE_H #define _LIBCPP___STOP_TOKEN_STOP_SOURCE_H -#include <__availability> #include <__config> #include <__stop_token/intrusive_shared_ptr.h> #include <__stop_token/stop_state.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_state.h b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_state.h index df07573f87..b0eed13a14 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_state.h +++ b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_state.h @@ -11,7 +11,6 @@ #define _LIBCPP___STOP_TOKEN_STOP_STATE_H #include <__assert> -#include <__availability> #include <__config> #include <__stop_token/atomic_unique_lock.h> #include <__stop_token/intrusive_list_view.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_token.h b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_token.h index f2eadb990b..1bd75cbbf6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_token.h +++ b/contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_token.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___STOP_TOKEN_STOP_TOKEN_H #define _LIBCPP___STOP_TOKEN_STOP_TOKEN_H -#include <__availability> #include <__config> #include <__stop_token/intrusive_shared_ptr.h> #include <__stop_token/stop_state.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h b/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h index 249057c944..44b46ebb94 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h +++ b/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h @@ -10,6 +10,7 @@ #define _LIBCPP___STRING_CHAR_TRAITS_H #include <__algorithm/fill_n.h> +#include <__algorithm/find.h> #include <__algorithm/find_end.h> #include <__algorithm/find_first_of.h> #include <__algorithm/min.h> @@ -17,6 +18,7 @@ #include <__compare/ordering.h> #include <__config> #include <__functional/hash.h> +#include <__functional/identity.h> #include <__iterator/iterator_traits.h> #include <__string/constexpr_c_functions.h> #include <__type_traits/is_constant_evaluated.h> @@ -268,31 +270,72 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char> { static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(EOF); } }; -// char_traits<wchar_t> - -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -template <> -struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> { - using char_type = wchar_t; - using int_type = wint_t; +template <class _CharT, class _IntT, _IntT _EOFVal> +struct __char_traits_base { + using char_type = _CharT; + using int_type = _IntT; using off_type = streamoff; - using pos_type = streampos; using state_type = mbstate_t; -# if _LIBCPP_STD_VER >= 20 +#if _LIBCPP_STD_VER >= 20 using comparison_category = strong_ordering; -# endif +#endif - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void - assign(char_type& __c1, const char_type& __c2) _NOEXCEPT { - __c1 = __c2; + // There are different aliases for the different char types, but they are all aliases to this type + using pos_type = fpos<mbstate_t>; + + _LIBCPP_HIDE_FROM_ABI static inline _LIBCPP_CONSTEXPR_SINCE_CXX17 void + assign(char_type& __lhs, const char_type& __rhs) _NOEXCEPT { + __lhs = __rhs; } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 == __c2; + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool eq(char_type __lhs, char_type __rhs) _NOEXCEPT { + return __lhs == __rhs; } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 < __c2; + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool lt(char_type __lhs, char_type __rhs) _NOEXCEPT { + return __lhs < __rhs; + } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* + move(char_type* __dest, const char_type* __src, size_t __n) _NOEXCEPT { + return std::__constexpr_memmove(__dest, __src, __element_count(__n)); + } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* + copy(char_type* __dest, const char_type* __src, size_t __n) _NOEXCEPT { + _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__dest, __dest + __n, __src), + "char_traits::copy: source and destination ranges overlap"); + return std::__constexpr_memmove(__dest, __src, __element_count(__n)); + } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* + assign(char_type* __str, size_t __n, char_type __fill_char) _NOEXCEPT { + std::fill_n(__str, __n, __fill_char); + return __str; } + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT { + return char_type(__c); + } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT { return int_type(__c); } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __lhs, int_type __rhs) _NOEXCEPT { + return __lhs == __rhs; + } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return _EOFVal; } + + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT { + return eq_int_type(__c, eof()) ? static_cast<int_type>(~eof()) : __c; + } +}; + +// char_traits<wchar_t> + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template <> +struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wint_t>(WEOF)> { static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (__n == 0) @@ -310,184 +353,46 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> { return nullptr; return std::__constexpr_wmemchr(__s, __a, __n); } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - return std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__s1, __s1 + __n, __s2), - "char_traits::copy: source and destination ranges overlap"); - std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - return __s1; - } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { - std::fill_n(__s, __n, __a); - return __s; - } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT { - return eq_int_type(__c, eof()) ? ~eof() : __c; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT { - return char_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT { - return int_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT { - return __c1 == __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(WEOF); } }; #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS #ifndef _LIBCPP_HAS_NO_CHAR8_T template <> -struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t> { - using char_type = char8_t; - using int_type = unsigned int; - using off_type = streamoff; - using pos_type = u8streampos; - using state_type = mbstate_t; -# if _LIBCPP_STD_VER >= 20 - using comparison_category = strong_ordering; -# endif - - static inline _LIBCPP_HIDE_FROM_ABI constexpr void assign(char_type& __c1, const char_type& __c2) noexcept { - __c1 = __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq(char_type __c1, char_type __c2) noexcept { - return __c1 == __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI constexpr bool lt(char_type __c1, char_type __c2) noexcept { return __c1 < __c2; } - +struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t> + : __char_traits_base<char8_t, unsigned int, static_cast<unsigned int>(EOF)> { static _LIBCPP_HIDE_FROM_ABI constexpr int - compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { + compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept { return std::__constexpr_memcmp(__s1, __s2, __element_count(__n)); } - static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __s) _NOEXCEPT; - - _LIBCPP_HIDE_FROM_ABI static constexpr const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - return std::__constexpr_memmove(__s1, __s2, __element_count(__n)); + static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __str) noexcept { + return std::__constexpr_strlen(__str); } - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__s1, __s1 + __n, __s2), - "char_traits::copy: source and destination ranges overlap"); - std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - return __s1; - } - - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* - assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { - std::fill_n(__s, __n, __a); - return __s; - } - - static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type not_eof(int_type __c) noexcept { - return eq_int_type(__c, eof()) ? ~eof() : __c; - } - static inline _LIBCPP_HIDE_FROM_ABI constexpr char_type to_char_type(int_type __c) noexcept { return char_type(__c); } - static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type to_int_type(char_type __c) noexcept { return int_type(__c); } - static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept { - return __c1 == __c2; + _LIBCPP_HIDE_FROM_ABI static constexpr const char_type* + find(const char_type* __s, size_t __n, const char_type& __a) noexcept { + return std::__constexpr_memchr(__s, __a, __n); } - static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type eof() noexcept { return int_type(EOF); } }; -// TODO use '__builtin_strlen' if it ever supports char8_t ?? -inline constexpr size_t char_traits<char8_t>::length(const char_type* __s) _NOEXCEPT { - size_t __len = 0; - for (; !eq(*__s, char_type(0)); ++__s) - ++__len; - return __len; -} - -// TODO use '__builtin_char_memchr' if it ever supports char8_t ?? -inline constexpr const char8_t* -char_traits<char8_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { - for (; __n; --__n) { - if (eq(*__s, __a)) - return __s; - ++__s; - } - return nullptr; -} - #endif // _LIBCPP_HAS_NO_CHAR8_T template <> -struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t> { - using char_type = char16_t; - using int_type = uint_least16_t; - using off_type = streamoff; - using pos_type = u16streampos; - using state_type = mbstate_t; -#if _LIBCPP_STD_VER >= 20 - using comparison_category = strong_ordering; -#endif - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void - assign(char_type& __c1, const char_type& __c2) _NOEXCEPT { - __c1 = __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 == __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 < __c2; - } - +struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t> + : __char_traits_base<char16_t, uint_least16_t, static_cast<uint_least16_t>(0xFFFF)> { _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT; - _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - return std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - } - - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__s1, __s1 + __n, __s2), - "char_traits::copy: source and destination ranges overlap"); - std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - return __s1; - } - - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { - std::fill_n(__s, __n, __a); - return __s; - } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT { - return eq_int_type(__c, eof()) ? ~eof() : __c; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT { - return char_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT { - return int_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT { - return __c1 == __c2; + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* + find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { + __identity __proj; + const char_type* __match = std::__find(__s, __s + __n, __a, __proj); + if (__match == __s + __n) + return nullptr; + return __match; } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(0xFFFF); } }; inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int @@ -508,74 +413,21 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char16_t>::length(const return __len; } -inline _LIBCPP_CONSTEXPR_SINCE_CXX17 const char16_t* -char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { - for (; __n; --__n) { - if (eq(*__s, __a)) - return __s; - ++__s; - } - return nullptr; -} - template <> -struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t> { - using char_type = char32_t; - using int_type = uint_least32_t; - using off_type = streamoff; - using pos_type = u32streampos; - using state_type = mbstate_t; -#if _LIBCPP_STD_VER >= 20 - using comparison_category = strong_ordering; -#endif - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void - assign(char_type& __c1, const char_type& __c2) _NOEXCEPT { - __c1 = __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 == __c2; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT { - return __c1 < __c2; - } - +struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t> + : __char_traits_base<char32_t, uint_least32_t, static_cast<uint_least32_t>(0xFFFFFFFF)> { _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT; - _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - return std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - std::__constexpr_memmove(__s1, __s2, __element_count(__n)); - return __s1; - } - - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static char_type* - assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { - std::fill_n(__s, __n, __a); - return __s; - } - - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT { - return eq_int_type(__c, eof()) ? ~eof() : __c; - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT { - return char_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT { - return int_type(__c); - } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT { - return __c1 == __c2; + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* + find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { + __identity __proj; + const char_type* __match = std::__find(__s, __s + __n, __a, __proj); + if (__match == __s + __n) + return nullptr; + return __match; } - static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(0xFFFFFFFF); } }; inline _LIBCPP_CONSTEXPR_SINCE_CXX17 int @@ -596,16 +448,6 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t char_traits<char32_t>::length(const return __len; } -inline _LIBCPP_CONSTEXPR_SINCE_CXX17 const char32_t* -char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { - for (; __n; --__n) { - if (eq(*__s, __a)) - return __s; - ++__s; - } - return nullptr; -} - // helper fns for basic_string and string_view // __str_find diff --git a/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h b/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h index 198f0f5e68..a978f816f1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h +++ b/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h @@ -35,18 +35,33 @@ _LIBCPP_BEGIN_NAMESPACE_STD // of elements as opposed to a number of bytes. enum class __element_count : size_t {}; -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) { +template <class _Tp> +inline const bool __is_char_type = false; + +template <> +inline const bool __is_char_type<char> = true; + +#ifndef _LIBCPP_HAS_NO_CHAR8_T +template <> +inline const bool __is_char_type<char8_t> = true; +#endif + +template <class _Tp> +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const _Tp* __str) _NOEXCEPT { + static_assert(__is_char_type<_Tp>, "__constexpr_strlen only works with char and char8_t"); // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816 -#ifdef _LIBCPP_COMPILER_GCC if (__libcpp_is_constant_evaluated()) { +#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_COMPILER_CLANG_BASED) + if constexpr (is_same_v<_Tp, char>) + return __builtin_strlen(__str); +#endif size_t __i = 0; for (; __str[__i] != '\0'; ++__i) ; return __i; } -#endif - return __builtin_strlen(__str); + return __builtin_strlen(reinterpret_cast<const char*>(__str)); } // Because of __libcpp_is_trivially_lexicographically_comparable we know that comparing the object representations is @@ -108,7 +123,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n } return true; } else { - return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0; + return ::__builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0; } } @@ -209,7 +224,7 @@ __constexpr_memmove(_Tp* __dest, _Up* __src, __element_count __n) { std::__assign_trivially_copyable(__dest[__i], __src[__i]); } } else if (__count > 0) { - ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __libcpp_datasizeof<_Tp>::value); + ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __datasizeof_v<_Tp>); } return __dest; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__nop_locale_mgmt.h b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__nop_locale_mgmt.h index f7d4d5ce3f..b9ffcbe162 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__nop_locale_mgmt.h +++ b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__nop_locale_mgmt.h @@ -12,20 +12,16 @@ #include <__config> -#ifdef __cplusplus -extern "C" { -#endif - // Patch over lack of extended locale support typedef void* locale_t; -inline _LIBCPP_HIDE_FROM_ABI_C locale_t duplocale(locale_t) { return NULL; } +inline _LIBCPP_HIDE_FROM_ABI locale_t duplocale(locale_t) { return NULL; } -inline _LIBCPP_HIDE_FROM_ABI_C void freelocale(locale_t) {} +inline _LIBCPP_HIDE_FROM_ABI void freelocale(locale_t) {} -inline _LIBCPP_HIDE_FROM_ABI_C locale_t newlocale(int, const char*, locale_t) { return NULL; } +inline _LIBCPP_HIDE_FROM_ABI locale_t newlocale(int, const char*, locale_t) { return NULL; } -inline _LIBCPP_HIDE_FROM_ABI_C locale_t uselocale(locale_t) { return NULL; } +inline _LIBCPP_HIDE_FROM_ABI locale_t uselocale(locale_t) { return NULL; } #define LC_COLLATE_MASK (1 << LC_COLLATE) #define LC_CTYPE_MASK (1 << LC_CTYPE) @@ -36,8 +32,4 @@ inline _LIBCPP_HIDE_FROM_ABI_C locale_t uselocale(locale_t) { return NULL; } #define LC_ALL_MASK \ (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_MESSAGES_MASK) -#ifdef __cplusplus -} // extern "C" -#endif - #endif // _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__posix_l_fallback.h b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__posix_l_fallback.h index 42d24db94e..8a3a6f27f4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__posix_l_fallback.h +++ b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__posix_l_fallback.h @@ -25,93 +25,83 @@ # include <wctype.h> #endif -#ifdef __cplusplus -extern "C" { -#endif - -inline _LIBCPP_HIDE_FROM_ABI_C int isalnum_l(int __c, locale_t) { return ::isalnum(__c); } - -inline _LIBCPP_HIDE_FROM_ABI_C int isalpha_l(int __c, locale_t) { return ::isalpha(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isalnum_l(int __c, locale_t) { return ::isalnum(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isblank_l(int __c, locale_t) { return ::isblank(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isalpha_l(int __c, locale_t) { return ::isalpha(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iscntrl_l(int __c, locale_t) { return ::iscntrl(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iscntrl_l(int __c, locale_t) { return ::iscntrl(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isdigit_l(int __c, locale_t) { return ::isdigit(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isdigit_l(int __c, locale_t) { return ::isdigit(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isgraph_l(int __c, locale_t) { return ::isgraph(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isgraph_l(int __c, locale_t) { return ::isgraph(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int islower_l(int __c, locale_t) { return ::islower(__c); } +inline _LIBCPP_HIDE_FROM_ABI int islower_l(int __c, locale_t) { return ::islower(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isprint_l(int __c, locale_t) { return ::isprint(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isprint_l(int __c, locale_t) { return ::isprint(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int ispunct_l(int __c, locale_t) { return ::ispunct(__c); } +inline _LIBCPP_HIDE_FROM_ABI int ispunct_l(int __c, locale_t) { return ::ispunct(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isspace_l(int __c, locale_t) { return ::isspace(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isspace_l(int __c, locale_t) { return ::isspace(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isupper_l(int __c, locale_t) { return ::isupper(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isupper_l(int __c, locale_t) { return ::isupper(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int isxdigit_l(int __c, locale_t) { return ::isxdigit(__c); } +inline _LIBCPP_HIDE_FROM_ABI int isxdigit_l(int __c, locale_t) { return ::isxdigit(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int toupper_l(int __c, locale_t) { return ::toupper(__c); } +inline _LIBCPP_HIDE_FROM_ABI int toupper_l(int __c, locale_t) { return ::toupper(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int tolower_l(int __c, locale_t) { return ::tolower(__c); } +inline _LIBCPP_HIDE_FROM_ABI int tolower_l(int __c, locale_t) { return ::tolower(__c); } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -inline _LIBCPP_HIDE_FROM_ABI_C int iswalnum_l(wint_t __c, locale_t) { return ::iswalnum(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswalnum_l(wint_t __c, locale_t) { return ::iswalnum(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswalpha_l(wint_t __c, locale_t) { return ::iswalpha(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswalpha_l(wint_t __c, locale_t) { return ::iswalpha(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswblank_l(wint_t __c, locale_t) { return ::iswblank(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswblank_l(wint_t __c, locale_t) { return ::iswblank(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswcntrl_l(wint_t __c, locale_t) { return ::iswcntrl(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswcntrl_l(wint_t __c, locale_t) { return ::iswcntrl(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswdigit_l(wint_t __c, locale_t) { return ::iswdigit(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswdigit_l(wint_t __c, locale_t) { return ::iswdigit(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswgraph_l(wint_t __c, locale_t) { return ::iswgraph(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswgraph_l(wint_t __c, locale_t) { return ::iswgraph(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswlower_l(wint_t __c, locale_t) { return ::iswlower(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswlower_l(wint_t __c, locale_t) { return ::iswlower(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswprint_l(wint_t __c, locale_t) { return ::iswprint(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswprint_l(wint_t __c, locale_t) { return ::iswprint(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswpunct_l(wint_t __c, locale_t) { return ::iswpunct(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswpunct_l(wint_t __c, locale_t) { return ::iswpunct(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswspace_l(wint_t __c, locale_t) { return ::iswspace(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswspace_l(wint_t __c, locale_t) { return ::iswspace(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswupper_l(wint_t __c, locale_t) { return ::iswupper(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswupper_l(wint_t __c, locale_t) { return ::iswupper(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C int iswxdigit_l(wint_t __c, locale_t) { return ::iswxdigit(__c); } +inline _LIBCPP_HIDE_FROM_ABI int iswxdigit_l(wint_t __c, locale_t) { return ::iswxdigit(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C wint_t towupper_l(wint_t __c, locale_t) { return ::towupper(__c); } +inline _LIBCPP_HIDE_FROM_ABI wint_t towupper_l(wint_t __c, locale_t) { return ::towupper(__c); } -inline _LIBCPP_HIDE_FROM_ABI_C wint_t towlower_l(wint_t __c, locale_t) { return ::towlower(__c); } +inline _LIBCPP_HIDE_FROM_ABI wint_t towlower_l(wint_t __c, locale_t) { return ::towlower(__c); } #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS -inline _LIBCPP_HIDE_FROM_ABI_C int strcoll_l(const char* __s1, const char* __s2, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI int strcoll_l(const char* __s1, const char* __s2, locale_t) { return ::strcoll(__s1, __s2); } -inline _LIBCPP_HIDE_FROM_ABI_C size_t strxfrm_l(char* __dest, const char* __src, size_t __n, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI size_t strxfrm_l(char* __dest, const char* __src, size_t __n, locale_t) { return ::strxfrm(__dest, __src, __n); } -inline _LIBCPP_HIDE_FROM_ABI_C size_t +inline _LIBCPP_HIDE_FROM_ABI size_t strftime_l(char* __s, size_t __max, const char* __format, const struct tm* __tm, locale_t) { return ::strftime(__s, __max, __format, __tm); } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -inline _LIBCPP_HIDE_FROM_ABI_C int wcscoll_l(const wchar_t* __ws1, const wchar_t* __ws2, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI int wcscoll_l(const wchar_t* __ws1, const wchar_t* __ws2, locale_t) { return ::wcscoll(__ws1, __ws2); } -inline _LIBCPP_HIDE_FROM_ABI_C size_t wcsxfrm_l(wchar_t* __dest, const wchar_t* __src, size_t __n, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI size_t wcsxfrm_l(wchar_t* __dest, const wchar_t* __src, size_t __n, locale_t) { return ::wcsxfrm(__dest, __src, __n); } #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS -#ifdef __cplusplus -} -#endif - #endif // _LIBCPP___SUPPORT_XLOCALE_POSIX_L_FALLBACK_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h index ae8e13a758..b7eef5210e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h +++ b/contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h @@ -22,48 +22,24 @@ # include <wchar.h> #endif -#ifdef __cplusplus -extern "C" { -#endif - -inline _LIBCPP_HIDE_FROM_ABI_C float strtof_l(const char* __nptr, char** __endptr, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) { return ::strtof(__nptr, __endptr); } -inline _LIBCPP_HIDE_FROM_ABI_C double strtod_l(const char* __nptr, char** __endptr, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) { return ::strtod(__nptr, __endptr); } -inline _LIBCPP_HIDE_FROM_ABI_C long double strtold_l(const char* __nptr, char** __endptr, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __endptr, locale_t) { return ::strtold(__nptr, __endptr); } -inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoll(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long -strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { +inline _LIBCPP_HIDE_FROM_ABI unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoull(__nptr, __endptr, __base); } -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -inline _LIBCPP_HIDE_FROM_ABI_C long long wcstoll_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) { - return ::wcstoll(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long -wcstoull_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) { - return ::wcstoull(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C long double wcstold_l(const wchar_t* __nptr, wchar_t** __endptr, locale_t) { - return ::wcstold(__nptr, __endptr); -} -#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS - -#ifdef __cplusplus -} -#endif - #endif // _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h b/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h index e9f3656b7b..0004c46e22 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h +++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h @@ -112,6 +112,11 @@ enum class errc // macros. So GCC does not need the pushing and popping. // // TODO Remove this when the deprecated constants are removed. +// +// Note based on the post-review comments in +// https://github.com/llvm/llvm-project/pull/80542 libc++ no longer deprecates +// the macros. Since C libraries may start to deprecate these POSIX macros the +// deprecation warning avoidance is kept. #if defined(_LIBCPP_COMPILER_CLANG_BASED) # define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_PUSH _LIBCPP_SUPPRESS_DEPRECATED_PUSH # define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_POP _LIBCPP_SUPPRESS_DEPRECATED_POP diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/jthread.h b/contrib/libs/cxxsupp/libcxx/include/__thread/jthread.h index 253e3a935d..b3d5c25fb7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__thread/jthread.h +++ b/contrib/libs/cxxsupp/libcxx/include/__thread/jthread.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___THREAD_JTHREAD_H #define _LIBCPP___THREAD_JTHREAD_H -#include <__availability> #include <__config> #include <__functional/invoke.h> #include <__stop_token/stop_source.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h b/contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h index d8354e6ca2..4f961fe3f7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h +++ b/contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h @@ -10,7 +10,6 @@ #ifndef _LIBCPP___THREAD_POLL_WITH_BACKOFF_H #define _LIBCPP___THREAD_POLL_WITH_BACKOFF_H -#include <__availability> #include <__chrono/duration.h> #include <__chrono/high_resolution_clock.h> #include <__config> diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h b/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h index 8db1e28ec7..d2254a695f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h +++ b/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h @@ -65,18 +65,17 @@ class __thread_specific_ptr { // Only __thread_local_data() may construct a __thread_specific_ptr // and only with _Tp == __thread_struct. - static_assert((is_same<_Tp, __thread_struct>::value), ""); + static_assert(is_same<_Tp, __thread_struct>::value, ""); __thread_specific_ptr(); friend _LIBCPP_EXPORTED_FROM_ABI __thread_specific_ptr<__thread_struct>& __thread_local_data(); - __thread_specific_ptr(const __thread_specific_ptr&); - __thread_specific_ptr& operator=(const __thread_specific_ptr&); - _LIBCPP_HIDDEN static void _LIBCPP_TLS_DESTRUCTOR_CC __at_thread_exit(void*); public: typedef _Tp* pointer; + __thread_specific_ptr(const __thread_specific_ptr&) = delete; + __thread_specific_ptr& operator=(const __thread_specific_ptr&) = delete; ~__thread_specific_ptr(); _LIBCPP_HIDE_FROM_ABI pointer get() const { return static_cast<_Tp*>(__libcpp_tls_get(__key_)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__tree b/contrib/libs/cxxsupp/libcxx/include/__tree index 5a0d8f42a6..1990fa602d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__tree +++ b/contrib/libs/cxxsupp/libcxx/include/__tree @@ -574,7 +574,7 @@ struct __tree_node_base_types { #endif private: - static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value), + static_assert(is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value, "_VoidPtr does not point to unqualified void type"); }; @@ -614,7 +614,7 @@ public: private: static_assert(!is_const<__node_type>::value, "_NodePtr should never be a pointer to const"); - static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value), + static_assert(is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value, "_VoidPtr does not rebind to _NodePtr."); }; @@ -651,7 +651,6 @@ public: _LIBCPP_HIDE_FROM_ABI void __set_parent(pointer __p) { __parent_ = static_cast<__parent_pointer>(__p); } -private: ~__tree_node_base() = delete; __tree_node_base(__tree_node_base const&) = delete; __tree_node_base& operator=(__tree_node_base const&) = delete; @@ -666,7 +665,6 @@ public: _LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return __value_; } -private: ~__tree_node() = delete; __tree_node(__tree_node const&) = delete; __tree_node& operator=(__tree_node const&) = delete; @@ -925,11 +923,11 @@ private: // check for sane allocator pointer rebinding semantics. Rebinding the // allocator for a new pointer type should be exactly the same as rebinding // the pointer using 'pointer_traits'. - static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value), + static_assert(is_same<__node_pointer, typename __node_traits::pointer>::value, "Allocator does not rebind pointers in a sane manner."); typedef __rebind_alloc<__node_traits, __node_base> __node_base_allocator; typedef allocator_traits<__node_base_allocator> __node_base_traits; - static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), + static_assert(is_same<__node_base_pointer, typename __node_base_traits::pointer>::value, "Allocator does not rebind pointers in a sane manner."); private: @@ -1006,11 +1004,10 @@ public: _LIBCPP_HIDE_FROM_ABI void swap(__tree& __t) #if _LIBCPP_STD_VER <= 11 - _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value && - (!__node_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value)); + _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> && + (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)); #else - _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value); + _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>); #endif template <class _Key, class... _Args> @@ -1401,7 +1398,7 @@ template <class _ForwardIterator> void __tree<_Tp, _Compare, _Allocator>::__assign_unique(_ForwardIterator __first, _ForwardIterator __last) { typedef iterator_traits<_ForwardIterator> _ITraits; typedef typename _ITraits::value_type _ItValueType; - static_assert((is_same<_ItValueType, __container_value_type>::value), + static_assert(is_same<_ItValueType, __container_value_type>::value, "__assign_unique may only be called with the containers value type"); static_assert( __has_forward_iterator_category<_ForwardIterator>::value, "__assign_unique requires a forward iterator"); @@ -1531,7 +1528,7 @@ __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=( template <class _Tp, class _Compare, class _Allocator> __tree<_Tp, _Compare, _Allocator>::~__tree() { - static_assert((is_copy_constructible<value_compare>::value), "Comparator must be copy-constructible."); + static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible."); destroy(__root()); } @@ -1549,10 +1546,10 @@ void __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT { template <class _Tp, class _Compare, class _Allocator> void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t) #if _LIBCPP_STD_VER <= 11 - _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value && - (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value)) + _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> && + (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)) #else - _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value) + _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>) #endif { using std::swap; diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h index 43161b17cf..9e0fefae2f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h +++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h @@ -16,7 +16,7 @@ #include <__tuple/tuple_indices.h> #include <__tuple/tuple_size.h> #include <__tuple/tuple_types.h> -#include <__type_traits/apply_cv.h> +#include <__type_traits/copy_cvref.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_reference.h> #include <cstddef> @@ -41,7 +41,7 @@ template <template <class...> class _Tuple, class... _Types, size_t... _Idx> struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { // Specialization for pair, tuple, and __tuple_types template <class _Tp> - using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__apply_cv_t<_Tp, __type_pack_element<_Idx, _Types...>>...>; + using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__copy_cvref_t<_Tp, __type_pack_element<_Idx, _Types...>>...>; }; template <class _Vt, size_t _Np, size_t... _Idx> @@ -49,7 +49,7 @@ struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> { template <size_t> using __value_type = _Vt; template <class _Tp> - using __apply_quals = __tuple_types<__apply_cv_t<_Tp, __value_type<_Idx>>...>; + using __apply_quals = __tuple_types<__copy_cvref_t<_Tp, __value_type<_Idx>>...>; }; template <class _Tp, diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h index dfd00f5237..7db5eeb1dd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h +++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h @@ -35,8 +35,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD struct __tuple_sfinae_base { template <template <class, class...> class _Trait, class... _LArgs, class... _RArgs> - static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>) - -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>; + static auto __do_test(__tuple_types<_LArgs...>, + __tuple_types<_RArgs...>) -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>; template <template <class...> class> static auto __do_test(...) -> false_type; diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h index 668be13a5c..18a17fd4d5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h +++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h @@ -43,7 +43,7 @@ struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< volatile _Tp, template <class _Tp> struct _LIBCPP_TEMPLATE_VIS - tuple_size<__enable_if_tuple_size_imp<const volatile _Tp, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> +tuple_size<__enable_if_tuple_size_imp<const volatile _Tp, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> : public integral_constant<size_t, tuple_size<_Tp>::value> {}; #else diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h deleted file mode 100644 index 723af95b8d..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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___TYPE_TRAITS_APPLY_CV_H -#define _LIBCPP___TYPE_TRAITS_APPLY_CV_H - -#include <__config> -#include <__type_traits/copy_cv.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -struct __apply_cv_impl { - template <class _Up> - using __apply _LIBCPP_NODEBUG = __copy_cv_t<_Tp, _Up>; -}; - -template <class _Tp> -struct __apply_cv_impl<_Tp&> { - template <class _Up> - using __apply _LIBCPP_NODEBUG = __copy_cv_t<_Tp, _Up>&; -}; - -template <class _Tp, class _Up> -using __apply_cv_t _LIBCPP_NODEBUG = typename __apply_cv_impl<_Tp>::template __apply<_Up>; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___TYPE_TRAITS_APPLY_CV_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h index 7f86fcaaac..f6bd9ed71b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h @@ -82,9 +82,9 @@ struct _LIBCPP_TEMPLATE_VIS common_type<_Tp> : public common_type<_Tp, _Tp> {}; // sub-bullet 1 - "If is_same_v<T1, D1> is false or ..." template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up> - : conditional<_IsSame<_Tp, __decay_t<_Tp> >::value && _IsSame<_Up, __decay_t<_Up> >::value, - __common_type2_imp<_Tp, _Up>, - common_type<__decay_t<_Tp>, __decay_t<_Up> > >::type {}; + : __conditional_t<_IsSame<_Tp, __decay_t<_Tp> >::value && _IsSame<_Up, __decay_t<_Up> >::value, + __common_type2_imp<_Tp, _Up>, + common_type<__decay_t<_Tp>, __decay_t<_Up> > > {}; // bullet 4 - sizeof...(Tp) > 2 diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h index b1c057ff77..d482cb42bf 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h @@ -19,28 +19,32 @@ _LIBCPP_BEGIN_NAMESPACE_STD // Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's // top-level cv-qualifiers. -template <class _From, class _To> +template <class _From> struct __copy_cv { - using type = _To; + template <class _To> + using __apply = _To; }; -template <class _From, class _To> -struct __copy_cv<const _From, _To> { - using type = const _To; +template <class _From> +struct __copy_cv<const _From> { + template <class _To> + using __apply = const _To; }; -template <class _From, class _To> -struct __copy_cv<volatile _From, _To> { - using type = volatile _To; +template <class _From> +struct __copy_cv<volatile _From> { + template <class _To> + using __apply = volatile _To; }; -template <class _From, class _To> -struct __copy_cv<const volatile _From, _To> { - using type = const volatile _To; +template <class _From> +struct __copy_cv<const volatile _From> { + template <class _To> + using __apply = const volatile _To; }; template <class _From, class _To> -using __copy_cv_t = typename __copy_cv<_From, _To>::type; +using __copy_cv_t = typename __copy_cv<_From>::template __apply<_To>; _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h index 770c51ef04..b4cbd1ddfa 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h @@ -26,39 +26,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD +// TODO: Enable this again once #94816 is fixed. +#if (__has_keyword(__datasizeof) || __has_extension(datasizeof)) && 0 template <class _Tp> -struct __libcpp_datasizeof { -#if __has_extension(datasizeof) && !defined(__CUDACC__) - static const size_t value = __datasizeof(_Tp); +inline const size_t __datasizeof_v = __datasizeof(_Tp); #else -// NOLINTNEXTLINE(readability-redundant-preprocessor) This is https://llvm.org/PR64825 -# if __has_cpp_attribute(__no_unique_address__) - template <class = char> - struct _FirstPaddingByte { - [[__no_unique_address__]] _Tp __v_; - char __first_padding_byte_; - }; -# else - template <bool = __libcpp_is_final<_Tp>::value || !is_class<_Tp>::value> - struct _FirstPaddingByte : _Tp { - char __first_padding_byte_; - }; - - template <> - struct _FirstPaddingByte<true> { - _Tp __v_; - char __first_padding_byte_; - }; -# endif // __has_cpp_attribute(__no_unique_address__) +template <class _Tp> +struct _FirstPaddingByte { + _LIBCPP_NO_UNIQUE_ADDRESS _Tp __v_; + char __first_padding_byte_; +}; - // _FirstPaddingByte<> is sometimes non-standard layout. Using `offsetof` is UB in that case, but GCC and Clang allow - // the use as an extension. - _LIBCPP_DIAGNOSTIC_PUSH - _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-offsetof") - static const size_t value = offsetof(_FirstPaddingByte<>, __first_padding_byte_); - _LIBCPP_DIAGNOSTIC_POP +// _FirstPaddingByte<> is sometimes non-standard layout. Using `offsetof` is UB in that case, but GCC and Clang allow +// the use as an extension. +_LIBCPP_DIAGNOSTIC_PUSH +_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-offsetof") +_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Winvalid-offsetof") +template <class _Tp> +inline const size_t __datasizeof_v = offsetof(_FirstPaddingByte<_Tp>, __first_padding_byte_); +_LIBCPP_DIAGNOSTIC_POP #endif // __has_extension(datasizeof) -}; _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h index 95dccaa29c..7412044f93 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h @@ -43,11 +43,11 @@ struct __decay { template <class _Up> struct __decay<_Up, true> { public: - typedef _LIBCPP_NODEBUG typename conditional< - is_array<_Up>::value, - __add_pointer_t<__remove_extent_t<_Up> >, - typename conditional<is_function<_Up>::value, typename add_pointer<_Up>::type, __remove_cv_t<_Up> >::type >::type - type; + typedef _LIBCPP_NODEBUG + __conditional_t<is_array<_Up>::value, + __add_pointer_t<__remove_extent_t<_Up> >, + __conditional_t<is_function<_Up>::value, typename add_pointer<_Up>::type, __remove_cv_t<_Up> > > + type; }; template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/desugars_to.h index ef6e716934..97a2ee5448 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/desugars_to.h @@ -6,11 +6,10 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP___TYPE_TRAITS_OPERATION_TRAITS_H -#define _LIBCPP___TYPE_TRAITS_OPERATION_TRAITS_H +#ifndef _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H +#define _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H #include <__config> -#include <__type_traits/integral_constant.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -21,6 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // Tags to represent the canonical operations struct __equal_tag {}; struct __plus_tag {}; +struct __less_tag {}; // This class template is used to determine whether an operation "desugars" // (or boils down) to a given canonical operation. @@ -33,8 +33,8 @@ struct __plus_tag {}; // predicate being passed is actually going to call a builtin operator, or has // some specific semantics. template <class _CanonicalTag, class _Operation, class... _Args> -struct __desugars_to : false_type {}; +inline const bool __desugars_to_v = false; _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP___TYPE_TRAITS_OPERATION_TRAITS_H +#endif // _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h index c0ada5618f..98c440c16b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h @@ -12,7 +12,6 @@ #include <__config> #include <__type_traits/integral_constant.h> #include <__type_traits/remove_all_extents.h> -#include <__type_traits/remove_cv.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -24,10 +23,15 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations - : public integral_constant<bool, __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {}; + // TODO: We work around a Clang and GCC bug in __has_unique_object_representations by using remove_all_extents + // even though it should not be necessary. This was reported to the compilers: + // - Clang: https://github.com/llvm/llvm-project/issues/95311 + // - GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115476 + // remove_all_extents_t can be removed once all the compilers we support have fixed this bug. + : public integral_constant<bool, __has_unique_object_representations(remove_all_extents_t<_Tp>)> {}; template <class _Tp> -inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value; +inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp); #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h index 44ef2a83b9..a0281f5b20 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h @@ -163,8 +163,8 @@ struct __invokable_r { using _Result = decltype(__try_call<_Fp, _Args...>(0)); using type = __conditional_t<_IsNotSame<_Result, __nat>::value, - __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >, - false_type>; + __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >, + false_type>; static const bool value = type::value; }; template <class _Fp, class... _Args> diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h index 5b0e0e6f46..dc23de28d2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h @@ -19,9 +19,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD -// TODO: Clang incorrectly reports that __is_array is true for T[0]. -// Re-enable the branch once https://llvm.org/PR54705 is fixed. -#if __has_builtin(__is_array) && 0 +#if __has_builtin(__is_array) && \ + (!defined(_LIBCPP_COMPILER_CLANG_BASED) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1900)) template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> {}; diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h index 00316ed637..4397f743e5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h @@ -17,7 +17,6 @@ #include <__type_traits/is_signed.h> #include <__type_traits/is_void.h> #include <__type_traits/remove_cv.h> -#include <__type_traits/remove_cvref.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> @@ -45,6 +44,8 @@ struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() // pointers that don't have the same type (ignoring cv-qualifiers): pointers to virtual bases are equality comparable, // but don't have the same bit-pattern. An exception to this is comparing to a void-pointer. There the bit-pattern is // always compared. +// objects with padding bytes: since objects with padding bytes may compare equal, even though their object +// representation may not be equivalent. template <class _Tp, class _Up, class = void> struct __libcpp_is_trivially_equality_comparable_impl : false_type {}; diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h index 81da34572c..10e23bceff 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h @@ -20,8 +20,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS) template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type - : public integral_constant<bool, __is_literal_type(_Tp)> {}; +struct _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX17 is_literal_type : public integral_constant<bool, __is_literal_type(_Tp)> {}; # if _LIBCPP_STD_VER >= 17 template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h index 370ba27ecd..c2d5ca8723 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h @@ -12,9 +12,6 @@ #include <__config> #include <__type_traits/integral_constant.h> #include <__type_traits/is_destructible.h> -#include <__type_traits/is_reference.h> -#include <__type_traits/is_scalar.h> -#include <__type_traits/remove_all_extents.h> #include <__utility/declval.h> #include <cstddef> @@ -24,7 +21,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if !defined(_LIBCPP_CXX03_LANG) +#if __has_builtin(__is_nothrow_destructible) + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible : integral_constant<bool, __is_nothrow_destructible(_Tp)> {}; + +#else template <bool, class _Tp> struct __libcpp_is_nothrow_destructible; @@ -49,20 +51,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> : public true_type {}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> : public true_type {}; -#else - -template <class _Tp> -struct __libcpp_nothrow_destructor : public integral_constant<bool, is_scalar<_Tp>::value || is_reference<_Tp>::value> { -}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible : public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > { -}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> : public false_type {}; - -#endif +#endif // __has_builtin(__is_nothrow_destructible) #if _LIBCPP_STD_VER >= 17 template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h index 06b59e5c25..0b817e6509 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h @@ -11,16 +11,12 @@ #include <__config> #include <__type_traits/add_lvalue_reference.h> -#include <__type_traits/conditional.h> #include <__type_traits/enable_if.h> #include <__type_traits/is_assignable.h> #include <__type_traits/is_constructible.h> #include <__type_traits/is_nothrow_assignable.h> #include <__type_traits/is_nothrow_constructible.h> -#include <__type_traits/is_referenceable.h> -#include <__type_traits/is_same.h> -#include <__type_traits/is_void.h> -#include <__type_traits/nat.h> +#include <__type_traits/void_t.h> #include <__utility/declval.h> #include <cstddef> @@ -30,10 +26,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD +template <class _Tp, class _Up, class = void> +inline const bool __is_swappable_with_v = false; + template <class _Tp> -struct __is_swappable; +inline const bool __is_swappable_v = __is_swappable_with_v<_Tp&, _Tp&>; + +template <class _Tp, class _Up, bool = __is_swappable_with_v<_Tp, _Up> > +inline const bool __is_nothrow_swappable_with_v = false; + template <class _Tp> -struct __is_nothrow_swappable; +inline const bool __is_nothrow_swappable_v = __is_nothrow_swappable_with_v<_Tp&, _Tp&>; #ifndef _LIBCPP_CXX03_LANG template <class _Tp> @@ -47,85 +50,52 @@ template <class _Tp> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value); -template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) - _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value); +template <class _Tp, size_t _Np, __enable_if_t<__is_swappable_v<_Tp>, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable_v<_Tp>); -namespace __detail { // ALL generic swap overloads MUST already have a declaration available at this point. -template <class _Tp, class _Up = _Tp, bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value> -struct __swappable_with { - template <class _LHS, class _RHS> - static decltype(swap(std::declval<_LHS>(), std::declval<_RHS>())) __test_swap(int); - template <class, class> - static __nat __test_swap(long); - - // Extra parens are needed for the C++03 definition of decltype. - typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1; - typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2; - - static const bool value = _IsNotSame<__swap1, __nat>::value && _IsNotSame<__swap2, __nat>::value; -}; +template <class _Tp, class _Up> +inline const bool __is_swappable_with_v<_Tp, + _Up, + __void_t<decltype(swap(std::declval<_Tp>(), std::declval<_Up>())), + decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))> > = true; +#ifndef _LIBCPP_CXX03_LANG // C++03 doesn't have noexcept, so things are never nothrow swappable template <class _Tp, class _Up> -struct __swappable_with<_Tp, _Up, false> : false_type {}; - -template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _Up>::value> -struct __nothrow_swappable_with { - static const bool value = -#ifndef _LIBCPP_HAS_NO_NOEXCEPT - noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))&& noexcept( - swap(std::declval<_Up>(), std::declval<_Tp>())); -#else - false; +inline const bool __is_nothrow_swappable_with_v<_Tp, _Up, true> = + noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())) && + noexcept(swap(std::declval<_Up>(), std::declval<_Tp>())); #endif -}; -template <class _Tp, class _Up> -struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {}; +#if _LIBCPP_STD_VER >= 17 -} // namespace __detail +template <class _Tp, class _Up> +inline constexpr bool is_swappable_with_v = __is_swappable_with_v<_Tp, _Up>; -template <class _Tp> -struct __is_swappable : public integral_constant<bool, __detail::__swappable_with<_Tp&>::value> {}; +template <class _Tp, class _Up> +struct _LIBCPP_TEMPLATE_VIS is_swappable_with : bool_constant<is_swappable_with_v<_Tp, _Up>> {}; template <class _Tp> -struct __is_nothrow_swappable : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value> {}; - -#if _LIBCPP_STD_VER >= 17 - -template <class _Tp, class _Up> -struct _LIBCPP_TEMPLATE_VIS is_swappable_with - : public integral_constant<bool, __detail::__swappable_with<_Tp, _Up>::value> {}; +inline constexpr bool is_swappable_v = + is_swappable_with_v<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp>>; template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_swappable - : public __conditional_t<__libcpp_is_referenceable<_Tp>::value, - is_swappable_with<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp> >, - false_type> {}; +struct _LIBCPP_TEMPLATE_VIS is_swappable : bool_constant<is_swappable_v<_Tp>> {}; template <class _Tp, class _Up> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with - : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp, _Up>::value> {}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable - : public __conditional_t<__libcpp_is_referenceable<_Tp>::value, - is_nothrow_swappable_with<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp> >, - false_type> {}; +inline constexpr bool is_nothrow_swappable_with_v = __is_nothrow_swappable_with_v<_Tp, _Up>; template <class _Tp, class _Up> -inline constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value; +struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with : bool_constant<is_nothrow_swappable_with_v<_Tp, _Up>> {}; template <class _Tp> -inline constexpr bool is_swappable_v = is_swappable<_Tp>::value; - -template <class _Tp, class _Up> -inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; +inline constexpr bool is_nothrow_swappable_v = + is_nothrow_swappable_with_v<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp>>; template <class _Tp> -inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value; +struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable : bool_constant<is_nothrow_swappable_v<_Tp>> {}; #endif // _LIBCPP_STD_VER >= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h index 1a8a35f385..c1fc009d9b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h @@ -10,7 +10,6 @@ #define _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H #include <__config> -#include <__type_traits/apply_cv.h> #include <__type_traits/is_enum.h> #include <__type_traits/is_integral.h> #include <__type_traits/nat.h> @@ -70,7 +69,7 @@ template <> struct __make_signed<__uint128_t, true> {typedef __int128_t t // clang-format on template <class _Tp> -using __make_signed_t = __apply_cv_t<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>; +using __make_signed_t = __copy_cv_t<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>; #endif // __has_builtin(__make_signed) diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h index 98967371e7..282cd2d911 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h @@ -10,8 +10,8 @@ #define _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H #include <__config> -#include <__type_traits/apply_cv.h> #include <__type_traits/conditional.h> +#include <__type_traits/copy_cv.h> #include <__type_traits/is_enum.h> #include <__type_traits/is_integral.h> #include <__type_traits/is_unsigned.h> @@ -72,7 +72,7 @@ template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_ // clang-format on template <class _Tp> -using __make_unsigned_t = __apply_cv_t<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>; +using __make_unsigned_t = __copy_cv_t<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>; #endif // __has_builtin(__make_unsigned) diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h index e22b4a422c..2b2a6843b9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h @@ -11,8 +11,12 @@ #include <__config> #include <__type_traits/integral_constant.h> -#include <__type_traits/is_same.h> -#include <__utility/declval.h> +#include <__type_traits/is_arithmetic.h> + +#if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER == 1700 +# include <__type_traits/is_same.h> +# include <__utility/declval.h> +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -20,6 +24,34 @@ _LIBCPP_BEGIN_NAMESPACE_STD +// TODO(LLVM-20): Remove this workaround +#if !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER != 1700 + +template <class... _Args> +class __promote { + static_assert((is_arithmetic<_Args>::value && ...)); + + static float __test(float); + static double __test(char); + static double __test(int); + static double __test(unsigned); + static double __test(long); + static double __test(unsigned long); + static double __test(long long); + static double __test(unsigned long long); +# ifndef _LIBCPP_HAS_NO_INT128 + static double __test(__int128_t); + static double __test(__uint128_t); +# endif + static double __test(double); + static long double __test(long double); + +public: + using type = decltype((__test(_Args()) + ...)); +}; + +#else + template <class _Tp> struct __numeric_type { static void __test(...); @@ -31,10 +63,10 @@ struct __numeric_type { static double __test(unsigned long); static double __test(long long); static double __test(unsigned long long); -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 static double __test(__int128_t); static double __test(__uint128_t); -#endif +# endif static double __test(double); static long double __test(long double); @@ -89,6 +121,8 @@ public: template <class _A1, class _A2 = void, class _A3 = void> class __promote : public __promote_imp<_A1, _A2, _A3> {}; +#endif // !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 1700 + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_PROMOTE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h index 54390a1939..1048f67055 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h +++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h @@ -23,8 +23,13 @@ struct remove_pointer { using type _LIBCPP_NODEBUG = __remove_pointer(_Tp); }; +# ifdef _LIBCPP_COMPILER_GCC +template <class _Tp> +using __remove_pointer_t = typename remove_pointer<_Tp>::type; +# else template <class _Tp> using __remove_pointer_t = __remove_pointer(_Tp); +# endif #else // clang-format off template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;}; diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h b/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h index b7ad951259..582dd42f40 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 template <class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h index 93290be40e..9f732ca265 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h @@ -96,8 +96,8 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_exceptions); template <class _Rollback> struct __exception_guard_noexceptions { __exception_guard_noexceptions() = delete; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - _LIBCPP_NODEBUG explicit __exception_guard_noexceptions(_Rollback) {} + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG explicit __exception_guard_noexceptions(_Rollback) {} _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG __exception_guard_noexceptions(__exception_guard_noexceptions&& __other) diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/forward.h b/contrib/libs/cxxsupp/libcxx/include/__utility/forward.h index 010f2362bd..d5275dcbd0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/forward.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/forward.h @@ -21,13 +21,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& forward(_LIBCPP_LIFETIMEBOUND __libcpp_remove_reference_t<_Tp>& __t) _NOEXCEPT { return static_cast<_Tp&&>(__t); } template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& forward(_LIBCPP_LIFETIMEBOUND __libcpp_remove_reference_t<_Tp>&& __t) _NOEXCEPT { static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue"); return static_cast<_Tp&&>(__t); diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h b/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h index ce11b640fc..0206ce23a5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h @@ -34,8 +34,8 @@ template <class _Ap, class _Bp> using _ForwardLike = _OverrideRef<_Ap&&, _CopyConst<remove_reference_t<_Ap>, remove_reference_t<_Bp>>>; template <class _Tp, class _Up> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto forward_like(_LIBCPP_LIFETIMEBOUND _Up&& __ux) noexcept - -> _ForwardLike<_Tp, _Up> { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto +forward_like(_LIBCPP_LIFETIMEBOUND _Up&& __ux) noexcept -> _ForwardLike<_Tp, _Up> { return static_cast<_ForwardLike<_Tp, _Up>>(__ux); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h b/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h index 68cdfea6f9..4130b4ac70 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h @@ -17,6 +17,7 @@ #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> +#include <__utility/is_valid_range.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -32,24 +33,23 @@ struct __is_less_than_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() }; template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0> -_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool __is_pointer_in_range( - const _Tp* __begin, const _Tp* __end, const _Up* __ptr) { - if (__libcpp_is_constant_evaluated()) { - _LIBCPP_ASSERT_VALID_INPUT_RANGE(__builtin_constant_p(__begin <= __end), "__begin and __end do not form a range"); +_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool +__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) { + _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__begin, __end), "[__begin, __end) is not a valid range"); + if (__libcpp_is_constant_evaluated()) { // If this is not a constant during constant evaluation we know that __ptr is not part of the allocation where // [__begin, __end) is. if (!__builtin_constant_p(__begin <= __ptr && __ptr < __end)) return false; } - // Checking this for unrelated pointers is technically UB, but no compiler optimizes based on it (currently). return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end); } template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0> -_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool __is_pointer_in_range( - const _Tp* __begin, const _Tp* __end, const _Up* __ptr) { +_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool +__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) { if (__libcpp_is_constant_evaluated()) return false; diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/is_valid_range.h b/contrib/libs/cxxsupp/libcxx/include/__utility/is_valid_range.h new file mode 100644 index 0000000000..7286662dbf --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/is_valid_range.h @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// 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___UTILITY_IS_VALID_RANGE_H +#define _LIBCPP___UTILITY_IS_VALID_RANGE_H + +#include <__algorithm/comp.h> +#include <__config> +#include <__type_traits/is_constant_evaluated.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool +__is_valid_range(const _Tp* __first, const _Tp* __last) { + if (__libcpp_is_constant_evaluated()) { + // If this is not a constant during constant evaluation, that is because __first and __last are not + // part of the same allocation. If they are part of the same allocation, we must still make sure they + // are ordered properly. + return __builtin_constant_p(__first <= __last) && __first <= __last; + } + + return !__less<>()(__last, __first); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_IS_VALID_RANGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/move.h b/contrib/libs/cxxsupp/libcxx/include/__utility/move.h index 626535c8b1..b6a42db054 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/move.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/move.h @@ -26,7 +26,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __libcpp_remove_reference_t<_Tp>&& +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __libcpp_remove_reference_t<_Tp>&& move(_LIBCPP_LIFETIMEBOUND _Tp&& __t) _NOEXCEPT { typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up; return static_cast<_Up&&>(__t); @@ -37,7 +37,7 @@ using __move_if_noexcept_result_t = __conditional_t<!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, const _Tp&, _Tp&&>; template <class _Tp> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __move_if_noexcept_result_t<_Tp> +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __move_if_noexcept_result_t<_Tp> move_if_noexcept(_LIBCPP_LIFETIMEBOUND _Tp& __x) _NOEXCEPT { return std::move(__x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/no_destroy.h b/contrib/libs/cxxsupp/libcxx/include/__utility/no_destroy.h index f9c1eb7bed..8edd194577 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/no_destroy.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/no_destroy.h @@ -12,6 +12,7 @@ #include <__config> #include <__type_traits/is_constant_evaluated.h> #include <__utility/forward.h> +#include <new> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -29,33 +30,23 @@ struct __uninitialized_tag {}; // initialization using __emplace. template <class _Tp> struct __no_destroy { - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI explicit __no_destroy(__uninitialized_tag) : __dummy_() { - if (__libcpp_is_constant_evaluated()) { - __dummy_ = char(); - } - } - _LIBCPP_HIDE_FROM_ABI ~__no_destroy() { - // nothing - } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy(__uninitialized_tag) : __obj_() {} template <class... _Args> - _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI explicit __no_destroy(_Args&&... __args) - : __obj_(std::forward<_Args>(__args)...) {} + _LIBCPP_HIDE_FROM_ABI explicit __no_destroy(_Args&&... __args) { + ::new ((void*)__obj_) _Tp(std::forward<_Args>(__args)...); + } template <class... _Args> - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp& __emplace(_Args&&... __args) { - new (&__obj_) _Tp(std::forward<_Args>(__args)...); - return __obj_; + _LIBCPP_HIDE_FROM_ABI _Tp& __emplace(_Args&&... __args) { + return *(::new ((void*)__obj_) _Tp(std::forward<_Args>(__args)...)); } - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp& __get() { return __obj_; } - _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp const& __get() const { return __obj_; } + _LIBCPP_HIDE_FROM_ABI _Tp& __get() { return *reinterpret_cast<_Tp*>(__obj_); } + _LIBCPP_HIDE_FROM_ABI _Tp const& __get() const { return *reinterpret_cast<const _Tp*>(__obj_); } private: - union { - _Tp __obj_; - char __dummy_; // so we can initialize a member even with __uninitialized_tag for constexpr-friendliness - }; + _ALIGNAS_TYPE(_Tp) char __obj_[sizeof(_Tp)]; }; _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h index e05250ba05..0afbebcdc9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h @@ -34,6 +34,7 @@ #include <__type_traits/is_nothrow_constructible.h> #include <__type_traits/is_same.h> #include <__type_traits/is_swappable.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/nat.h> #include <__type_traits/remove_cvref.h> #include <__type_traits/unwrap_ref.h> @@ -71,6 +72,11 @@ struct _LIBCPP_TEMPLATE_VIS pair _T1 first; _T2 second; + using __trivially_relocatable = + __conditional_t<__libcpp_is_trivially_relocatable<_T1>::value && __libcpp_is_trivially_relocatable<_T2>::value, + pair, + void>; + _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default; _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default; @@ -129,16 +135,16 @@ struct _LIBCPP_TEMPLATE_VIS pair typename conditional< _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_default(), int> = 0> - explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair() - _NOEXCEPT_( - is_nothrow_default_constructible<first_type>::value&& is_nothrow_default_constructible<second_type>::value) + explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept( + is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value) : first(), second() {} template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - !_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>()) pair(_T1 const& __t1, _T2 const& __t2) - _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value&& is_nothrow_copy_constructible<second_type>::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>()) + pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value && + is_nothrow_copy_constructible<second_type>::value) : first(__t1), second(__t2) {} template < @@ -151,9 +157,8 @@ struct _LIBCPP_TEMPLATE_VIS pair # endif __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0 > _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) - pair(_U1&& __u1, _U2&& __u2) - _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value && - is_nothrow_constructible<second_type, _U2>::value)) + pair(_U1&& __u1, _U2&& __u2) noexcept(is_nothrow_constructible<first_type, _U1>::value && + is_nothrow_constructible<second_type, _U2>::value) : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) { } @@ -168,17 +173,16 @@ struct _LIBCPP_TEMPLATE_VIS pair template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1 const&, _U2 const&>(), int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - !_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>()) pair(pair<_U1, _U2> const& __p) - _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value && - is_nothrow_constructible<second_type, _U2 const&>::value)) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>()) + pair(pair<_U1, _U2> const& __p) noexcept(is_nothrow_constructible<first_type, _U1 const&>::value && + is_nothrow_constructible<second_type, _U2 const&>::value) : first(__p.first), second(__p.second) {} template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) - pair(pair<_U1, _U2>&& __p) - _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value && - is_nothrow_constructible<second_type, _U2&&>::value)) + pair(pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, _U1&&>::value && + is_nothrow_constructible<second_type, _U2&&>::value) : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {} # if _LIBCPP_STD_VER >= 23 @@ -212,8 +216,8 @@ struct _LIBCPP_TEMPLATE_VIS pair template <class... _Args1, class... _Args2> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) _NOEXCEPT_( - is_nothrow_constructible<first_type, _Args1...>::value&& is_nothrow_constructible<second_type, _Args2...>::value) + pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept( + is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value) : pair(__pc, __first_args, __second_args, @@ -221,19 +225,19 @@ struct _LIBCPP_TEMPLATE_VIS pair typename __make_tuple_indices<sizeof...(_Args2) >::type()) {} _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& - operator=(__conditional_t< is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value, - pair, - __nat> const& __p) - _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value&& is_nothrow_copy_assignable<second_type>::value) { + operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value, + pair, + __nat> const& __p) noexcept(is_nothrow_copy_assignable<first_type>::value && + is_nothrow_copy_assignable<second_type>::value) { first = __p.first; second = __p.second; return *this; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=( - __conditional_t< is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&& - __p) - _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value&& is_nothrow_move_assignable<second_type>::value) { + __conditional_t<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&& + __p) noexcept(is_nothrow_move_assignable<first_type>::value && + is_nothrow_move_assignable<second_type>::value) { first = std::forward<first_type>(__p.first); second = std::forward<second_type>(__p.second); return *this; @@ -260,6 +264,7 @@ struct _LIBCPP_TEMPLATE_VIS pair } # if _LIBCPP_STD_VER >= 23 + template <class = void> _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair const& __p) const noexcept(is_nothrow_copy_assignable_v<const first_type> && is_nothrow_copy_assignable_v<const second_type>) requires(is_copy_assignable_v<const first_type> && is_copy_assignable_v<const second_type>) @@ -269,6 +274,7 @@ struct _LIBCPP_TEMPLATE_VIS pair return *this; } + template <class = void> _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair&& __p) const noexcept(is_nothrow_assignable_v<const first_type&, first_type> && is_nothrow_assignable_v<const second_type&, second_type>) @@ -408,7 +414,7 @@ struct _LIBCPP_TEMPLATE_VIS pair #endif // _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair& __p) - _NOEXCEPT_(__is_nothrow_swappable<first_type>::value&& __is_nothrow_swappable<second_type>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<first_type>&& __is_nothrow_swappable_v<second_type>) { using std::swap; swap(first, __p.first); swap(second, __p.second); @@ -416,7 +422,7 @@ struct _LIBCPP_TEMPLATE_VIS pair #if _LIBCPP_STD_VER >= 23 _LIBCPP_HIDE_FROM_ABI constexpr void swap(const pair& __p) const - noexcept(__is_nothrow_swappable<const first_type>::value && __is_nothrow_swappable<const second_type>::value) { + noexcept(__is_nothrow_swappable_v<const first_type> && __is_nothrow_swappable_v<const second_type>) { using std::swap; swap(first, __p.first); swap(second, __p.second); @@ -512,15 +518,15 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> { }; #endif // _LIBCPP_STD_VER >= 23 -template <class _T1, class _T2, __enable_if_t<__is_swappable<_T1>::value && __is_swappable<_T2>::value, int> = 0> +template <class _T1, class _T2, __enable_if_t<__is_swappable_v<_T1> && __is_swappable_v<_T2>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) - _NOEXCEPT_(__is_nothrow_swappable<_T1>::value&& __is_nothrow_swappable<_T2>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) { __x.swap(__y); } #if _LIBCPP_STD_VER >= 23 template <class _T1, class _T2> - requires(__is_swappable<const _T1>::value && __is_swappable<const _T2>::value) + requires(__is_swappable_v<const _T1> && __is_swappable_v<const _T2>) _LIBCPP_HIDE_FROM_ABI constexpr void swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); @@ -528,9 +534,9 @@ swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x #endif template <class _T1, class _T2> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> - make_pair(_T1&& __t1, _T2&& __t2) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX14 pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> +make_pair(_T1&& __t1, _T2&& __t2) { return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>( std::forward<_T1>(__t1), std::forward<_T2>(__t2)); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/private_constructor_tag.h b/contrib/libs/cxxsupp/libcxx/include/__utility/private_constructor_tag.h new file mode 100644 index 0000000000..462cab48c9 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/private_constructor_tag.h @@ -0,0 +1,28 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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__UTILITY_PRIVATE_CONSTRUCTOR_TAG_H +#define _LIBCPP__UTILITY_PRIVATE_CONSTRUCTOR_TAG_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// This tag allows defining non-standard exposition-only constructors while +// preventing users from being able to use them, since this reserved-name tag +// needs to be used. +struct __private_constructor_tag {}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP__UTILITY_PRIVATE_CONSTRUCTOR_TAG_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h b/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h index d678d2cba7..ab88b8e0a0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h @@ -44,9 +44,9 @@ inline _LIBCPP_HIDE_FROM_ABI __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CXX20 __y = std::move(__t); } -template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> > +template <class _Tp, size_t _Np, __enable_if_t<__is_swappable_v<_Tp>, int> > inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) - _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<_Tp>) { for (size_t __i = 0; __i != _Np; ++__i) { swap(__a[__i], __b[__i]); } diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h b/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h index 5fdf0f255e..77587108f2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h @@ -28,7 +28,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr typename underlying_type<_Tp>::type __to_underly #if _LIBCPP_STD_VER >= 23 template <class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr underlying_type_t<_Tp> to_underlying(_Tp __val) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr underlying_type_t<_Tp> to_underlying(_Tp __val) noexcept { return std::__to_underlying(__val); } #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__verbose_abort b/contrib/libs/cxxsupp/libcxx/include/__verbose_abort index 259c70dda8..195ce65b72 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__verbose_abort +++ b/contrib/libs/cxxsupp/libcxx/include/__verbose_abort @@ -10,7 +10,6 @@ #ifndef _LIBCPP___VERBOSE_ABORT #define _LIBCPP___VERBOSE_ABORT -#include <__availability> #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -22,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // This function should never be called directly from the code -- it should only be called through // the _LIBCPP_VERBOSE_ABORT macro. _LIBCPP_NORETURN _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS - _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...); +_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...); // _LIBCPP_VERBOSE_ABORT(format, args...) // diff --git a/contrib/libs/cxxsupp/libcxx/include/algorithm b/contrib/libs/cxxsupp/libcxx/include/algorithm index 0f62de7fa8..a522a60f1b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/algorithm +++ b/contrib/libs/cxxsupp/libcxx/include/algorithm @@ -1794,15 +1794,11 @@ template <class BidirectionalIterator, class Compare> */ #include <__config> -#include <version> #include <__algorithm/adjacent_find.h> #include <__algorithm/all_of.h> #include <__algorithm/any_of.h> #include <__algorithm/binary_search.h> -#include <__algorithm/clamp.h> -#include <__algorithm/comp.h> -#include <__algorithm/comp_ref_type.h> #include <__algorithm/copy.h> #include <__algorithm/copy_backward.h> #include <__algorithm/copy_if.h> @@ -1818,18 +1814,9 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/find_first_of.h> #include <__algorithm/find_if.h> #include <__algorithm/find_if_not.h> -#include <__algorithm/fold.h> #include <__algorithm/for_each.h> -#include <__algorithm/for_each_n.h> #include <__algorithm/generate.h> #include <__algorithm/generate_n.h> -#include <__algorithm/half_positive.h> -#include <__algorithm/in_found_result.h> -#include <__algorithm/in_fun_result.h> -#include <__algorithm/in_in_out_result.h> -#include <__algorithm/in_in_result.h> -#include <__algorithm/in_out_out_result.h> -#include <__algorithm/in_out_result.h> #include <__algorithm/includes.h> #include <__algorithm/inplace_merge.h> #include <__algorithm/is_heap.h> @@ -1840,7 +1827,6 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/is_sorted_until.h> #include <__algorithm/iter_swap.h> #include <__algorithm/lexicographical_compare.h> -#include <__algorithm/lexicographical_compare_three_way.h> #include <__algorithm/lower_bound.h> #include <__algorithm/make_heap.h> #include <__algorithm/max.h> @@ -1848,7 +1834,6 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/merge.h> #include <__algorithm/min.h> #include <__algorithm/min_element.h> -#include <__algorithm/min_max_result.h> #include <__algorithm/minmax.h> #include <__algorithm/minmax_element.h> #include <__algorithm/mismatch.h> @@ -1864,112 +1849,7 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/partition_point.h> #include <__algorithm/pop_heap.h> #include <__algorithm/prev_permutation.h> -#include <__algorithm/pstl_any_all_none_of.h> -#include <__algorithm/pstl_copy.h> -#include <__algorithm/pstl_count.h> -#include <__algorithm/pstl_equal.h> -#include <__algorithm/pstl_fill.h> -#include <__algorithm/pstl_find.h> -#include <__algorithm/pstl_for_each.h> -#include <__algorithm/pstl_generate.h> -#include <__algorithm/pstl_is_partitioned.h> -#include <__algorithm/pstl_merge.h> -#include <__algorithm/pstl_move.h> -#include <__algorithm/pstl_replace.h> -#include <__algorithm/pstl_rotate_copy.h> -#include <__algorithm/pstl_sort.h> -#include <__algorithm/pstl_stable_sort.h> -#include <__algorithm/pstl_transform.h> #include <__algorithm/push_heap.h> -#include <__algorithm/ranges_adjacent_find.h> -#include <__algorithm/ranges_all_of.h> -#include <__algorithm/ranges_any_of.h> -#include <__algorithm/ranges_binary_search.h> -#include <__algorithm/ranges_clamp.h> -#include <__algorithm/ranges_contains.h> -#include <__algorithm/ranges_contains_subrange.h> -#include <__algorithm/ranges_copy.h> -#include <__algorithm/ranges_copy_backward.h> -#include <__algorithm/ranges_copy_if.h> -#include <__algorithm/ranges_copy_n.h> -#include <__algorithm/ranges_count.h> -#include <__algorithm/ranges_count_if.h> -#include <__algorithm/ranges_ends_with.h> -#include <__algorithm/ranges_equal.h> -#include <__algorithm/ranges_equal_range.h> -#include <__algorithm/ranges_fill.h> -#include <__algorithm/ranges_fill_n.h> -#include <__algorithm/ranges_find.h> -#include <__algorithm/ranges_find_end.h> -#include <__algorithm/ranges_find_first_of.h> -#include <__algorithm/ranges_find_if.h> -#include <__algorithm/ranges_find_if_not.h> -#include <__algorithm/ranges_for_each.h> -#include <__algorithm/ranges_for_each_n.h> -#include <__algorithm/ranges_generate.h> -#include <__algorithm/ranges_generate_n.h> -#include <__algorithm/ranges_includes.h> -#include <__algorithm/ranges_inplace_merge.h> -#include <__algorithm/ranges_is_heap.h> -#include <__algorithm/ranges_is_heap_until.h> -#include <__algorithm/ranges_is_partitioned.h> -#include <__algorithm/ranges_is_permutation.h> -#include <__algorithm/ranges_is_sorted.h> -#include <__algorithm/ranges_is_sorted_until.h> -#include <__algorithm/ranges_lexicographical_compare.h> -#include <__algorithm/ranges_lower_bound.h> -#include <__algorithm/ranges_make_heap.h> -#include <__algorithm/ranges_max.h> -#include <__algorithm/ranges_max_element.h> -#include <__algorithm/ranges_merge.h> -#include <__algorithm/ranges_min.h> -#include <__algorithm/ranges_min_element.h> -#include <__algorithm/ranges_minmax.h> -#include <__algorithm/ranges_minmax_element.h> -#include <__algorithm/ranges_mismatch.h> -#include <__algorithm/ranges_move.h> -#include <__algorithm/ranges_move_backward.h> -#include <__algorithm/ranges_next_permutation.h> -#include <__algorithm/ranges_none_of.h> -#include <__algorithm/ranges_nth_element.h> -#include <__algorithm/ranges_partial_sort.h> -#include <__algorithm/ranges_partial_sort_copy.h> -#include <__algorithm/ranges_partition.h> -#include <__algorithm/ranges_partition_copy.h> -#include <__algorithm/ranges_partition_point.h> -#include <__algorithm/ranges_pop_heap.h> -#include <__algorithm/ranges_prev_permutation.h> -#include <__algorithm/ranges_push_heap.h> -#include <__algorithm/ranges_remove.h> -#include <__algorithm/ranges_remove_copy.h> -#include <__algorithm/ranges_remove_copy_if.h> -#include <__algorithm/ranges_remove_if.h> -#include <__algorithm/ranges_replace.h> -#include <__algorithm/ranges_replace_copy.h> -#include <__algorithm/ranges_replace_copy_if.h> -#include <__algorithm/ranges_replace_if.h> -#include <__algorithm/ranges_reverse.h> -#include <__algorithm/ranges_reverse_copy.h> -#include <__algorithm/ranges_rotate.h> -#include <__algorithm/ranges_rotate_copy.h> -#include <__algorithm/ranges_sample.h> -#include <__algorithm/ranges_search.h> -#include <__algorithm/ranges_search_n.h> -#include <__algorithm/ranges_set_difference.h> -#include <__algorithm/ranges_set_intersection.h> -#include <__algorithm/ranges_set_symmetric_difference.h> -#include <__algorithm/ranges_set_union.h> -#include <__algorithm/ranges_shuffle.h> -#include <__algorithm/ranges_sort.h> -#include <__algorithm/ranges_sort_heap.h> -#include <__algorithm/ranges_stable_partition.h> -#include <__algorithm/ranges_stable_sort.h> -#include <__algorithm/ranges_starts_with.h> -#include <__algorithm/ranges_swap_ranges.h> -#include <__algorithm/ranges_transform.h> -#include <__algorithm/ranges_unique.h> -#include <__algorithm/ranges_unique_copy.h> -#include <__algorithm/ranges_upper_bound.h> #include <__algorithm/remove.h> #include <__algorithm/remove_copy.h> #include <__algorithm/remove_copy_if.h> @@ -1982,17 +1862,13 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/reverse_copy.h> #include <__algorithm/rotate.h> #include <__algorithm/rotate_copy.h> -#include <__algorithm/sample.h> #include <__algorithm/search.h> #include <__algorithm/search_n.h> #include <__algorithm/set_difference.h> #include <__algorithm/set_intersection.h> #include <__algorithm/set_symmetric_difference.h> #include <__algorithm/set_union.h> -#include <__algorithm/shift_left.h> -#include <__algorithm/shift_right.h> #include <__algorithm/shuffle.h> -#include <__algorithm/sift_down.h> #include <__algorithm/sort.h> #include <__algorithm/sort_heap.h> #include <__algorithm/stable_partition.h> @@ -2001,9 +1877,123 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/transform.h> #include <__algorithm/unique.h> #include <__algorithm/unique_copy.h> -#include <__algorithm/unwrap_iter.h> #include <__algorithm/upper_bound.h> +#if _LIBCPP_STD_VER >= 17 +# include <__algorithm/clamp.h> +# include <__algorithm/for_each_n.h> +# include <__algorithm/pstl.h> +# include <__algorithm/sample.h> +#endif // _LIBCPP_STD_VER >= 17 + +#if _LIBCPP_STD_VER >= 20 +# include <__algorithm/in_found_result.h> +# include <__algorithm/in_fun_result.h> +# include <__algorithm/in_in_out_result.h> +# include <__algorithm/in_in_result.h> +# include <__algorithm/in_out_out_result.h> +# include <__algorithm/in_out_result.h> +# include <__algorithm/lexicographical_compare_three_way.h> +# include <__algorithm/min_max_result.h> +# include <__algorithm/ranges_adjacent_find.h> +# include <__algorithm/ranges_all_of.h> +# include <__algorithm/ranges_any_of.h> +# include <__algorithm/ranges_binary_search.h> +# include <__algorithm/ranges_clamp.h> +# include <__algorithm/ranges_contains.h> +# include <__algorithm/ranges_copy.h> +# include <__algorithm/ranges_copy_backward.h> +# include <__algorithm/ranges_copy_if.h> +# include <__algorithm/ranges_copy_n.h> +# include <__algorithm/ranges_count.h> +# include <__algorithm/ranges_count_if.h> +# include <__algorithm/ranges_equal.h> +# include <__algorithm/ranges_equal_range.h> +# include <__algorithm/ranges_fill.h> +# include <__algorithm/ranges_fill_n.h> +# include <__algorithm/ranges_find.h> +# include <__algorithm/ranges_find_end.h> +# include <__algorithm/ranges_find_first_of.h> +# include <__algorithm/ranges_find_if.h> +# include <__algorithm/ranges_find_if_not.h> +# include <__algorithm/ranges_for_each.h> +# include <__algorithm/ranges_for_each_n.h> +# include <__algorithm/ranges_generate.h> +# include <__algorithm/ranges_generate_n.h> +# include <__algorithm/ranges_includes.h> +# include <__algorithm/ranges_inplace_merge.h> +# include <__algorithm/ranges_is_heap.h> +# include <__algorithm/ranges_is_heap_until.h> +# include <__algorithm/ranges_is_partitioned.h> +# include <__algorithm/ranges_is_permutation.h> +# include <__algorithm/ranges_is_sorted.h> +# include <__algorithm/ranges_is_sorted_until.h> +# include <__algorithm/ranges_lexicographical_compare.h> +# include <__algorithm/ranges_lower_bound.h> +# include <__algorithm/ranges_make_heap.h> +# include <__algorithm/ranges_max.h> +# include <__algorithm/ranges_max_element.h> +# include <__algorithm/ranges_merge.h> +# include <__algorithm/ranges_min.h> +# include <__algorithm/ranges_min_element.h> +# include <__algorithm/ranges_minmax.h> +# include <__algorithm/ranges_minmax_element.h> +# include <__algorithm/ranges_mismatch.h> +# include <__algorithm/ranges_move.h> +# include <__algorithm/ranges_move_backward.h> +# include <__algorithm/ranges_next_permutation.h> +# include <__algorithm/ranges_none_of.h> +# include <__algorithm/ranges_nth_element.h> +# include <__algorithm/ranges_partial_sort.h> +# include <__algorithm/ranges_partial_sort_copy.h> +# include <__algorithm/ranges_partition.h> +# include <__algorithm/ranges_partition_copy.h> +# include <__algorithm/ranges_partition_point.h> +# include <__algorithm/ranges_pop_heap.h> +# include <__algorithm/ranges_prev_permutation.h> +# include <__algorithm/ranges_push_heap.h> +# include <__algorithm/ranges_remove.h> +# include <__algorithm/ranges_remove_copy.h> +# include <__algorithm/ranges_remove_copy_if.h> +# include <__algorithm/ranges_remove_if.h> +# include <__algorithm/ranges_replace.h> +# include <__algorithm/ranges_replace_copy.h> +# include <__algorithm/ranges_replace_copy_if.h> +# include <__algorithm/ranges_replace_if.h> +# include <__algorithm/ranges_reverse.h> +# include <__algorithm/ranges_reverse_copy.h> +# include <__algorithm/ranges_rotate.h> +# include <__algorithm/ranges_rotate_copy.h> +# include <__algorithm/ranges_sample.h> +# include <__algorithm/ranges_search.h> +# include <__algorithm/ranges_search_n.h> +# include <__algorithm/ranges_set_difference.h> +# include <__algorithm/ranges_set_intersection.h> +# include <__algorithm/ranges_set_symmetric_difference.h> +# include <__algorithm/ranges_set_union.h> +# include <__algorithm/ranges_shuffle.h> +# include <__algorithm/ranges_sort.h> +# include <__algorithm/ranges_sort_heap.h> +# include <__algorithm/ranges_stable_partition.h> +# include <__algorithm/ranges_stable_sort.h> +# include <__algorithm/ranges_swap_ranges.h> +# include <__algorithm/ranges_transform.h> +# include <__algorithm/ranges_unique.h> +# include <__algorithm/ranges_unique_copy.h> +# include <__algorithm/ranges_upper_bound.h> +# include <__algorithm/shift_left.h> +# include <__algorithm/shift_right.h> +#endif + +#if _LIBCPP_STD_VER >= 23 +# include <__algorithm/fold.h> +# include <__algorithm/ranges_contains_subrange.h> +# include <__algorithm/ranges_ends_with.h> +# include <__algorithm/ranges_starts_with.h> +#endif // _LIBCPP_STD_VER >= 23 + +#include <version> + // standard-mandated includes // [algorithm.syn] @@ -2013,6 +2003,10 @@ template <class BidirectionalIterator, class Compare> # pragma GCC system_header #endif +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 14 +# include <execution> +#endif + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <atomic> # include <bit> diff --git a/contrib/libs/cxxsupp/libcxx/include/any b/contrib/libs/cxxsupp/libcxx/include/any index 0e66890593..5def14dc87 100644 --- a/contrib/libs/cxxsupp/libcxx/include/any +++ b/contrib/libs/cxxsupp/libcxx/include/any @@ -205,7 +205,7 @@ public: template < class _ValueType, class _Tp = decay_t<_ValueType>, class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value); template <class _ValueType, @@ -219,7 +219,7 @@ public: class... _Args, class _Tp = decay_t<_ValueType>, class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args); _LIBCPP_HIDE_FROM_ABI ~any() { this->reset(); } @@ -251,7 +251,7 @@ public: class... _Args, class _Tp = decay_t<_ValueType>, class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> > + is_copy_constructible<_Tp>::value> > _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...); // 6.3.3 any modifiers diff --git a/contrib/libs/cxxsupp/libcxx/include/array b/contrib/libs/cxxsupp/libcxx/include/array index 977f913c3e..6ffde852f4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/array +++ b/contrib/libs/cxxsupp/libcxx/include/array @@ -130,6 +130,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce #include <__type_traits/is_nothrow_constructible.h> #include <__type_traits/is_same.h> #include <__type_traits/is_swappable.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/remove_cv.h> #include <__utility/empty.h> #include <__utility/integer_sequence.h> @@ -166,6 +167,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array { + using __trivially_relocatable = __conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, array, void>; + // types: using __self = array; using value_type = _Tp; @@ -192,8 +195,7 @@ struct _LIBCPP_TEMPLATE_VIS array { std::fill_n(data(), _Size, __u); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(array& __a) - _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable_v<_Tp>) { std::swap_ranges(data(), data() + _Size, __a.data()); } @@ -230,9 +232,7 @@ struct _LIBCPP_TEMPLATE_VIS array { // capacity: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return _Size; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return _Size; } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { - return _Size == 0; - } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return _Size == 0; } // element access: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type __n) _NOEXCEPT { @@ -335,7 +335,7 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> { // capacity: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return 0; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT { return 0; } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return true; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return true; } // element access: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type) _NOEXCEPT { @@ -423,12 +423,12 @@ template <class _Tp, size_t _Size> _LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp> operator<=>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); + __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 -template <class _Tp, size_t _Size, __enable_if_t<_Size == 0 || __is_swappable<_Tp>::value, int> = 0> +template <class _Tp, size_t _Size, __enable_if_t<_Size == 0 || __is_swappable_v<_Tp>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y) _NOEXCEPT_(noexcept(__x.swap(__y))) { __x.swap(__y); diff --git a/contrib/libs/cxxsupp/libcxx/include/atomic b/contrib/libs/cxxsupp/libcxx/include/atomic index cb142b09bf..80a0f9ee37 100644 --- a/contrib/libs/cxxsupp/libcxx/include/atomic +++ b/contrib/libs/cxxsupp/libcxx/include/atomic @@ -599,6 +599,7 @@ template <class T> #include <__atomic/atomic_flag.h> #include <__atomic/atomic_init.h> #include <__atomic/atomic_lock_free.h> +#include <__atomic/atomic_ref.h> #include <__atomic/atomic_sync.h> #include <__atomic/check_memory_order.h> #include <__atomic/contention_t.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/barrier b/contrib/libs/cxxsupp/libcxx/include/barrier index c5fd84b919..12608e17d8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/barrier +++ b/contrib/libs/cxxsupp/libcxx/include/barrier @@ -54,7 +54,6 @@ namespace std #include <__assert> #include <__atomic/atomic_base.h> #include <__atomic/memory_order.h> -#include <__availability> #include <__memory/unique_ptr.h> #include <__thread/poll_with_backoff.h> #include <__thread/timed_backoff_policy.h> @@ -103,10 +102,10 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected); _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI bool -__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase); +__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) noexcept; _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void -__destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier); +__destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) noexcept; template <class _CompletionF> class __barrier_base { @@ -128,7 +127,7 @@ public: __expected_adjustment_(0), __completion_(std::move(__completion)), __phase_(0) {} - [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update) { + _LIBCPP_NODISCARD _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update) { _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( __update <= __expected_, "update is greater than the expected count for the current barrier phase"); @@ -257,7 +256,7 @@ public: # endif // !_LIBCPP_HAS_NO_TREE_BARRIER template <class _CompletionF = __empty_completion> -class barrier { +class _LIBCPP_DEPRECATED_ATOMIC_SYNC barrier { __barrier_base<_CompletionF> __b_; public: @@ -265,8 +264,8 @@ public: static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return __barrier_base<_CompletionF>::max(); } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI explicit barrier( - ptrdiff_t __count, _CompletionF __completion = _CompletionF()) + _LIBCPP_AVAILABILITY_SYNC + _LIBCPP_HIDE_FROM_ABI explicit barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF()) : __b_(__count, std::move(__completion)) { _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( __count >= 0, @@ -280,7 +279,7 @@ public: barrier(barrier const&) = delete; barrier& operator=(barrier const&) = delete; - [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update = 1) { + _LIBCPP_NODISCARD _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI arrival_token arrive(ptrdiff_t __update = 1) { _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__update > 0, "barrier:arrive must be called with a value greater than 0"); return __b_.arrive(__update); } diff --git a/contrib/libs/cxxsupp/libcxx/include/bit b/contrib/libs/cxxsupp/libcxx/include/bit index b8e4bdc2df..94387d101a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/bit +++ b/contrib/libs/cxxsupp/libcxx/include/bit @@ -61,26 +61,36 @@ namespace std { */ -#include <__bit/bit_cast.h> -#include <__bit/bit_ceil.h> -#include <__bit/bit_floor.h> -#include <__bit/bit_log2.h> -#include <__bit/bit_width.h> -#include <__bit/blsr.h> -#include <__bit/byteswap.h> -#include <__bit/countl.h> -#include <__bit/countr.h> -#include <__bit/endian.h> -#include <__bit/has_single_bit.h> -#include <__bit/popcount.h> -#include <__bit/rotate.h> #include <__config> + +#if _LIBCPP_STD_VER >= 20 +# include <__bit/bit_cast.h> +# include <__bit/bit_ceil.h> +# include <__bit/bit_floor.h> +# include <__bit/bit_log2.h> +# include <__bit/bit_width.h> +# include <__bit/countl.h> +# include <__bit/countr.h> +# include <__bit/endian.h> +# include <__bit/has_single_bit.h> +# include <__bit/popcount.h> +# include <__bit/rotate.h> +#endif + +#if _LIBCPP_STD_VER >= 23 +# include <__bit/byteswap.h> +#endif + #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 +# include <cstdint> +#endif + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <cstdlib> # include <iosfwd> diff --git a/contrib/libs/cxxsupp/libcxx/include/bitset b/contrib/libs/cxxsupp/libcxx/include/bitset index 8818ab6563..6bd7bfe585 100644 --- a/contrib/libs/cxxsupp/libcxx/include/bitset +++ b/contrib/libs/cxxsupp/libcxx/include/bitset @@ -375,8 +375,11 @@ template <size_t _N_words, size_t _Size> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const { unsigned long long __r = __first_[0]; + _LIBCPP_DIAGNOSTIC_PUSH + _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow") for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i) __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT); + _LIBCPP_DIAGNOSTIC_POP return __r; } diff --git a/contrib/libs/cxxsupp/libcxx/include/charconv b/contrib/libs/cxxsupp/libcxx/include/charconv index 5bc7b9011b..a2e270e931 100644 --- a/contrib/libs/cxxsupp/libcxx/include/charconv +++ b/contrib/libs/cxxsupp/libcxx/include/charconv @@ -69,18 +69,21 @@ namespace std { */ -#include <__charconv/chars_format.h> -#include <__charconv/from_chars_integral.h> -#include <__charconv/from_chars_result.h> -#include <__charconv/tables.h> -#include <__charconv/to_chars.h> -#include <__charconv/to_chars_base_10.h> -#include <__charconv/to_chars_floating_point.h> -#include <__charconv/to_chars_integral.h> -#include <__charconv/to_chars_result.h> -#include <__charconv/traits.h> #include <__config> -#include <__system_error/errc.h> + +#if _LIBCPP_STD_VER >= 17 +# include <__charconv/chars_format.h> +# include <__charconv/from_chars_integral.h> +# include <__charconv/from_chars_result.h> +# include <__charconv/tables.h> +# include <__charconv/to_chars.h> +# include <__charconv/to_chars_base_10.h> +# include <__charconv/to_chars_floating_point.h> +# include <__charconv/to_chars_integral.h> +# include <__charconv/to_chars_result.h> +# include <__charconv/traits.h> +#endif // _LIBCPP_STD_VER >= 17 + #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -91,6 +94,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14 +# include <cerrno> +# include <cstddef> +# include <initializer_list> +# include <new> +#endif + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <cmath> # include <concepts> diff --git a/contrib/libs/cxxsupp/libcxx/include/chrono b/contrib/libs/cxxsupp/libcxx/include/chrono index 956badd368..23441ddb23 100644 --- a/contrib/libs/cxxsupp/libcxx/include/chrono +++ b/contrib/libs/cxxsupp/libcxx/include/chrono @@ -688,6 +688,10 @@ struct tzdb { string version; vector<time_zone> zones; vector<time_zone_link> links; + vector<leap_second> leap_seconds; + + const time_zone* locate_zone(string_view tz_name) const; + const time_zone* current_zone() const; }; class tzdb_list { // C++20 @@ -713,11 +717,44 @@ public: // [time.zone.db.access], time zone database access const tzdb& get_tzdb(); // C++20 tzdb_list& get_tzdb_list(); // C++20 +const time_zone* locate_zone(string_view tz_name); // C++20 +const time_zone* current_zone() // C++20 // [time.zone.db.remote], remote time zone database support const tzdb& reload_tzdb(); // C++20 string remote_version(); // C++20 +// [time.zone.exception], exception classes +class nonexistent_local_time; // C++20 +class ambiguous_local_time; // C++20 + +// [time.zone.info], information classes +struct sys_info { // C++20 + sys_seconds begin; + sys_seconds end; + seconds offset; + minutes save; + string abbrev; +}; + +template<class charT, class traits> // C++20 + basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const sys_info& si); + +struct local_info { // C++20 + static constexpr int unique = 0; + static constexpr int nonexistent = 1; + static constexpr int ambiguous = 2; + + int result; + sys_info first; + sys_info second; +}; + +template<class charT, class traits> // C++20 + basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const local_info& li); + // 25.10.5, class time_zone // C++20 enum class choose {earliest, latest}; class time_zone { @@ -727,10 +764,68 @@ class time_zone { // unspecified additional constructors string_view name() const noexcept; + + template<class Duration> + sys_info get_info(const sys_time<Duration>& st) const; + + template<class Duration> + local_info get_info(const local_time<Duration>& tp) const; + + template<class Duration> + sys_time<common_type_t<Duration, seconds>> + to_sys(const local_time<Duration>& tp) const; + + template<class Duration> + sys_time<common_type_t<Duration, seconds>> + to_sys(const local_time<Duration>& tp, choose z) const; + + template<class Duration> + local_time<common_type_t<Duration, seconds>> + to_local(const sys_time<Duration>& tp) const; }; bool operator==(const time_zone& x, const time_zone& y) noexcept; // C++20 strong_ordering operator<=>(const time_zone& x, const time_zone& y) noexcept; // C++20 +// [time.zone.zonedtraits], class template zoned_traits +template<class T> struct zoned_traits; // C++20 + +// [time.zone.leap], leap second support +class leap_second { // C++20 +public: + leap_second(const leap_second&) = default; + leap_second& operator=(const leap_second&) = default; + + // unspecified additional constructors + + constexpr sys_seconds date() const noexcept; + constexpr seconds value() const noexcept; +}; + +constexpr bool operator==(const leap_second& x, const leap_second& y); // C++20 +constexpr strong_ordering operator<=>(const leap_second& x, const leap_second& y); + +template<class Duration> // C++20 + constexpr bool operator==(const leap_second& x, const sys_time<Duration>& y); +template<class Duration> // C++20 + constexpr bool operator< (const leap_second& x, const sys_time<Duration>& y); +template<class Duration> // C++20 + constexpr bool operator< (const sys_time<Duration>& x, const leap_second& y); +template<class Duration> // C++20 + constexpr bool operator> (const leap_second& x, const sys_time<Duration>& y); +template<class Duration> // C++20 + constexpr bool operator> (const sys_time<Duration>& x, const leap_second& y); +template<class Duration> // C++20 + constexpr bool operator<=(const leap_second& x, const sys_time<Duration>& y); +template<class Duration> // C++20 + constexpr bool operator<=(const sys_time<Duration>& x, const leap_second& y); +template<class Duration> // C++20 + constexpr bool operator>=(const leap_second& x, const sys_time<Duration>& y); +template<class Duration> // C++20 + constexpr bool operator>=(const sys_time<Duration>& x, const leap_second& y); +template<class Duration> // C++20 + requires three_way_comparable_with<sys_seconds, sys_time<Duration>> + constexpr auto operator<=>(const leap_second& x, const sys_time<Duration>& y); + // [time.zone.link], class time_zone_link class time_zone_link { // C++20 public: @@ -774,6 +869,8 @@ namespace std { template<class charT> struct formatter<chrono::year_month_weekday_last, charT>; // C++20 template<class Rep, class Period, class charT> struct formatter<chrono::hh_mm_ss<duration<Rep, Period>>, charT>; // C++20 + template<class charT> struct formatter<chrono::sys_info, charT>; // C++20 + template<class charT> struct formatter<chrono::local_info, charT>; // C++20 } // namespace std namespace chrono { @@ -825,27 +922,51 @@ constexpr chrono::year operator ""y(unsigned lo // clang-format on -#include <__chrono/calendar.h> -#include <__chrono/convert_to_timespec.h> -#include <__chrono/convert_to_tm.h> -#include <__chrono/day.h> +#include <__config> + #include <__chrono/duration.h> #include <__chrono/file_clock.h> -#include <__chrono/hh_mm_ss.h> #include <__chrono/high_resolution_clock.h> -#include <__chrono/literals.h> -#include <__chrono/month.h> -#include <__chrono/month_weekday.h> -#include <__chrono/monthday.h> #include <__chrono/steady_clock.h> #include <__chrono/system_clock.h> #include <__chrono/time_point.h> -#include <__chrono/weekday.h> -#include <__chrono/year.h> -#include <__chrono/year_month.h> -#include <__chrono/year_month_day.h> -#include <__chrono/year_month_weekday.h> -#include <__config> + +#if _LIBCPP_STD_VER >= 20 +# include <__chrono/calendar.h> +# include <__chrono/day.h> +# include <__chrono/exception.h> +# include <__chrono/hh_mm_ss.h> +# include <__chrono/literals.h> +# include <__chrono/local_info.h> +# include <__chrono/month.h> +# include <__chrono/month_weekday.h> +# include <__chrono/monthday.h> +# include <__chrono/sys_info.h> +# include <__chrono/weekday.h> +# include <__chrono/year.h> +# include <__chrono/year_month.h> +# include <__chrono/year_month_day.h> +# include <__chrono/year_month_weekday.h> + +# if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include <__chrono/formatter.h> +# include <__chrono/ostream.h> +# include <__chrono/parser_std_format_spec.h> +# include <__chrono/statically_widen.h> +# endif + +# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \ + !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include <__chrono/leap_second.h> +# include <__chrono/time_zone.h> +# include <__chrono/time_zone_link.h> +# include <__chrono/tzdb.h> +# include <__chrono/tzdb_list.h> +# include <__chrono/zoned_time.h> +# endif + +#endif + #include <version> // standard-mandated includes @@ -853,25 +974,17 @@ constexpr chrono::year operator ""y(unsigned lo // [time.syn] #include <compare> -#if 0 -# include <__chrono/formatter.h> -# include <__chrono/ostream.h> -# include <__chrono/parser_std_format_spec.h> -# include <__chrono/statically_widen.h> -#endif - -#if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \ - !defined(_LIBCPP_HAS_NO_LOCALIZATION) -# include <__chrono/time_zone.h> -# include <__chrono/time_zone_link.h> -# include <__chrono/tzdb.h> -# include <__chrono/tzdb_list.h> -#endif - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 +# include <cstdint> +# include <stdexcept> +# include <string_view> +# include <vector> +#endif + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <bit> # include <concepts> @@ -883,7 +996,10 @@ constexpr chrono::year operator ""y(unsigned lo #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20 # include <charconv> -# include <locale> +# if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include <locale> +# endif +# include <ostream> #endif #endif // _LIBCPP_CHRONO diff --git a/contrib/libs/cxxsupp/libcxx/include/cmath b/contrib/libs/cxxsupp/libcxx/include/cmath index dd194bbb55..7a87e35c84 100644 --- a/contrib/libs/cxxsupp/libcxx/include/cmath +++ b/contrib/libs/cxxsupp/libcxx/include/cmath @@ -557,13 +557,13 @@ inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y, template <class _A1, class _A2, class _A3> inline _LIBCPP_HIDE_FROM_ABI - typename enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value, - __promote<_A1, _A2, _A3> >::type - hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT { +typename enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value, + __promote<_A1, _A2, _A3> >::type +hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT { typedef typename __promote<_A1, _A2, _A3>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && is_same<_A2, __result_type>::value && - is_same<_A3, __result_type>::value)), - ""); + static_assert( + !(is_same<_A1, __result_type>::value && is_same<_A2, __result_type>::value && is_same<_A3, __result_type>::value), + ""); return std::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); } #endif @@ -610,161 +610,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isfinite(_A1 __lcpp_x) return __builtin_isfinite(__lcpp_x); } -_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT { - return __builtin_copysignf(__x, __y); -} - -_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT { - return __builtin_copysign(__x, __y); -} - -_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI long double -__constexpr_copysign(long double __x, long double __y) _NOEXCEPT { - return __builtin_copysignl(__x, __y); -} - -template <class _A1, - class _A2, - __enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type -__constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT { - typedef typename std::__promote<_A1, _A2>::type __result_type; - static_assert((!(std::_IsSame<_A1, __result_type>::value && std::_IsSame<_A2, __result_type>::value)), ""); - return __builtin_copysign((__result_type)__x, (__result_type)__y); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float __constexpr_fabs(float __x) _NOEXCEPT { - return __builtin_fabsf(__x); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(double __x) _NOEXCEPT { - return __builtin_fabs(__x); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double __constexpr_fabs(long double __x) _NOEXCEPT { - return __builtin_fabsl(__x); -} - -template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(_Tp __x) _NOEXCEPT { - return __builtin_fabs(static_cast<double>(__x)); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 float __constexpr_fmax(float __x, float __y) _NOEXCEPT { -#if !__has_constexpr_builtin(__builtin_fmaxf) - if (__libcpp_is_constant_evaluated()) { - if (std::__constexpr_isnan(__x)) - return __y; - if (std::__constexpr_isnan(__y)) - return __x; - return __x < __y ? __y : __x; - } -#endif - return __builtin_fmaxf(__x, __y); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 double __constexpr_fmax(double __x, double __y) _NOEXCEPT { -#if !__has_constexpr_builtin(__builtin_fmax) - if (__libcpp_is_constant_evaluated()) { - if (std::__constexpr_isnan(__x)) - return __y; - if (std::__constexpr_isnan(__y)) - return __x; - return __x < __y ? __y : __x; - } -#endif - return __builtin_fmax(__x, __y); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 long double -__constexpr_fmax(long double __x, long double __y) _NOEXCEPT { -#if !__has_constexpr_builtin(__builtin_fmaxl) - if (__libcpp_is_constant_evaluated()) { - if (std::__constexpr_isnan(__x)) - return __y; - if (std::__constexpr_isnan(__y)) - return __x; - return __x < __y ? __y : __x; - } -#endif - return __builtin_fmaxl(__x, __y); -} - -template <class _Tp, class _Up, __enable_if_t<is_arithmetic<_Tp>::value && is_arithmetic<_Up>::value, int> = 0> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename __promote<_Tp, _Up>::type -__constexpr_fmax(_Tp __x, _Up __y) _NOEXCEPT { - using __result_type = typename __promote<_Tp, _Up>::type; - return std::__constexpr_fmax(static_cast<__result_type>(__x), static_cast<__result_type>(__y)); -} - -template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __constexpr_logb(_Tp __x) { -#if !__has_constexpr_builtin(__builtin_logb) - if (__libcpp_is_constant_evaluated()) { - if (__x == _Tp(0)) { - // raise FE_DIVBYZERO - return -numeric_limits<_Tp>::infinity(); - } - - if (std::__constexpr_isinf(__x)) - return numeric_limits<_Tp>::infinity(); - - if (std::__constexpr_isnan(__x)) - return numeric_limits<_Tp>::quiet_NaN(); - - __x = std::__constexpr_fabs(__x); - unsigned long long __exp = 0; - while (__x >= numeric_limits<_Tp>::radix) { - __x /= numeric_limits<_Tp>::radix; - __exp += 1; - } - return _Tp(__exp); - } -#endif // !__has_constexpr_builtin(__builtin_logb) - return __builtin_logb(__x); -} - -template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp __constexpr_scalbn(_Tp __x, int __exp) { -#if !__has_constexpr_builtin(__builtin_scalbln) - if (__libcpp_is_constant_evaluated()) { - if (__x == _Tp(0)) - return __x; - - if (std::__constexpr_isinf(__x)) - return __x; - - if (__exp == _Tp(0)) - return __x; - - if (std::__constexpr_isnan(__x)) - return numeric_limits<_Tp>::quiet_NaN(); - - _Tp __mult(1); - if (__exp > 0) { - __mult = numeric_limits<_Tp>::radix; - --__exp; - } else { - ++__exp; - __exp = -__exp; - __mult /= numeric_limits<_Tp>::radix; - } - - while (__exp > 0) { - if (!(__exp & 1)) { - __mult *= __mult; - __exp >>= 1; - } else { - __x *= __mult; - --__exp; - } - } - return __x; - } -#endif // !__has_constexpr_builtin(__builtin_scalbln) - return __builtin_scalbn(__x, __exp); -} - #if _LIBCPP_STD_VER >= 20 template <typename _Fp> _LIBCPP_HIDE_FROM_ABI constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept { diff --git a/contrib/libs/cxxsupp/libcxx/include/codecvt b/contrib/libs/cxxsupp/libcxx/include/codecvt index b7182ff471..65cd752d69 100644 --- a/contrib/libs/cxxsupp/libcxx/include/codecvt +++ b/contrib/libs/cxxsupp/libcxx/include/codecvt @@ -433,8 +433,8 @@ protected: _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0> -class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16 - : public __codecvt_utf16<_Elem, _Mode & little_endian> { +class _LIBCPP_TEMPLATE_VIS +_LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16 : public __codecvt_utf16<_Elem, _Mode & little_endian> { public: _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf16(size_t __refs = 0) : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {} diff --git a/contrib/libs/cxxsupp/libcxx/include/compare b/contrib/libs/cxxsupp/libcxx/include/compare index 93953254b7..8a41835b14 100644 --- a/contrib/libs/cxxsupp/libcxx/include/compare +++ b/contrib/libs/cxxsupp/libcxx/include/compare @@ -140,26 +140,36 @@ namespace std { } */ -#include <__compare/common_comparison_category.h> -#include <__compare/compare_partial_order_fallback.h> -#include <__compare/compare_strong_order_fallback.h> -#include <__compare/compare_three_way.h> -#include <__compare/compare_three_way_result.h> -#include <__compare/compare_weak_order_fallback.h> -#include <__compare/is_eq.h> -#include <__compare/ordering.h> -#include <__compare/partial_order.h> -#include <__compare/strong_order.h> -#include <__compare/synth_three_way.h> -#include <__compare/three_way_comparable.h> -#include <__compare/weak_order.h> #include <__config> + +#if _LIBCPP_STD_VER >= 20 +# include <__compare/common_comparison_category.h> +# include <__compare/compare_partial_order_fallback.h> +# include <__compare/compare_strong_order_fallback.h> +# include <__compare/compare_three_way.h> +# include <__compare/compare_three_way_result.h> +# include <__compare/compare_weak_order_fallback.h> +# include <__compare/is_eq.h> +# include <__compare/ordering.h> +# include <__compare/partial_order.h> +# include <__compare/strong_order.h> +# include <__compare/synth_three_way.h> +# include <__compare/three_way_comparable.h> +# include <__compare/weak_order.h> +#endif // _LIBCPP_STD_VER >= 20 + #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 +# include <cstddef> +# include <cstdint> +# include <limits> +#endif + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <cmath> # include <type_traits> diff --git a/contrib/libs/cxxsupp/libcxx/include/complex b/contrib/libs/cxxsupp/libcxx/include/complex index 5f09e3e51e..91cf3f4d50 100644 --- a/contrib/libs/cxxsupp/libcxx/include/complex +++ b/contrib/libs/cxxsupp/libcxx/include/complex @@ -261,6 +261,7 @@ template<class T> complex<T> tanh (const complex<T>&); #include <__fwd/tuple.h> #include <__tuple/tuple_element.h> #include <__tuple/tuple_size.h> +#include <__type_traits/conditional.h> #include <__utility/move.h> #include <cmath> #include <version> @@ -281,10 +282,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> class _LIBCPP_TEMPLATE_VIS complex; -template <class _Tp> +template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w); -template <class _Tp> + +template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> +operator*(const complex<_Tp>& __z, const complex<_Tp>& __w); + +template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> +operator/(const complex<_Tp>& __x, const complex<_Tp>& __y); + +template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y); @@ -384,6 +394,23 @@ class _LIBCPP_TEMPLATE_VIS complex<double>; template <> class _LIBCPP_TEMPLATE_VIS complex<long double>; +struct __from_builtin_tag {}; + +template <class _Tp> +using __complex_t = + __conditional_t<is_same<_Tp, float>::value, + _Complex float, + __conditional_t<is_same<_Tp, double>::value, _Complex double, _Complex long double> >; + +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __complex_t<_Tp> __make_complex(_Tp __re, _Tp __im) { +#if __has_builtin(__builtin_complex) + return __builtin_complex(__re, __im); +#else + return __complex_t<_Tp>{__re, __im}; +#endif +} + template <> class _LIBCPP_TEMPLATE_VIS complex<float> { float __re_; @@ -393,6 +420,10 @@ public: typedef float value_type; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f) : __re_(__re), __im_(__im) {} + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(__from_builtin_tag, _Complex float __v) + : __re_(__real__ __v), __im_(__imag__ __v) {} + _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c); _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c); @@ -402,6 +433,12 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Complex float __builtin() const { return std::__make_complex(__re_, __im_); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __builtin(_Complex float __f) { + __re_ = __real__ __f; + __im_ = __imag__ __f; + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator=(float __re) { __re_ = __re; __im_ = value_type(); @@ -479,6 +516,10 @@ public: typedef double value_type; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0) : __re_(__re), __im_(__im) {} + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(__from_builtin_tag, _Complex double __v) + : __re_(__real__ __v), __im_(__imag__ __v) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c); _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c); @@ -488,6 +529,15 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Complex double __builtin() const { + return std::__make_complex(__re_, __im_); + } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __builtin(_Complex double __f) { + __re_ = __real__ __f; + __im_ = __imag__ __f; + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator=(double __re) { __re_ = __re; __im_ = value_type(); @@ -566,6 +616,10 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.0L) : __re_(__re), __im_(__im) {} + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(__from_builtin_tag, _Complex long double __v) + : __re_(__real__ __v), __im_(__imag__ __v) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<float>& __c); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR complex(const complex<double>& __c); @@ -575,6 +629,15 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void real(value_type __re) { __re_ = __re; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void imag(value_type __im) { __im_ = __im; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Complex long double __builtin() const { + return std::__make_complex(__re_, __im_); + } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __builtin(_Complex long double __f) { + __re_ = __real__ __f; + __im_ = __imag__ __f; + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator=(long double __re) { __re_ = __re; __im_ = value_type(); @@ -709,7 +772,13 @@ operator-(const _Tp& __x, const complex<_Tp>& __y) { return __t; } -template <class _Tp> +template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> +operator*(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) { + return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() * __rhs.__builtin()); +} + +template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> > _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) { _Tp __a = __z.real(); @@ -717,78 +786,7 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) { _Tp __c = __w.real(); _Tp __d = __w.imag(); - // Avoid floating point operations that are invalid during constant evaluation - if (__libcpp_is_constant_evaluated()) { - bool __z_zero = __a == _Tp(0) && __b == _Tp(0); - bool __w_zero = __c == _Tp(0) && __d == _Tp(0); - bool __z_inf = std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b); - bool __w_inf = std::__constexpr_isinf(__c) || std::__constexpr_isinf(__d); - bool __z_nan = - !__z_inf && ((std::__constexpr_isnan(__a) && std::__constexpr_isnan(__b)) || - (std::__constexpr_isnan(__a) && __b == _Tp(0)) || (__a == _Tp(0) && std::__constexpr_isnan(__b))); - bool __w_nan = - !__w_inf && ((std::__constexpr_isnan(__c) && std::__constexpr_isnan(__d)) || - (std::__constexpr_isnan(__c) && __d == _Tp(0)) || (__c == _Tp(0) && std::__constexpr_isnan(__d))); - if (__z_nan || __w_nan) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - if (__z_inf || __w_inf) { - if (__z_zero || __w_zero) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity())); - } - bool __z_nonzero_nan = !__z_inf && !__z_nan && (std::__constexpr_isnan(__a) || std::__constexpr_isnan(__b)); - bool __w_nonzero_nan = !__w_inf && !__w_nan && (std::__constexpr_isnan(__c) || std::__constexpr_isnan(__d)); - if (__z_nonzero_nan || __w_nonzero_nan) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - } - - _Tp __ac = __a * __c; - _Tp __bd = __b * __d; - _Tp __ad = __a * __d; - _Tp __bc = __b * __c; - _Tp __x = __ac - __bd; - _Tp __y = __ad + __bc; - if (std::__constexpr_isnan(__x) && std::__constexpr_isnan(__y)) { - bool __recalc = false; - if (std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b)) { - __a = std::__constexpr_copysign(std::__constexpr_isinf(__a) ? _Tp(1) : _Tp(0), __a); - __b = std::__constexpr_copysign(std::__constexpr_isinf(__b) ? _Tp(1) : _Tp(0), __b); - if (std::__constexpr_isnan(__c)) - __c = std::__constexpr_copysign(_Tp(0), __c); - if (std::__constexpr_isnan(__d)) - __d = std::__constexpr_copysign(_Tp(0), __d); - __recalc = true; - } - if (std::__constexpr_isinf(__c) || std::__constexpr_isinf(__d)) { - __c = std::__constexpr_copysign(std::__constexpr_isinf(__c) ? _Tp(1) : _Tp(0), __c); - __d = std::__constexpr_copysign(std::__constexpr_isinf(__d) ? _Tp(1) : _Tp(0), __d); - if (std::__constexpr_isnan(__a)) - __a = std::__constexpr_copysign(_Tp(0), __a); - if (std::__constexpr_isnan(__b)) - __b = std::__constexpr_copysign(_Tp(0), __b); - __recalc = true; - } - if (!__recalc && (std::__constexpr_isinf(__ac) || std::__constexpr_isinf(__bd) || std::__constexpr_isinf(__ad) || - std::__constexpr_isinf(__bc))) { - if (std::__constexpr_isnan(__a)) - __a = std::__constexpr_copysign(_Tp(0), __a); - if (std::__constexpr_isnan(__b)) - __b = std::__constexpr_copysign(_Tp(0), __b); - if (std::__constexpr_isnan(__c)) - __c = std::__constexpr_copysign(_Tp(0), __c); - if (std::__constexpr_isnan(__d)) - __d = std::__constexpr_copysign(_Tp(0), __d); - __recalc = true; - } - if (__recalc) { - __x = _Tp(INFINITY) * (__a * __c - __b * __d); - __y = _Tp(INFINITY) * (__a * __d + __b * __c); - } - } - return complex<_Tp>(__x, __y); + return complex<_Tp>((__a * __c) - (__b * __d), (__a * __d) + (__b * __c)); } template <class _Tp> @@ -807,80 +805,22 @@ operator*(const _Tp& __x, const complex<_Tp>& __y) { return __t; } -template <class _Tp> +template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> +operator/(const complex<_Tp>& __lhs, const complex<_Tp>& __rhs) { + return complex<_Tp>(__from_builtin_tag(), __lhs.__builtin() / __rhs.__builtin()); +} + +template <class _Tp, __enable_if_t<!is_floating_point<_Tp>::value, int> > _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) { - int __ilogbw = 0; - _Tp __a = __z.real(); - _Tp __b = __z.imag(); - _Tp __c = __w.real(); - _Tp __d = __w.imag(); - _Tp __logbw = std::__constexpr_logb(std::__constexpr_fmax(std::__constexpr_fabs(__c), std::__constexpr_fabs(__d))); - if (std::__constexpr_isfinite(__logbw)) { - __ilogbw = static_cast<int>(__logbw); - __c = std::__constexpr_scalbn(__c, -__ilogbw); - __d = std::__constexpr_scalbn(__d, -__ilogbw); - } - - // Avoid floating point operations that are invalid during constant evaluation - if (__libcpp_is_constant_evaluated()) { - bool __z_zero = __a == _Tp(0) && __b == _Tp(0); - bool __w_zero = __c == _Tp(0) && __d == _Tp(0); - bool __z_inf = std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b); - bool __w_inf = std::__constexpr_isinf(__c) || std::__constexpr_isinf(__d); - bool __z_nan = - !__z_inf && ((std::__constexpr_isnan(__a) && std::__constexpr_isnan(__b)) || - (std::__constexpr_isnan(__a) && __b == _Tp(0)) || (__a == _Tp(0) && std::__constexpr_isnan(__b))); - bool __w_nan = - !__w_inf && ((std::__constexpr_isnan(__c) && std::__constexpr_isnan(__d)) || - (std::__constexpr_isnan(__c) && __d == _Tp(0)) || (__c == _Tp(0) && std::__constexpr_isnan(__d))); - if ((__z_nan || __w_nan) || (__z_inf && __w_inf)) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - bool __z_nonzero_nan = !__z_inf && !__z_nan && (std::__constexpr_isnan(__a) || std::__constexpr_isnan(__b)); - bool __w_nonzero_nan = !__w_inf && !__w_nan && (std::__constexpr_isnan(__c) || std::__constexpr_isnan(__d)); - if (__z_nonzero_nan || __w_nonzero_nan) { - if (__w_zero) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity())); - } - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - if (__w_inf) { - return complex<_Tp>(_Tp(0), _Tp(0)); - } - if (__z_inf) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity())); - } - if (__w_zero) { - if (__z_zero) { - return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0)); - } - return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity())); - } - } + _Tp __a = __z.real(); + _Tp __b = __z.imag(); + _Tp __c = __w.real(); + _Tp __d = __w.imag(); _Tp __denom = __c * __c + __d * __d; - _Tp __x = std::__constexpr_scalbn((__a * __c + __b * __d) / __denom, -__ilogbw); - _Tp __y = std::__constexpr_scalbn((__b * __c - __a * __d) / __denom, -__ilogbw); - if (std::__constexpr_isnan(__x) && std::__constexpr_isnan(__y)) { - if ((__denom == _Tp(0)) && (!std::__constexpr_isnan(__a) || !std::__constexpr_isnan(__b))) { - __x = std::__constexpr_copysign(_Tp(INFINITY), __c) * __a; - __y = std::__constexpr_copysign(_Tp(INFINITY), __c) * __b; - } else if ((std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b)) && std::__constexpr_isfinite(__c) && - std::__constexpr_isfinite(__d)) { - __a = std::__constexpr_copysign(std::__constexpr_isinf(__a) ? _Tp(1) : _Tp(0), __a); - __b = std::__constexpr_copysign(std::__constexpr_isinf(__b) ? _Tp(1) : _Tp(0), __b); - __x = _Tp(INFINITY) * (__a * __c + __b * __d); - __y = _Tp(INFINITY) * (__b * __c - __a * __d); - } else if (std::__constexpr_isinf(__logbw) && __logbw > _Tp(0) && std::__constexpr_isfinite(__a) && - std::__constexpr_isfinite(__b)) { - __c = std::__constexpr_copysign(std::__constexpr_isinf(__c) ? _Tp(1) : _Tp(0), __c); - __d = std::__constexpr_copysign(std::__constexpr_isinf(__d) ? _Tp(1) : _Tp(0), __d); - __x = _Tp(0) * (__a * __c + __b * __d); - __y = _Tp(0) * (__b * __c - __a * __d); - } - } - return complex<_Tp>(__x, __y); + return complex<_Tp>((__a * __c + __b * __d) / __denom, (__b * __c - __a * __d) / __denom); } template <class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/concepts b/contrib/libs/cxxsupp/libcxx/include/concepts index e10f5ab5ad..e89d216a59 100644 --- a/contrib/libs/cxxsupp/libcxx/include/concepts +++ b/contrib/libs/cxxsupp/libcxx/include/concepts @@ -129,31 +129,39 @@ namespace std { */ -#include <__concepts/arithmetic.h> -#include <__concepts/assignable.h> -#include <__concepts/boolean_testable.h> -#include <__concepts/class_or_enum.h> -#include <__concepts/common_reference_with.h> -#include <__concepts/common_with.h> -#include <__concepts/constructible.h> -#include <__concepts/convertible_to.h> -#include <__concepts/copyable.h> -#include <__concepts/derived_from.h> -#include <__concepts/destructible.h> -#include <__concepts/different_from.h> -#include <__concepts/equality_comparable.h> -#include <__concepts/invocable.h> -#include <__concepts/movable.h> -#include <__concepts/predicate.h> -#include <__concepts/regular.h> -#include <__concepts/relation.h> -#include <__concepts/same_as.h> -#include <__concepts/semiregular.h> -#include <__concepts/swappable.h> -#include <__concepts/totally_ordered.h> #include <__config> + +#if _LIBCPP_STD_VER >= 20 +# include <__concepts/arithmetic.h> +# include <__concepts/assignable.h> +# include <__concepts/boolean_testable.h> +# include <__concepts/class_or_enum.h> +# include <__concepts/common_reference_with.h> +# include <__concepts/common_with.h> +# include <__concepts/constructible.h> +# include <__concepts/convertible_to.h> +# include <__concepts/copyable.h> +# include <__concepts/derived_from.h> +# include <__concepts/destructible.h> +# include <__concepts/different_from.h> +# include <__concepts/equality_comparable.h> +# include <__concepts/invocable.h> +# include <__concepts/movable.h> +# include <__concepts/predicate.h> +# include <__concepts/regular.h> +# include <__concepts/relation.h> +# include <__concepts/same_as.h> +# include <__concepts/semiregular.h> +# include <__concepts/swappable.h> +# include <__concepts/totally_ordered.h> +#endif // _LIBCPP_STD_VER >= 20 + #include <version> +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 +# include <cstddef> +#endif + #if _LIBCPP_STD_VER <= 20 && !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) # include <type_traits> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/condition_variable b/contrib/libs/cxxsupp/libcxx/include/condition_variable index 4ded1140d4..5195cd6057 100644 --- a/contrib/libs/cxxsupp/libcxx/include/condition_variable +++ b/contrib/libs/cxxsupp/libcxx/include/condition_variable @@ -118,7 +118,6 @@ public: */ -#include <__availability> #include <__chrono/duration.h> #include <__chrono/steady_clock.h> #include <__chrono/time_point.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/coroutine b/contrib/libs/cxxsupp/libcxx/include/coroutine index b1ba83b541..ee54388ad5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/coroutine +++ b/contrib/libs/cxxsupp/libcxx/include/coroutine @@ -39,10 +39,14 @@ struct suspend_always; */ #include <__config> -#include <__coroutine/coroutine_handle.h> -#include <__coroutine/coroutine_traits.h> -#include <__coroutine/noop_coroutine_handle.h> -#include <__coroutine/trivial_awaitables.h> + +#if _LIBCPP_STD_VER >= 20 +# include <__coroutine/coroutine_handle.h> +# include <__coroutine/coroutine_traits.h> +# include <__coroutine/noop_coroutine_handle.h> +# include <__coroutine/trivial_awaitables.h> +#endif // _LIBCPP_STD_VER >= 20 + #include <version> // standard-mandated includes diff --git a/contrib/libs/cxxsupp/libcxx/include/cstddef b/contrib/libs/cxxsupp/libcxx/include/cstddef index ed16ae44fb..1a4049e4d3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/cstddef +++ b/contrib/libs/cxxsupp/libcxx/include/cstddef @@ -122,7 +122,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr byte operator>>(byte __lhs, _Integer __shift) no } template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Integer to_integer(byte __b) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Integer to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); } diff --git a/contrib/libs/cxxsupp/libcxx/include/cwchar b/contrib/libs/cxxsupp/libcxx/include/cwchar index 4cc6f56c38..08cfac58c8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/cwchar +++ b/contrib/libs/cxxsupp/libcxx/include/cwchar @@ -103,7 +103,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, */ #include <__config> -#include <__type_traits/apply_cv.h> +#include <__type_traits/copy_cv.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_equality_comparable.h> #include <__type_traits/is_same.h> @@ -236,7 +236,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp wchar_t __value_buffer = 0; __builtin_memcpy(&__value_buffer, &__value, sizeof(wchar_t)); return reinterpret_cast<_Tp*>( - __builtin_wmemchr(reinterpret_cast<__apply_cv_t<_Tp, wchar_t>*>(__str), __value_buffer, __count)); + __builtin_wmemchr(reinterpret_cast<__copy_cv_t<_Tp, wchar_t>*>(__str), __value_buffer, __count)); } # if _LIBCPP_STD_VER >= 17 else if constexpr (is_same_v<remove_cv_t<_Tp>, wchar_t>) diff --git a/contrib/libs/cxxsupp/libcxx/include/deque b/contrib/libs/cxxsupp/libcxx/include/deque index 9559235abf..fc0e1adfc1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/deque +++ b/contrib/libs/cxxsupp/libcxx/include/deque @@ -189,8 +189,8 @@ template <class T, class Allocator, class Predicate> #include <__algorithm/remove_if.h> #include <__algorithm/unwrap_iter.h> #include <__assert> -#include <__availability> #include <__config> +#include <__debug_utils/sanitizers.h> #include <__format/enable_insertable.h> #include <__fwd/deque.h> #include <__iterator/distance.h> @@ -214,6 +214,7 @@ template <class T, class Allocator, class Predicate> #include <__type_traits/is_allocator.h> #include <__type_traits/is_convertible.h> #include <__type_traits/is_same.h> +#include <__type_traits/is_swappable.h> #include <__type_traits/type_identity.h> #include <__utility/forward.h> #include <__utility/move.h> @@ -450,11 +451,11 @@ public: using value_type = _Tp; - static_assert((is_same<typename _Allocator::value_type, value_type>::value), - "Allocator::value_type must be same type as value_type"); - using allocator_type = _Allocator; using __alloc_traits = allocator_traits<allocator_type>; + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<typename allocator_type::value_type, value_type>::value, + "Allocator::value_type must be same type as value_type"); using size_type = typename __alloc_traits::size_type; using difference_type = typename __alloc_traits::difference_type; @@ -479,15 +480,22 @@ public: using reverse_iterator = std::reverse_iterator<iterator>; using const_reverse_iterator = std::reverse_iterator<const_iterator>; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + // A deque contains the following members which may be trivially relocatable: + // - __map: is a `__split_buffer`, see `__split_buffer` for more information on when it is trivially relocatable + // - size_type: is always trivially relocatable, since it is required to be an integral type + // - allocator_type: may not be trivially relocatable, so it's checked + // None of these are referencing the `deque` itself, so if all of them are trivially relocatable, `deque` is too. + using __trivially_relocatable = __conditional_t< + __libcpp_is_trivially_relocatable<__map>::value && __libcpp_is_trivially_relocatable<allocator_type>::value, + deque, + void>; + static_assert(is_nothrow_default_constructible<allocator_type>::value == is_nothrow_default_constructible<__pointer_allocator>::value, - "rebinding an allocator should not change excpetion guarantees"); + "rebinding an allocator should not change exception guarantees"); static_assert(is_nothrow_move_constructible<allocator_type>::value == is_nothrow_move_constructible<typename __map::allocator_type>::value, - "rebinding an allocator should not change excpetion guarantees"); + "rebinding an allocator should not change exception guarantees"); private: struct __deque_block_range { @@ -623,11 +631,11 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value); + _LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value); _LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t<allocator_type>& __a); - _LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c) - _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value&& - is_nothrow_move_assignable<allocator_type>::value); + _LIBCPP_HIDE_FROM_ABI deque& + operator=(deque&& __c) noexcept(__alloc_traits::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<allocator_type>::value); _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) { assign(__il.begin(), __il.end()); } #endif // _LIBCPP_CXX03_LANG @@ -709,7 +717,7 @@ public: _LIBCPP_HIDE_FROM_ABI void resize(size_type __n); _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __v); _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT; - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; } // element access: _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT; @@ -796,7 +804,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; @@ -866,33 +874,6 @@ private: __asan_back_moved, }; - // The following functions are no-ops outside of AddressSanitizer mode. - // We call annotations for every allocator, unless explicitly disabled. - // - // To disable annotations for a particular allocator, change value of - // __asan_annotate_container_with_allocator to false. - // For more details, see the "Using libc++" documentation page or - // the documentation for __sanitizer_annotate_contiguous_container. - _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container( - const void* __beg, - const void* __end, - const void* __old_con_beg, - const void* __old_con_end, - const void* __new_con_beg, - const void* __new_con_end) const { - (void)__beg; - (void)__end; - (void)__old_con_beg; - (void)__old_con_end; - (void)__new_con_beg; - (void)__new_con_end; -#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value) - __sanitizer_annotate_double_ended_contiguous_container( - __beg, __end, __old_con_beg, __old_con_end, __new_con_beg, __new_con_end); -#endif - } - _LIBCPP_HIDE_FROM_ABI void __annotate_from_to( size_type __beg, size_type __end, @@ -992,7 +973,8 @@ private: const void* __new_beg = __front ? __new_edge : __old_edge; const void* __new_end = __front ? __old_edge : __new_edge; - __annotate_double_ended_contiguous_container(__mem_beg, __mem_end, __old_beg, __old_end, __new_beg, __new_end); + std::__annotate_double_ended_contiguous_container<_Allocator>( + __mem_beg, __mem_end, __old_beg, __old_end, __new_beg, __new_end); } #endif // !_LIBCPP_HAS_NO_ASAN } @@ -1053,11 +1035,7 @@ private: } _LIBCPP_HIDE_FROM_ABI void __annotate_poison_block(const void* __beginning, const void* __end) const _NOEXCEPT { - (void)__beginning; - (void)__end; -#ifndef _LIBCPP_HAS_NO_ASAN - __annotate_double_ended_contiguous_container(__beginning, __end, __beginning, __end, __end, __end); -#endif + std::__annotate_double_ended_contiguous_container<_Allocator>(__beginning, __end, __beginning, __end, __end, __end); } _LIBCPP_HIDE_FROM_ABI void @@ -1072,12 +1050,12 @@ private: if (__annotation_type == __asan_poison) __annotate_poison_block(__block_start, __block_end); else { - __annotate_double_ended_contiguous_container( + std::__annotate_double_ended_contiguous_container<_Allocator>( __block_start, __block_end, __block_start, __block_start, __block_start, __block_end); } #endif } -#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) +#if !defined(_LIBCPP_HAS_NO_ASAN) public: _LIBCPP_HIDE_FROM_ABI bool __verify_asan_annotations() const _NOEXCEPT { @@ -1330,7 +1308,7 @@ deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator } template <class _Tp, class _Allocator> -inline deque<_Tp, _Allocator>::deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value) +inline deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value) : __map_(std::move(__c.__map_)), __start_(std::move(__c.__start_)), __size_(std::move(__c.__size_)) { __c.__start_ = 0; __c.__size() = 0; @@ -1354,8 +1332,9 @@ inline deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<alloca } template <class _Tp, class _Allocator> -inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) _NOEXCEPT_( - __alloc_traits::propagate_on_container_move_assignment::value&& is_nothrow_move_assignable<allocator_type>::value) { +inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) noexcept( + __alloc_traits::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<allocator_type>::value) { __move_assign(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>()); return *this; } @@ -1370,8 +1349,8 @@ void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) { } template <class _Tp, class _Allocator> -void deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type) - _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) { +void deque<_Tp, _Allocator>::__move_assign(deque& __c, + true_type) noexcept(is_nothrow_move_assignable<allocator_type>::value) { clear(); shrink_to_fit(); __move_assign(__c); @@ -2484,7 +2463,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) #endif { __map_.swap(__c.__map_); @@ -2554,7 +2533,7 @@ template <class _Tp, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); + __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/reference.h b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/reference.h index 7efbba96ec..af61dbcc2f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/reference.h +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/reference.h @@ -13,10 +13,14 @@ #include <__type_traits/is_assignable.h> #include <__type_traits/is_same.h> #include <__utility/forward.h> +#include <__utility/move.h> #include <cstddef> #include <experimental/__config> #include <experimental/__simd/utility.h> +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL) _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL @@ -55,10 +59,47 @@ public: __set(static_cast<value_type>(std::forward<_Up>(__v))); return {__s_, __idx_}; } + + // Note: This approach might not fully align with the specification, + // which might be a wording defect. (https://wg21.link/N4808 section 9.6.3) + template <class _Tp1, class _Storage1, class _Vp1> + friend void + swap(__simd_reference<_Tp1, _Storage1, _Vp1>&& __a, __simd_reference<_Tp1, _Storage1, _Vp1>&& __b) noexcept; + + template <class _Tp1, class _Storage1, class _Vp1> + friend void swap(_Vp1& __a, __simd_reference<_Tp1, _Storage1, _Vp1>&& __b) noexcept; + + template <class _Tp1, class _Storage1, class _Vp1> + friend void swap(__simd_reference<_Tp1, _Storage1, _Vp1>&& __a, _Vp1& __b) noexcept; }; +template <class _Tp, class _Storage, class _Vp> +_LIBCPP_HIDE_FROM_ABI void +swap(__simd_reference<_Tp, _Storage, _Vp>&& __a, __simd_reference<_Tp, _Storage, _Vp>&& __b) noexcept { + _Vp __tmp(std::move(__a)); + std::move(__a) = std::move(__b); + std::move(__b) = std::move(__tmp); +} + +template <class _Tp, class _Storage, class _Vp> +_LIBCPP_HIDE_FROM_ABI void swap(_Vp& __a, __simd_reference<_Tp, _Storage, _Vp>&& __b) noexcept { + _Vp __tmp(std::move(__a)); + __a = std::move(__b); + std::move(__b) = std::move(__tmp); +} + +template <class _Tp, class _Storage, class _Vp> +_LIBCPP_HIDE_FROM_ABI void swap(__simd_reference<_Tp, _Storage, _Vp>&& __a, _Vp& __b) noexcept { + _Vp __tmp(std::move(__a)); + std::move(__a) = std::move(__b); + __b = std::move(__tmp); +} + } // namespace parallelism_v2 _LIBCPP_END_NAMESPACE_EXPERIMENTAL #endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL) + +_LIBCPP_POP_MACROS + #endif // _LIBCPP_EXPERIMENTAL___SIMD_REFERENCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/scalar.h b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/scalar.h index aff2cd11cf..1add465320 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/scalar.h +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/scalar.h @@ -62,6 +62,11 @@ struct __simd_operations<_Tp, simd_abi::__scalar> { static _LIBCPP_HIDE_FROM_ABI void __load(_SimdStorage& __s, const _Up* __mem) noexcept { __s.__data = static_cast<_Tp>(__mem[0]); } + + template <class _Up> + static _LIBCPP_HIDE_FROM_ABI void __store(_SimdStorage __s, _Up* __mem) noexcept { + *__mem = static_cast<_Up>(__s.__data); + } }; template <class _Tp> @@ -71,6 +76,8 @@ struct __mask_operations<_Tp, simd_abi::__scalar> { static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept { return {__v}; } static _LIBCPP_HIDE_FROM_ABI void __load(_MaskStorage& __s, const bool* __mem) noexcept { __s.__data = __mem[0]; } + + static _LIBCPP_HIDE_FROM_ABI void __store(_MaskStorage __s, bool* __mem) noexcept { __mem[0] = __s.__data; } }; } // namespace parallelism_v2 diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd.h b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd.h index db4ebb8e4a..37e334aad6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd.h +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd.h @@ -70,6 +70,17 @@ public: _Impl::__load(__s_, _Flags::template __apply<simd>(__mem)); } + // copy functions + template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0> + _LIBCPP_HIDE_FROM_ABI void copy_from(const _Up* __mem, _Flags) { + _Impl::__load(__s_, _Flags::template __apply<simd>(__mem)); + } + + template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0> + _LIBCPP_HIDE_FROM_ABI void copy_to(_Up* __mem, _Flags) const { + _Impl::__store(__s_, _Flags::template __apply<simd>(__mem)); + } + // scalar access [simd.subscr] _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); } _LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); } diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd_mask.h b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd_mask.h index 754db79926..fd6dee2e28 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd_mask.h +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/simd_mask.h @@ -58,6 +58,17 @@ public: _Impl::__load(__s_, _Flags::template __apply<simd_mask>(__mem)); } + // copy functions + template <class _Flags, enable_if_t<is_simd_flag_type_v<_Flags>, int> = 0> + _LIBCPP_HIDE_FROM_ABI void copy_from(const value_type* __mem, _Flags) { + _Impl::__load(__s_, _Flags::template __apply<simd_mask>(__mem)); + } + + template <class _Flags, enable_if_t<is_simd_flag_type_v<_Flags>, int> = 0> + _LIBCPP_HIDE_FROM_ABI void copy_to(value_type* __mem, _Flags) const { + _Impl::__store(__s_, _Flags::template __apply<simd_mask>(__mem)); + } + // scalar access [simd.mask.subscr] _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); } _LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); } diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/vec_ext.h b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/vec_ext.h index c9423df93c..316866b848 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/vec_ext.h +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__simd/vec_ext.h @@ -80,6 +80,12 @@ struct __simd_operations<_Tp, simd_abi::__vec_ext<_Np>> { for (size_t __i = 0; __i < _Np; __i++) __s.__data[__i] = static_cast<_Tp>(__mem[__i]); } + + template <class _Up> + static _LIBCPP_HIDE_FROM_ABI void __store(_SimdStorage __s, _Up* __mem) noexcept { + for (size_t __i = 0; __i < _Np; __i++) + __mem[__i] = static_cast<_Up>(__s.__data[__i]); + } }; template <class _Tp, int _Np> @@ -99,6 +105,11 @@ struct __mask_operations<_Tp, simd_abi::__vec_ext<_Np>> { for (size_t __i = 0; __i < _Np; __i++) __s.__data[__i] = experimental::__set_all_bits<_Tp>(__mem[__i]); } + + static _LIBCPP_HIDE_FROM_ABI void __store(_MaskStorage __s, bool* __mem) noexcept { + for (size_t __i = 0; __i < _Np; __i++) + __mem[__i] = static_cast<bool>(__s.__data[__i]); + } }; } // namespace parallelism_v2 diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const b/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const index 43648015fe..d7a695d838 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const @@ -145,10 +145,10 @@ template <class _Tp> class propagate_const; template <class _Up> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; +inline _LIBCPP_HIDE_FROM_ABI constexpr const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; template <class _Up> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; +inline _LIBCPP_HIDE_FROM_ABI constexpr _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; template <class _Tp> class propagate_const { @@ -164,22 +164,22 @@ public: private: template <class _Up> - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u) { + static _LIBCPP_HIDE_FROM_ABI constexpr element_type* __get_pointer(_Up* __u) { return __u; } template <class _Up> - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u) { + static _LIBCPP_HIDE_FROM_ABI constexpr element_type* __get_pointer(_Up& __u) { return __get_pointer(__u.get()); } template <class _Up> - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u) { + static _LIBCPP_HIDE_FROM_ABI constexpr const element_type* __get_pointer(const _Up* __u) { return __u; } template <class _Up> - static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u) { + static _LIBCPP_HIDE_FROM_ABI constexpr const element_type* __get_pointer(const _Up& __u) { return __get_pointer(__u.get()); } @@ -193,215 +193,207 @@ private: public: template <class _Up> - friend _LIBCPP_CONSTEXPR const _Up& - experimental::fundamentals_v2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; + friend constexpr const _Up& experimental::fundamentals_v2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; template <class _Up> - friend _LIBCPP_CONSTEXPR _Up& experimental::fundamentals_v2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; + friend constexpr _Up& experimental::fundamentals_v2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const() = default; + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const() = default; propagate_const(const propagate_const&) = delete; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(propagate_const&&) = default; template <class _Up, enable_if_t<!is_convertible<_Up, _Tp>::value && is_constructible<_Tp, _Up&&>::value, bool> = true> - explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) + explicit _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(propagate_const<_Up>&& __pu) : __t_(std::move(experimental::get_underlying(__pu))) {} template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value, bool> = false> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(propagate_const<_Up>&& __pu) : __t_(std::move(experimental::get_underlying(__pu))) {} template <class _Up, enable_if_t<!is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value && !__is_propagate_const<decay_t<_Up>>::value, bool> = true> - explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {} + explicit _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {} template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value && !__is_propagate_const<decay_t<_Up>>::value, bool> = false> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {} + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {} propagate_const& operator=(const propagate_const&) = delete; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(propagate_const&&) = default; template <class _Up> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu) { + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(propagate_const<_Up>&& __pu) { __t_ = std::move(experimental::get_underlying(__pu)); return *this; } template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u) { + _LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(_Up&& __u) { __t_ = std::forward<_Up>(__u); return *this; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* get() const { return __get_pointer(__t_); } + _LIBCPP_HIDE_FROM_ABI constexpr const element_type* get() const { return __get_pointer(__t_); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* get() { return __get_pointer(__t_); } + _LIBCPP_HIDE_FROM_ABI constexpr element_type* get() { return __get_pointer(__t_); } - _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR operator bool() const { return get() != nullptr; } + _LIBCPP_HIDE_FROM_ABI explicit constexpr operator bool() const { return get() != nullptr; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* operator->() const { return get(); } + _LIBCPP_HIDE_FROM_ABI constexpr const element_type* operator->() const { return get(); } template <class _Dummy = _Tp, class _Up = enable_if_t<is_convertible< const _Dummy, const element_type*>::value>> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator const element_type*() const { + _LIBCPP_HIDE_FROM_ABI constexpr operator const element_type*() const { return get(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type& operator*() const { return *get(); } + _LIBCPP_HIDE_FROM_ABI constexpr const element_type& operator*() const { return *get(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* operator->() { return get(); } + _LIBCPP_HIDE_FROM_ABI constexpr element_type* operator->() { return get(); } template <class _Dummy = _Tp, class _Up = enable_if_t< is_convertible<_Dummy, element_type*>::value>> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator element_type*() { + _LIBCPP_HIDE_FROM_ABI constexpr operator element_type*() { return get(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type& operator*() { return *get(); } + _LIBCPP_HIDE_FROM_ABI constexpr element_type& operator*() { return *get(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) - _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { + _LIBCPP_HIDE_FROM_ABI constexpr void swap(propagate_const& __pt) noexcept(__is_nothrow_swappable_v<_Tp>) { using std::swap; swap(__t_, __pt.__t_); } }; template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, nullptr_t) { return experimental::get_underlying(__pt) == nullptr; } template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(nullptr_t, const propagate_const<_Tp>& __pt) { return nullptr == experimental::get_underlying(__pt); } template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t) { return experimental::get_underlying(__pt) != nullptr; } template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt) { return nullptr != experimental::get_underlying(__pt); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator==(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) == experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator!=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) != experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator<(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) < experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator>(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) > experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator<=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) <= experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool -operator>=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) { return experimental::get_underlying(__pt) >= experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) == __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) != __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) < __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) > __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) <= __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u) { return experimental::get_underlying(__pt) >= __u; } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t == experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t != experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t < experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t > experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t <= experimental::get_underlying(__pu); } template <class _Tp, class _Up> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu) { +_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu) { return __t >= experimental::get_underlying(__pu); } template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) - _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { +_LIBCPP_HIDE_FROM_ABI constexpr void +swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) noexcept(__is_nothrow_swappable_v<_Tp>) { __pc1.swap(__pc2); } template <class _Tp> -_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT { +constexpr const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT { return __pt.__t_; } template <class _Tp> -_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT { +constexpr _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT { return __pt.__t_; } diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/simd b/contrib/libs/cxxsupp/libcxx/include/experimental/simd index fad6431d13..484543b81d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/simd +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/simd @@ -78,6 +78,7 @@ inline namespace parallelism_v2 { #include <experimental/__config> #include <experimental/__simd/aligned_tag.h> #include <experimental/__simd/declaration.h> +#include <experimental/__simd/reference.h> #include <experimental/__simd/scalar.h> #include <experimental/__simd/simd.h> #include <experimental/__simd/simd_mask.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits b/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits index 37be434f8e..31b041bc94 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits @@ -129,7 +129,7 @@ using is_detected = typename _DETECTOR<nonesuch, void, _Op, _Args...>::value_t; template <template <class...> class _Op, class... _Args> using detected_t = typename _DETECTOR<nonesuch, void, _Op, _Args...>::type; template <template <class...> class _Op, class... _Args> -_LIBCPP_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value; +constexpr bool is_detected_v = is_detected<_Op, _Args...>::value; template <class _Default, template <class...> class _Op, class... _Args> using detected_or = _DETECTOR<_Default, void, _Op, _Args...>; @@ -139,12 +139,12 @@ using detected_or_t = typename detected_or<_Default, _Op, _Args...>::type; template <class _Expected, template <class...> class _Op, class... _Args> using is_detected_exact = is_same<_Expected, detected_t<_Op, _Args...>>; template <class _Expected, template <class...> class _Op, class... _Args> -_LIBCPP_CONSTEXPR bool is_detected_exact_v = is_detected_exact<_Expected, _Op, _Args...>::value; +constexpr bool is_detected_exact_v = is_detected_exact<_Expected, _Op, _Args...>::value; template <class _To, template <class...> class _Op, class... _Args> using is_detected_convertible = is_convertible<detected_t<_Op, _Args...>, _To>; template <class _To, template <class...> class _Op, class... _Args> -_LIBCPP_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Args...>::value; +constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Args...>::value; _LIBCPP_END_NAMESPACE_LFTS diff --git a/contrib/libs/cxxsupp/libcxx/include/format b/contrib/libs/cxxsupp/libcxx/include/format index f1e87de0f8..07c2ba0831 100644 --- a/contrib/libs/cxxsupp/libcxx/include/format +++ b/contrib/libs/cxxsupp/libcxx/include/format @@ -193,6 +193,8 @@ namespace std { #include <__format/concepts.h> #include <__format/container_adaptor.h> #include <__format/enable_insertable.h> +#include <__format/escaped_output_table.h> +#include <__format/extended_grapheme_cluster_table.h> #include <__format/format_arg.h> #include <__format/format_arg_store.h> #include <__format/format_args.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/forward_list b/contrib/libs/cxxsupp/libcxx/include/forward_list index 1dcbe8f88b..1ae19d23f8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/forward_list +++ b/contrib/libs/cxxsupp/libcxx/include/forward_list @@ -199,7 +199,6 @@ template <class T, class Allocator, class Predicate> #include <__algorithm/lexicographical_compare.h> #include <__algorithm/lexicographical_compare_three_way.h> #include <__algorithm/min.h> -#include <__availability> #include <__config> #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> @@ -408,7 +407,7 @@ public: template <class _NodeConstPtr> class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator { - static_assert((!is_const<typename pointer_traits<_NodeConstPtr>::element_type>::value), ""); + static_assert(!is_const<typename pointer_traits<_NodeConstPtr>::element_type>::value, ""); typedef _NodeConstPtr _NodePtr; typedef __forward_node_traits<_NodePtr> __traits; @@ -511,19 +510,17 @@ protected: : __before_begin_(__begin_node(), __node_allocator(__a)) {} _LIBCPP_HIDE_FROM_ABI explicit __forward_list_base(const __node_allocator& __a) : __before_begin_(__begin_node(), __a) {} -#ifndef _LIBCPP_CXX03_LANG public: - _LIBCPP_HIDE_FROM_ABI __forward_list_base(__forward_list_base&& __x) - _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value); +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_HIDE_FROM_ABI + __forward_list_base(__forward_list_base&& __x) noexcept(is_nothrow_move_constructible<__node_allocator>::value); _LIBCPP_HIDE_FROM_ABI __forward_list_base(__forward_list_base&& __x, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG -private: - __forward_list_base(const __forward_list_base&); - __forward_list_base& operator=(const __forward_list_base&); + __forward_list_base(const __forward_list_base&) = delete; + __forward_list_base& operator=(const __forward_list_base&) = delete; -public: _LIBCPP_HIDE_FROM_ABI ~__forward_list_base(); protected: @@ -554,7 +551,6 @@ protected: return __guard.__release_ptr(); } - template <class... _Args> _LIBCPP_HIDE_FROM_ABI void __delete_node(__node_pointer __node) { // For the same reason as above, we use the allocator's destroy() method for the value_type, // but not for the node itself. @@ -569,7 +565,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value); + _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>); #endif protected: @@ -593,8 +589,8 @@ private: #ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Alloc> -inline __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x) - _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value) +inline __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x) noexcept( + is_nothrow_move_constructible<__node_allocator>::value) : __before_begin_(std::move(__x.__before_begin_)) { __x.__before_begin()->__next_ = nullptr; } @@ -620,7 +616,7 @@ inline void __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value) + _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>) #endif { std::__swap_allocator( @@ -652,16 +648,13 @@ public: typedef _Tp value_type; typedef _Alloc allocator_type; + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); - static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - - static_assert((!is_same<allocator_type, __node_allocator>::value), - "internal allocator type must differ from user-specified " - "type; otherwise overload resolution breaks"); + static_assert(!is_same<allocator_type, __node_allocator>::value, + "internal allocator type must differ from user-specified type; otherwise overload resolution breaks"); typedef value_type& reference; typedef const value_type& const_reference; @@ -712,15 +705,16 @@ public: _LIBCPP_HIDE_FROM_ABI forward_list& operator=(const forward_list& __x); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x) _NOEXCEPT_(is_nothrow_move_constructible<base>::value) + _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x) noexcept(is_nothrow_move_constructible<base>::value) : base(std::move(__x)) {} _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a); _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il); _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il, const allocator_type& __a); - _LIBCPP_HIDE_FROM_ABI forward_list& operator=(forward_list&& __x) _NOEXCEPT_( - __node_traits::propagate_on_container_move_assignment::value&& is_nothrow_move_assignable<allocator_type>::value); + _LIBCPP_HIDE_FROM_ABI forward_list& operator=(forward_list&& __x) noexcept( + __node_traits::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<allocator_type>::value); _LIBCPP_HIDE_FROM_ABI forward_list& operator=(initializer_list<value_type> __il); @@ -761,7 +755,7 @@ public: return const_iterator(base::__before_begin()); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return base::__before_begin()->__next_ == nullptr; } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { @@ -823,7 +817,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value) + _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>) #endif { base::swap(__x); @@ -1524,7 +1518,7 @@ template <class _Tp, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> operator<=>(const forward_list<_Tp, _Allocator>& __x, const forward_list<_Tp, _Allocator>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); + __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // #if _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/fstream b/contrib/libs/cxxsupp/libcxx/include/fstream index 7a084d114b..ab5ebf8e2c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/fstream +++ b/contrib/libs/cxxsupp/libcxx/include/fstream @@ -78,8 +78,8 @@ public: basic_ifstream(); explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); - explicit basic_ifstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::in); // C++17 + template<class T> + explicit basic_ifstream(const T& s, ios_base::openmode mode = ios_base::in); // Since C++17 basic_ifstream(basic_ifstream&& rhs); basic_ifstream& operator=(basic_ifstream&& rhs); @@ -117,8 +117,8 @@ public: basic_ofstream(); explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); - explicit basic_ofstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::out); // C++17 + template<class T> + explicit basic_ofstream(const T& s, ios_base::openmode mode = ios_base::out); // Since C++17 basic_ofstream(basic_ofstream&& rhs); basic_ofstream& operator=(basic_ofstream&& rhs); @@ -158,8 +158,8 @@ public: basic_fstream(); explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); - explicit basic_fstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::in|ios_base::out); C++17 + template<class T> + explicit basic_fstream(const T& s, ios_base::openmode mode = ios_base::in | ios_base::out); // Since C++17 basic_fstream(basic_fstream&& rhs); basic_fstream& operator=(basic_fstream&& rhs); @@ -188,10 +188,11 @@ typedef basic_fstream<wchar_t> wfstream; #include <__algorithm/max.h> #include <__assert> -#include <__availability> #include <__config> #include <__fwd/fstream.h> #include <__locale> +#include <__type_traits/enable_if.h> +#include <__type_traits/is_same.h> #include <__utility/move.h> #include <__utility/swap.h> #include <__utility/unreachable.h> @@ -1101,8 +1102,9 @@ public: # endif _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); # if _LIBCPP_STD_VER >= 17 - _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream( - const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) + template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>> + _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY + _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const _Tp& __p, ios_base::openmode __mode = ios_base::in) : basic_ifstream(__p.c_str(), __mode) {} # endif // _LIBCPP_STD_VER >= 17 _LIBCPP_HIDE_FROM_ABI basic_ifstream(basic_ifstream&& __rhs); @@ -1255,8 +1257,9 @@ public: _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); # if _LIBCPP_STD_VER >= 17 - _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream( - const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) + template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>> + _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY + _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const _Tp& __p, ios_base::openmode __mode = ios_base::out) : basic_ofstream(__p.c_str(), __mode) {} # endif // _LIBCPP_STD_VER >= 17 @@ -1414,8 +1417,9 @@ public: ios_base::openmode __mode = ios_base::in | ios_base::out); # if _LIBCPP_STD_VER >= 17 + template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>> _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI explicit basic_fstream( - const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) + const _Tp& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) : basic_fstream(__p.c_str(), __mode) {} # endif // _LIBCPP_STD_VER >= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/functional b/contrib/libs/cxxsupp/libcxx/include/functional index a2774a48bd..27cf21e1a4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/functional +++ b/contrib/libs/cxxsupp/libcxx/include/functional @@ -77,6 +77,15 @@ template <class T> struct unwrap_ref_decay : unwrap_reference<decay_t<T>> { }; template <class T> using unwrap_reference_t = typename unwrap_reference<T>::type; // since C++20 template <class T> using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; // since C++20 +// [refwrap.comparisons], comparisons +friend constexpr bool operator==(reference_wrapper, reference_wrapper); // Since C++26 +friend constexpr bool operator==(reference_wrapper, const T&); // Since C++26 +friend constexpr bool operator==(reference_wrapper, reference_wrapper<const T>); // Since C++26 + +friend constexpr auto operator<=>(reference_wrapper, reference_wrapper); // Since C++26 +friend constexpr auto operator<=>(reference_wrapper, const T&); // Since C++26 +friend constexpr auto operator<=>(reference_wrapper, reference_wrapper<const T>); // Since C++26 + template <class T> // <class T=void> in C++14 struct plus { T operator()(const T& x, const T& y) const; @@ -207,6 +216,12 @@ binary_negate<Predicate> not2(const Predicate& pred); template <class F> constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20 +// [func.bind.partial], function templates bind_front and bind_back +template<class F, class... Args> + constexpr unspecified bind_front(F&&, Args&&...); // C++20 +template<class F, class... Args> + constexpr unspecified bind_back(F&&, Args&&...); // C++23 + template<class T> struct is_bind_expression; template<class T> struct is_placeholder; diff --git a/contrib/libs/cxxsupp/libcxx/include/future b/contrib/libs/cxxsupp/libcxx/include/future index 3c22868606..dea73dc638 100644 --- a/contrib/libs/cxxsupp/libcxx/include/future +++ b/contrib/libs/cxxsupp/libcxx/include/future @@ -426,19 +426,19 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch) typedef underlying_type<launch>::type __launch_underlying_type; -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR launch operator&(launch __x, launch __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator&(launch __x, launch __y) { return static_cast<launch>(static_cast<__launch_underlying_type>(__x) & static_cast<__launch_underlying_type>(__y)); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR launch operator|(launch __x, launch __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator|(launch __x, launch __y) { return static_cast<launch>(static_cast<__launch_underlying_type>(__x) | static_cast<__launch_underlying_type>(__y)); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR launch operator^(launch __x, launch __y) { +inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator^(launch __x, launch __y) { return static_cast<launch>(static_cast<__launch_underlying_type>(__x) ^ static_cast<__launch_underlying_type>(__y)); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR launch operator~(launch __x) { +inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator~(launch __x) { return static_cast<launch>(~static_cast<__launch_underlying_type>(__x) & 3); } @@ -1384,11 +1384,10 @@ class __packaged_task_base; template <class _Rp, class... _ArgTypes> class __packaged_task_base<_Rp(_ArgTypes...)> { - __packaged_task_base(const __packaged_task_base&); - __packaged_task_base& operator=(const __packaged_task_base&); - public: _LIBCPP_HIDE_FROM_ABI __packaged_task_base() {} + __packaged_task_base(const __packaged_task_base&) = delete; + __packaged_task_base& operator=(const __packaged_task_base&) = delete; _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~__packaged_task_base() {} virtual void __move_to(__packaged_task_base*) _NOEXCEPT = 0; @@ -1841,9 +1840,8 @@ inline _LIBCPP_HIDE_FROM_ABI bool __does_policy_contain(launch __policy, launch } template <class _Fp, class... _Args> -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI - future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type> - async(launch __policy, _Fp&& __f, _Args&&... __args) { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type> +async(launch __policy, _Fp&& __f, _Args&&... __args) { typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF; typedef typename _BF::_Rp _Rp; @@ -1867,9 +1865,8 @@ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI } template <class _Fp, class... _Args> -_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI - future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type> - async(_Fp&& __f, _Args&&... __args) { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type> +async(_Fp&& __f, _Args&&... __args) { return std::async(launch::any, std::forward<_Fp>(__f), std::forward<_Args>(__args)...); } diff --git a/contrib/libs/cxxsupp/libcxx/include/ios b/contrib/libs/cxxsupp/libcxx/include/ios index 00c1d5c2d4..a653af005a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/ios +++ b/contrib/libs/cxxsupp/libcxx/include/ios @@ -532,7 +532,7 @@ public: typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; - static_assert((is_same<_CharT, typename traits_type::char_type>::value), + static_assert(is_same<_CharT, typename traits_type::char_type>::value, "traits_type::char_type must be the same type as CharT"); #ifdef _LIBCPP_CXX03_LANG diff --git a/contrib/libs/cxxsupp/libcxx/include/iosfwd b/contrib/libs/cxxsupp/libcxx/include/iosfwd index 9af5e05031..051c73995e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/iosfwd +++ b/contrib/libs/cxxsupp/libcxx/include/iosfwd @@ -25,7 +25,6 @@ template<> struct char_traits<wchar_t>; template<class T> class allocator; -class ios_base; template <class charT, class traits = char_traits<charT> > class basic_ios; template <class charT, class traits = char_traits<charT> > class basic_streambuf; @@ -124,8 +123,6 @@ using wosyncstream = basic_osyncstream<wchar_t>; // C++20 _LIBCPP_BEGIN_NAMESPACE_STD -class _LIBCPP_EXPORTED_FROM_ABI ios_base; - template <class _CharT, class _Traits = char_traits<_CharT> > class _LIBCPP_TEMPLATE_VIS istreambuf_iterator; template <class _CharT, class _Traits = char_traits<_CharT> > @@ -172,10 +169,10 @@ class __save_flags { fmtflags __fmtflags_; _CharT __fill_; - __save_flags(const __save_flags&); - __save_flags& operator=(const __save_flags&); - public: + __save_flags(const __save_flags&) = delete; + __save_flags& operator=(const __save_flags&) = delete; + _LIBCPP_HIDE_FROM_ABI explicit __save_flags(__stream_type& __stream) : __stream_(__stream), __fmtflags_(__stream.flags()), __fill_(__stream.fill()) {} _LIBCPP_HIDE_FROM_ABI ~__save_flags() { diff --git a/contrib/libs/cxxsupp/libcxx/include/istream b/contrib/libs/cxxsupp/libcxx/include/istream index 3f20c35504..d2b577a9ad 100644 --- a/contrib/libs/cxxsupp/libcxx/include/istream +++ b/contrib/libs/cxxsupp/libcxx/include/istream @@ -161,13 +161,15 @@ template <class Stream, class T> #include <__config> #include <__fwd/istream.h> #include <__iterator/istreambuf_iterator.h> +#include <__ostream/basic_ostream.h> #include <__type_traits/conjunction.h> #include <__type_traits/enable_if.h> #include <__type_traits/is_base_of.h> #include <__utility/declval.h> #include <__utility/forward.h> #include <bitset> -#include <ostream> +#include <ios> +#include <locale> #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -214,10 +216,10 @@ protected: basic_ios<char_type, traits_type>::swap(__rhs); } +public: basic_istream(const basic_istream& __rhs) = delete; basic_istream& operator=(const basic_istream& __rhs) = delete; -public: // 27.7.1.1.3 Prefix/suffix: class _LIBCPP_TEMPLATE_VIS sentry; @@ -1362,6 +1364,7 @@ _LIBCPP_END_NAMESPACE_STD #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <concepts> # include <iosfwd> +# include <ostream> # include <type_traits> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/iterator b/contrib/libs/cxxsupp/libcxx/include/iterator index 5779bf8287..1b9e7eaf0c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/iterator +++ b/contrib/libs/cxxsupp/libcxx/include/iterator @@ -475,6 +475,11 @@ constexpr move_iterator<Iterator> operator+( // constexpr in C++17 template <class Iterator> // constexpr in C++17 constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i); +template<class Iterator1, class Iterator2> + requires (!sized_sentinel_for<Iterator1, Iterator2>) + inline constexpr bool disable_sized_sentinel_for<move_iterator<Iterator1>, // since C++20 + move_iterator<Iterator2>> = true; + template<semiregular S> class move_sentinel { public: diff --git a/contrib/libs/cxxsupp/libcxx/include/latch b/contrib/libs/cxxsupp/libcxx/include/latch index 3cc7258381..da8dae149c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/latch +++ b/contrib/libs/cxxsupp/libcxx/include/latch @@ -50,7 +50,6 @@ namespace std #include <__atomic/atomic_base.h> #include <__atomic/atomic_sync.h> #include <__atomic/memory_order.h> -#include <__availability> #include <cstddef> #include <limits> #include <version> @@ -66,7 +65,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -class latch { +class _LIBCPP_DEPRECATED_ATOMIC_SYNC latch { __atomic_base<ptrdiff_t> __a_; public: diff --git a/contrib/libs/cxxsupp/libcxx/include/libcxx.imp b/contrib/libs/cxxsupp/libcxx/include/libcxx.imp deleted file mode 100644 index ea0ba8c547..0000000000 --- a/contrib/libs/cxxsupp/libcxx/include/libcxx.imp +++ /dev/null @@ -1,864 +0,0 @@ -[ - { include: [ "<__algorithm/adjacent_find.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/all_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/any_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/binary_search.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/clamp.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/comp.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/comp_ref_type.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/copy_backward.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/copy_move_common.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/copy_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/count.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/count_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/equal.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/equal_range.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/fill.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/fill_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find_end.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find_first_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find_if_not.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/find_segment_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/fold.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/for_each.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/for_each_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/for_each_segment.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/generate.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/generate_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/half_positive.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_found_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_fun_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_in_out_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_in_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_out_out_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/in_out_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/includes.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/inplace_merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_heap_until.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_partitioned.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_sorted.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/is_sorted_until.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/iter_swap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/iterator_operations.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/lexicographical_compare.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/lexicographical_compare_three_way.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/lower_bound.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/make_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/make_projected.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/max.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/max_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/min.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/min_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/min_max_result.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/minmax.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/minmax_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/mismatch.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/move.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/move_backward.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/next_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/none_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/nth_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/partial_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/partial_sort_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/partition.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/partition_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/partition_point.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pop_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/prev_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_any_all_none_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backend.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backend.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/any_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/backend.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/fill.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/find_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/for_each.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/libdispatch.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/serial.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/stable_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/thread.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/transform.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_backends/cpu_backends/transform_reduce.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_count.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_equal.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_fill.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_find.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_for_each.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_frontend_dispatch.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_generate.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_is_partitioned.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_move.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_replace.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_rotate_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_stable_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/pstl_transform.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/push_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_adjacent_find.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_all_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_any_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_binary_search.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_clamp.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_contains.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_contains_subrange.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_copy_backward.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_copy_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_count.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_count_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_ends_with.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_equal.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_equal_range.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_fill.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_fill_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_find.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_find_end.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_find_first_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_find_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_find_if_not.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_for_each.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_for_each_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_generate.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_generate_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_includes.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_inplace_merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_heap_until.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_partitioned.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_sorted.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_is_sorted_until.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_iterator_concept.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_lexicographical_compare.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_lower_bound.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_make_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_max.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_max_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_merge.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_min.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_min_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_minmax.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_minmax_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_mismatch.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_move.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_move_backward.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_next_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_none_of.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_nth_element.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_partial_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_partial_sort_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_partition.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_partition_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_partition_point.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_pop_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_prev_permutation.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_push_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_remove.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_remove_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_remove_copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_remove_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_replace.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_replace_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_replace_copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_replace_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_reverse.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_reverse_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_rotate.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_rotate_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_sample.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_search.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_search_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_set_difference.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_set_intersection.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_set_symmetric_difference.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_set_union.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_shuffle.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_sort_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_stable_partition.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_stable_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_starts_with.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_swap_ranges.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_transform.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_unique.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_unique_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/ranges_upper_bound.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/remove.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/remove_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/remove_copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/remove_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/replace.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/replace_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/replace_copy_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/replace_if.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/reverse.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/reverse_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/rotate.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/rotate_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/sample.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/search.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/search_n.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/set_difference.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/set_intersection.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/set_symmetric_difference.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/set_union.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/shift_left.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/shift_right.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/shuffle.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/sift_down.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/simd_utils.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/sort_heap.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/stable_partition.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/stable_sort.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/swap_ranges.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/three_way_comp_ref_type.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/transform.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/uniform_random_bit_generator_adaptor.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/unique.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/unique_copy.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/unwrap_iter.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/unwrap_range.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__algorithm/upper_bound.h>", "private", "<algorithm>", "public" ] }, - { include: [ "<__atomic/aliases.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic_base.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic_flag.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic_init.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic_lock_free.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/atomic_sync.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/check_memory_order.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/contention_t.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/cxx_atomic_impl.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/fence.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/is_always_lock_free.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/kill_dependency.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__atomic/memory_order.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__bit/bit_cast.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/bit_ceil.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/bit_floor.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/bit_log2.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/bit_width.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/blsr.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/byteswap.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/countl.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/countr.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/endian.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/has_single_bit.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/invert_if.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/popcount.h>", "private", "<bit>", "public" ] }, - { include: [ "<__bit/rotate.h>", "private", "<bit>", "public" ] }, - { include: [ "<__charconv/chars_format.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/from_chars_integral.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/from_chars_result.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/tables.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/to_chars.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/to_chars_base_10.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/to_chars_floating_point.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/to_chars_integral.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/to_chars_result.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__charconv/traits.h>", "private", "<charconv>", "public" ] }, - { include: [ "<__chrono/calendar.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/concepts.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/convert_to_timespec.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/convert_to_tm.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/day.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/duration.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/file_clock.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/formatter.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/hh_mm_ss.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/high_resolution_clock.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/literals.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/month.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/month_weekday.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/monthday.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/ostream.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/parser_std_format_spec.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/statically_widen.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/steady_clock.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/system_clock.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/time_point.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/time_zone.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/time_zone_link.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/tzdb.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/tzdb_list.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/weekday.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/year.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/year_month.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/year_month_day.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__chrono/year_month_weekday.h>", "private", "<chrono>", "public" ] }, - { include: [ "<__compare/common_comparison_category.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/compare_partial_order_fallback.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/compare_strong_order_fallback.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/compare_three_way.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/compare_three_way_result.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/compare_weak_order_fallback.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/is_eq.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/ordering.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/partial_order.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/strong_order.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/synth_three_way.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/three_way_comparable.h>", "private", "<compare>", "public" ] }, - { include: [ "<__compare/weak_order.h>", "private", "<compare>", "public" ] }, - { include: [ "<__concepts/arithmetic.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/assignable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/boolean_testable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/class_or_enum.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/common_reference_with.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/common_with.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/constructible.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/convertible_to.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/copyable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/derived_from.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/destructible.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/different_from.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/equality_comparable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/invocable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/movable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/predicate.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/regular.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/relation.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/same_as.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/semiregular.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/swappable.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__concepts/totally_ordered.h>", "private", "<concepts>", "public" ] }, - { include: [ "<__condition_variable/condition_variable.h>", "private", "<condition_variable>", "public" ] }, - { include: [ "<__coroutine/coroutine_handle.h>", "private", "<coroutine>", "public" ] }, - { include: [ "<__coroutine/coroutine_traits.h>", "private", "<coroutine>", "public" ] }, - { include: [ "<__coroutine/noop_coroutine_handle.h>", "private", "<coroutine>", "public" ] }, - { include: [ "<__coroutine/trivial_awaitables.h>", "private", "<coroutine>", "public" ] }, - { include: [ "<__exception/exception.h>", "private", "<exception>", "public" ] }, - { include: [ "<__exception/exception_ptr.h>", "private", "<exception>", "public" ] }, - { include: [ "<__exception/nested_exception.h>", "private", "<exception>", "public" ] }, - { include: [ "<__exception/operations.h>", "private", "<exception>", "public" ] }, - { include: [ "<__exception/terminate.h>", "private", "<exception>", "public" ] }, - { include: [ "<__expected/bad_expected_access.h>", "private", "<expected>", "public" ] }, - { include: [ "<__expected/expected.h>", "private", "<expected>", "public" ] }, - { include: [ "<__expected/unexpect.h>", "private", "<expected>", "public" ] }, - { include: [ "<__expected/unexpected.h>", "private", "<expected>", "public" ] }, - { include: [ "<__filesystem/copy_options.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/directory_entry.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/directory_iterator.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/directory_options.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/file_status.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/file_time_type.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/file_type.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/filesystem_error.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/operations.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/path.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/path_iterator.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/perm_options.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/perms.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/recursive_directory_iterator.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/space_info.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__filesystem/u8path.h>", "private", "<filesystem>", "public" ] }, - { include: [ "<__format/buffer.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/concepts.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/container_adaptor.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/enable_insertable.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/escaped_output_table.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/extended_grapheme_cluster_table.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_arg.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_arg_store.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_args.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_context.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_error.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_functions.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_parse_context.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_string.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/format_to_n_result.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_bool.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_char.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_floating_point.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_integer.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_integral.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_output.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_pointer.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_string.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/formatter_tuple.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/parser_std_format_spec.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/range_default_formatter.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/range_formatter.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/unicode.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/width_estimation_table.h>", "private", "<format>", "public" ] }, - { include: [ "<__format/write_escaped.h>", "private", "<format>", "public" ] }, - { include: [ "<__functional/binary_function.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/binary_negate.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/bind.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/bind_back.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/bind_front.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/binder1st.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/binder2nd.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/boyer_moore_searcher.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/compose.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/default_searcher.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/function.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/hash.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/identity.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/invoke.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/is_transparent.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/mem_fn.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/mem_fun_ref.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/not_fn.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/operations.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/perfect_forward.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/pointer_to_binary_function.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/pointer_to_unary_function.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/ranges_operations.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/reference_wrapper.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/unary_function.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/unary_negate.h>", "private", "<functional>", "public" ] }, - { include: [ "<__functional/weak_result_type.h>", "private", "<functional>", "public" ] }, - { include: [ "<__fwd/array.h>", "private", "<array>", "public" ] }, - { include: [ "<__fwd/bit_reference.h>", "private", "<bitset>", "public" ] }, - { include: [ "<__fwd/bit_reference.h>", "private", "<vector>", "public" ] }, - { include: [ "<__fwd/complex.h>", "private", "<complex>", "public" ] }, - { include: [ "<__fwd/deque.h>", "private", "<deque>", "public" ] }, - { include: [ "<__fwd/format.h>", "private", "<format>", "public" ] }, - { include: [ "<__fwd/fstream.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/functional.h>", "private", "<functional>", "public" ] }, - { include: [ "<__fwd/ios.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/istream.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/mdspan.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__fwd/memory.h>", "private", "<memory>", "public" ] }, - { include: [ "<__fwd/memory_resource.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__fwd/ostream.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/pair.h>", "private", "<utility>", "public" ] }, - { include: [ "<__fwd/queue.h>", "private", "<queue>", "public" ] }, - { include: [ "<__fwd/span.h>", "private", "<span>", "public" ] }, - { include: [ "<__fwd/sstream.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/stack.h>", "private", "<stack>", "public" ] }, - { include: [ "<__fwd/streambuf.h>", "private", "<iosfwd>", "public" ] }, - { include: [ "<__fwd/string.h>", "private", "<string>", "public" ] }, - { include: [ "<__fwd/string_view.h>", "private", "<string_view>", "public" ] }, - { include: [ "<__fwd/subrange.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__fwd/tuple.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__fwd/vector.h>", "private", "<vector>", "public" ] }, - { include: [ "<__ios/fpos.h>", "private", "<ios>", "public" ] }, - { include: [ "<__iterator/access.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/advance.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/back_insert_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/bounded_iter.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/common_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/concepts.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/counted_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/cpp17_iterator_concepts.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/data.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/default_sentinel.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/distance.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/empty.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/erase_if_container.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/front_insert_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/incrementable_traits.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/indirectly_comparable.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/insert_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/istream_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/istreambuf_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/iter_move.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/iter_swap.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/iterator_traits.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/iterator_with_data.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/mergeable.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/move_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/move_sentinel.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/next.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/ostream_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/ostreambuf_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/permutable.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/prev.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/projected.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/ranges_iterator_traits.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/readable_traits.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/reverse_access.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/reverse_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/segmented_iterator.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/size.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/sortable.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/unreachable_sentinel.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__iterator/wrap_iter.h>", "private", "<iterator>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/android.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/bsd_locale_defaults.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/bsd_locale_fallbacks.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/fuchsia.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/ibm.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/locale_guard.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/musl.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/newlib.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/openbsd.h>", "private", "<locale>", "public" ] }, - { include: [ "<__locale_dir/locale_base_api/win32.h>", "private", "<locale>", "public" ] }, - { include: [ "<__math/abs.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/copysign.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/error_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/exponential_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/fdim.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/fma.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/gamma.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/hyperbolic_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/hypot.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/inverse_hyperbolic_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/inverse_trigonometric_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/logarithms.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/min_max.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/modulo.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/remainder.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/roots.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/rounding_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/traits.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__math/trigonometric_functions.h>", "private", "<cmath>", "public" ] }, - { include: [ "<__mdspan/default_accessor.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__mdspan/extents.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__mdspan/layout_left.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__mdspan/layout_right.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__mdspan/layout_stride.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__mdspan/mdspan.h>", "private", "<mdspan>", "public" ] }, - { include: [ "<__memory/addressof.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/align.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/aligned_alloc.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocate_at_least.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocation_guard.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocator.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocator_arg_t.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocator_destructor.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/allocator_traits.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/assume_aligned.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/auto_ptr.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/builtin_new_allocator.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/compressed_pair.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/concepts.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/construct_at.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/destruct_n.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/pointer_traits.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/ranges_construct_at.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/ranges_uninitialized_algorithms.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/raw_storage_iterator.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/shared_ptr.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/swap_allocator.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/temp_value.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/temporary_buffer.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/uninitialized_algorithms.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/unique_ptr.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/uses_allocator.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/uses_allocator_construction.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory/voidify.h>", "private", "<memory>", "public" ] }, - { include: [ "<__memory_resource/memory_resource.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__memory_resource/monotonic_buffer_resource.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__memory_resource/polymorphic_allocator.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__memory_resource/pool_options.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__memory_resource/synchronized_pool_resource.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__memory_resource/unsynchronized_pool_resource.h>", "private", "<memory_resource>", "public" ] }, - { include: [ "<__mutex/lock_guard.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__mutex/mutex.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__mutex/once_flag.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__mutex/tag_types.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__mutex/unique_lock.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__numeric/accumulate.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/adjacent_difference.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/exclusive_scan.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/gcd_lcm.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/inclusive_scan.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/inner_product.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/iota.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/midpoint.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/partial_sum.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/pstl_reduce.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/pstl_transform_reduce.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/reduce.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/saturation_arithmetic.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/transform_exclusive_scan.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/transform_inclusive_scan.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__numeric/transform_reduce.h>", "private", "<numeric>", "public" ] }, - { include: [ "<__random/bernoulli_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/binomial_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/cauchy_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/chi_squared_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/clamp_to_integral.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/default_random_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/discard_block_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/discrete_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/exponential_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/extreme_value_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/fisher_f_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/gamma_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/generate_canonical.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/geometric_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/independent_bits_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/is_seed_sequence.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/is_valid.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/knuth_b.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/linear_congruential_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/log2.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/lognormal_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/mersenne_twister_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/negative_binomial_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/normal_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/piecewise_constant_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/piecewise_linear_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/poisson_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/random_device.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/ranlux.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/seed_seq.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/shuffle_order_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/student_t_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/subtract_with_carry_engine.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/uniform_int_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/uniform_random_bit_generator.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/uniform_real_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__random/weibull_distribution.h>", "private", "<random>", "public" ] }, - { include: [ "<__ranges/access.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/all.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/as_rvalue_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/chunk_by_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/common_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/concepts.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/container_compatible_range.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/counted.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/dangling.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/data.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/drop_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/drop_while_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/elements_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/empty.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/empty_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/enable_borrowed_range.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/enable_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/filter_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/from_range.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/iota_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/istream_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/join_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/lazy_split_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/movable_box.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/non_propagating_cache.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/owning_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/range_adaptor.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/rbegin.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/ref_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/rend.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/repeat_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/reverse_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/single_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/size.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/split_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/subrange.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/take_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/take_while_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/to.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/transform_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/view_interface.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/views.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__ranges/zip_view.h>", "private", "<ranges>", "public" ] }, - { include: [ "<__stop_token/atomic_unique_lock.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/intrusive_list_view.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/intrusive_shared_ptr.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/stop_callback.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/stop_source.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/stop_state.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__stop_token/stop_token.h>", "private", "<stop_token>", "public" ] }, - { include: [ "<__string/char_traits.h>", "private", "<string>", "public" ] }, - { include: [ "<__string/constexpr_c_functions.h>", "private", "<string>", "public" ] }, - { include: [ "<__string/extern_template_lists.h>", "private", "<string>", "public" ] }, - { include: [ "<__system_error/errc.h>", "private", "<system_error>", "public" ] }, - { include: [ "<__system_error/error_category.h>", "private", "<system_error>", "public" ] }, - { include: [ "<__system_error/error_code.h>", "private", "<system_error>", "public" ] }, - { include: [ "<__system_error/error_condition.h>", "private", "<system_error>", "public" ] }, - { include: [ "<__system_error/system_error.h>", "private", "<system_error>", "public" ] }, - { include: [ "<__thread/formatter.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/id.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/jthread.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/poll_with_backoff.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/support.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__thread/support.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__thread/support.h>", "private", "<semaphore>", "public" ] }, - { include: [ "<__thread/support.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/support/c11.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__thread/support/c11.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__thread/support/c11.h>", "private", "<semaphore>", "public" ] }, - { include: [ "<__thread/support/c11.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/support/external.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__thread/support/external.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__thread/support/external.h>", "private", "<semaphore>", "public" ] }, - { include: [ "<__thread/support/external.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/support/pthread.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__thread/support/pthread.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__thread/support/pthread.h>", "private", "<semaphore>", "public" ] }, - { include: [ "<__thread/support/pthread.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/support/windows.h>", "private", "<atomic>", "public" ] }, - { include: [ "<__thread/support/windows.h>", "private", "<mutex>", "public" ] }, - { include: [ "<__thread/support/windows.h>", "private", "<semaphore>", "public" ] }, - { include: [ "<__thread/support/windows.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/this_thread.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/thread.h>", "private", "<thread>", "public" ] }, - { include: [ "<__thread/timed_backoff_policy.h>", "private", "<thread>", "public" ] }, - { include: [ "<__tuple/find_index.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/make_tuple_types.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/sfinae_helpers.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_element.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_indices.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_like.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_like_ext.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_like_no_subrange.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_size.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__tuple/tuple_types.h>", "private", "<tuple>", "public" ] }, - { include: [ "<__type_traits/add_const.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/add_cv.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/add_lvalue_reference.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/add_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/add_rvalue_reference.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/add_volatile.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/aligned_storage.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/aligned_union.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/alignment_of.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/apply_cv.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/can_extract_key.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/common_reference.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/common_type.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/conditional.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/conjunction.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/copy_cv.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/copy_cvref.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/datasizeof.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/decay.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/dependent_type.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/disjunction.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/enable_if.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/extent.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/has_unique_object_representation.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/has_virtual_destructor.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/integral_constant.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/invoke.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_abstract.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_aggregate.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_allocator.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_always_bitcastable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_arithmetic.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_array.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_assignable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_base_of.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_bounded_array.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_callable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_char_like_type.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_class.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_compound.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_const.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_constant_evaluated.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_constructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_convertible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_core_convertible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_destructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_empty.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_enum.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_equality_comparable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_execution_policy.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_final.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_floating_point.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_function.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_fundamental.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_implicitly_default_constructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_integral.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_literal_type.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_member_function_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_member_object_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_member_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_nothrow_assignable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_nothrow_constructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_nothrow_convertible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_nothrow_destructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_null_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_object.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_pod.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_polymorphic.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_primary_template.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_reference.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_reference_wrapper.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_referenceable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_same.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_scalar.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_scoped_enum.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_signed.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_signed_integer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_specialization.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_standard_layout.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_swappable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivial.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_assignable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_constructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_copyable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_destructible.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_lexicographically_comparable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_trivially_relocatable.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_unbounded_array.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_union.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_unsigned.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_unsigned_integer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_valid_expansion.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_void.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/is_volatile.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/lazy.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/make_32_64_or_128_bit.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/make_const_lvalue_ref.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/make_signed.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/make_unsigned.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/maybe_const.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/nat.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/negation.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/noexcept_move_assign_container.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/operation_traits.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/promote.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/rank.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_all_extents.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_const.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_const_ref.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_cv.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_cvref.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_extent.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_pointer.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_reference.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/remove_volatile.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/result_of.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/strip_signature.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/type_identity.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/type_list.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/underlying_type.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/unwrap_ref.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__type_traits/void_t.h>", "private", "<type_traits>", "public" ] }, - { include: [ "<__utility/as_const.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/as_lvalue.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/auto_cast.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/cmp.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/convert_to_integral.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/declval.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/empty.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/exception_guard.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/exchange.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/forward.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/forward_like.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/in_place.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/integer_sequence.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/is_pointer_in_range.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/move.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/no_destroy.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/pair.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/piecewise_construct.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/priority_tag.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/rel_ops.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/small_buffer.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/swap.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/to_underlying.h>", "private", "<utility>", "public" ] }, - { include: [ "<__utility/unreachable.h>", "private", "<utility>", "public" ] }, - { include: [ "<__variant/monostate.h>", "private", "<variant>", "public" ] }, -] diff --git a/contrib/libs/cxxsupp/libcxx/include/limits b/contrib/libs/cxxsupp/libcxx/include/limits index f022048cc2..d55c7cd75f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/limits +++ b/contrib/libs/cxxsupp/libcxx/include/limits @@ -137,9 +137,9 @@ protected: typedef _Tp type; static _LIBCPP_CONSTEXPR const bool is_specialized = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return type(); } static _LIBCPP_CONSTEXPR const int digits = 0; static _LIBCPP_CONSTEXPR const int digits10 = 0; @@ -148,8 +148,8 @@ protected: static _LIBCPP_CONSTEXPR const bool is_integer = false; static _LIBCPP_CONSTEXPR const bool is_exact = false; static _LIBCPP_CONSTEXPR const int radix = 0; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(); } static _LIBCPP_CONSTEXPR const int min_exponent = 0; static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; @@ -161,10 +161,10 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(); } static _LIBCPP_CONSTEXPR const bool is_iec559 = false; static _LIBCPP_CONSTEXPR const bool is_bounded = false; @@ -198,15 +198,15 @@ protected: static _LIBCPP_CONSTEXPR const int max_digits10 = 0; static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value; static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0); - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __min; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return min(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __min; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return min(); } static _LIBCPP_CONSTEXPR const bool is_integer = true; static _LIBCPP_CONSTEXPR const bool is_exact = true; static _LIBCPP_CONSTEXPR const int radix = 2; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(0); } static _LIBCPP_CONSTEXPR const int min_exponent = 0; static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; @@ -218,10 +218,10 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(0); } static _LIBCPP_CONSTEXPR const bool is_iec559 = false; static _LIBCPP_CONSTEXPR const bool is_bounded = true; @@ -249,15 +249,15 @@ protected: static _LIBCPP_CONSTEXPR const int max_digits10 = 0; static _LIBCPP_CONSTEXPR const type __min = false; static _LIBCPP_CONSTEXPR const type __max = true; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __min; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return min(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __min; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return min(); } static _LIBCPP_CONSTEXPR const bool is_integer = true; static _LIBCPP_CONSTEXPR const bool is_exact = true; static _LIBCPP_CONSTEXPR const int radix = 2; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return type(0); } static _LIBCPP_CONSTEXPR const int min_exponent = 0; static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; @@ -269,10 +269,10 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(0); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return type(0); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return type(0); } static _LIBCPP_CONSTEXPR const bool is_iec559 = false; static _LIBCPP_CONSTEXPR const bool is_bounded = true; @@ -294,15 +294,15 @@ protected: static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__; static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__; static _LIBCPP_CONSTEXPR const int max_digits10 = 2 + (digits * 30103l) / 100000l; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __FLT_MIN__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __FLT_MAX__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __FLT_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __FLT_MAX__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } static _LIBCPP_CONSTEXPR const bool is_integer = false; static _LIBCPP_CONSTEXPR const bool is_exact = false; static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __FLT_EPSILON__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5F; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __FLT_EPSILON__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5F; } static _LIBCPP_CONSTEXPR const int min_exponent = __FLT_MIN_EXP__; static _LIBCPP_CONSTEXPR const int min_exponent10 = __FLT_MIN_10_EXP__; @@ -314,10 +314,18 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return __builtin_huge_valf(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return __builtin_nanf(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return __builtin_nansf(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return __FLT_DENORM_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { + return __builtin_huge_valf(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { + return __builtin_nanf(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { + return __builtin_nansf(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { + return __FLT_DENORM_MIN__; + } static _LIBCPP_CONSTEXPR const bool is_iec559 = true; static _LIBCPP_CONSTEXPR const bool is_bounded = true; @@ -343,15 +351,15 @@ protected: static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__; static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__; static _LIBCPP_CONSTEXPR const int max_digits10 = 2 + (digits * 30103l) / 100000l; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __DBL_MIN__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __DBL_MAX__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __DBL_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __DBL_MAX__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } static _LIBCPP_CONSTEXPR const bool is_integer = false; static _LIBCPP_CONSTEXPR const bool is_exact = false; static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __DBL_EPSILON__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __DBL_EPSILON__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5; } static _LIBCPP_CONSTEXPR const int min_exponent = __DBL_MIN_EXP__; static _LIBCPP_CONSTEXPR const int min_exponent10 = __DBL_MIN_10_EXP__; @@ -363,10 +371,18 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return __builtin_huge_val(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return __builtin_nan(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return __builtin_nans(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return __DBL_DENORM_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { + return __builtin_huge_val(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { + return __builtin_nan(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { + return __builtin_nans(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { + return __DBL_DENORM_MIN__; + } static _LIBCPP_CONSTEXPR const bool is_iec559 = true; static _LIBCPP_CONSTEXPR const bool is_bounded = true; @@ -392,15 +408,15 @@ protected: static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__; static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__; static _LIBCPP_CONSTEXPR const int max_digits10 = 2 + (digits * 30103l) / 100000l; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __LDBL_MIN__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __LDBL_MAX__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __LDBL_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __LDBL_MAX__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return -max(); } static _LIBCPP_CONSTEXPR const bool is_integer = false; static _LIBCPP_CONSTEXPR const bool is_exact = false; static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __LDBL_EPSILON__; } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5L; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __LDBL_EPSILON__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return 0.5L; } static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__; static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__; @@ -412,10 +428,18 @@ protected: static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return __builtin_huge_vall(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return __builtin_nanl(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return __builtin_nansl(""); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return __LDBL_DENORM_MIN__; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { + return __builtin_huge_vall(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { + return __builtin_nanl(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { + return __builtin_nansl(""); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { + return __LDBL_DENORM_MIN__; + } #if defined(__powerpc__) && defined(__LONG_DOUBLE_IBM128__) static _LIBCPP_CONSTEXPR const bool is_iec559 = false; @@ -441,9 +465,9 @@ class _LIBCPP_TEMPLATE_VIS numeric_limits : private __libcpp_numeric_limits<_Tp> public: static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __base::min(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return __base::lowest(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __base::min(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return __base::lowest(); } static _LIBCPP_CONSTEXPR const int digits = __base::digits; static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; @@ -452,8 +476,12 @@ public: static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; static _LIBCPP_CONSTEXPR const int radix = __base::radix; - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { return __base::epsilon(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { return __base::round_error(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT { + return __base::epsilon(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT { + return __base::round_error(); + } static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; @@ -467,10 +495,18 @@ public: static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; static _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; _LIBCPP_SUPPRESS_DEPRECATED_POP - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { return __base::infinity(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { return __base::quiet_NaN(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { return __base::signaling_NaN(); } - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { return __base::denorm_min(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT { + return __base::infinity(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT { + return __base::quiet_NaN(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT { + return __base::signaling_NaN(); + } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT { + return __base::denorm_min(); + } static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; diff --git a/contrib/libs/cxxsupp/libcxx/include/list b/contrib/libs/cxxsupp/libcxx/include/list index 9de3d1f60a..929c84de7b 100644 --- a/contrib/libs/cxxsupp/libcxx/include/list +++ b/contrib/libs/cxxsupp/libcxx/include/list @@ -203,7 +203,6 @@ template <class T, class Allocator, class Predicate> #include <__algorithm/lexicographical_compare_three_way.h> #include <__algorithm/min.h> #include <__assert> -#include <__availability> #include <__config> #include <__format/enable_insertable.h> #include <__iterator/distance.h> @@ -466,10 +465,10 @@ public: template <class _Tp, class _Alloc> class __list_imp { - __list_imp(const __list_imp&); - __list_imp& operator=(const __list_imp&); - public: + __list_imp(const __list_imp&) = delete; + __list_imp& operator=(const __list_imp&) = delete; + typedef _Alloc allocator_type; typedef allocator_traits<allocator_type> __alloc_traits; typedef typename __alloc_traits::size_type size_type; @@ -494,9 +493,8 @@ protected: typedef __rebind_alloc<__alloc_traits, __node_base> __node_base_allocator; typedef typename allocator_traits<__node_base_allocator>::pointer __node_base_pointer; - static_assert((!is_same<allocator_type, __node_allocator>::value), - "internal allocator type must differ from user-specified " - "type; otherwise overload resolution breaks"); + static_assert(!is_same<allocator_type, __node_allocator>::value, + "internal allocator type must differ from user-specified type; otherwise overload resolution breaks"); __node_base __end_; __compressed_pair<size_type, __node_allocator> __size_alloc_; @@ -534,7 +532,7 @@ protected: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __list_imp& __c) { @@ -567,7 +565,6 @@ protected: return __guard.__release_ptr(); } - template <class... _Args> _LIBCPP_HIDE_FROM_ABI void __delete_node(__node_pointer __node) { // For the same reason as above, we use the allocator's destroy() method for the value_type, // but not for the node itself. @@ -641,7 +638,7 @@ void __list_imp<_Tp, _Alloc>::swap(__list_imp& __c) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) #endif { _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR( @@ -676,7 +673,8 @@ class _LIBCPP_TEMPLATE_VIS list : private __list_imp<_Tp, _Alloc> { public: typedef _Tp value_type; typedef _Alloc allocator_type; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), + static_assert(__check_valid_allocator<allocator_type>::value); + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); typedef value_type& reference; typedef const value_type& const_reference; @@ -694,10 +692,6 @@ public: typedef void __remove_return_type; #endif - static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - _LIBCPP_HIDE_FROM_ABI list() _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {} _LIBCPP_HIDE_FROM_ABI explicit list(const allocator_type& __a) : base(__a) {} _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n); @@ -760,7 +754,7 @@ public: _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return base::__sz(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return base::empty(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return base::empty(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return std::min<size_type>(base::__node_alloc_max_size(), numeric_limits<difference_type >::max()); } @@ -863,8 +857,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value) + _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>) #endif { base::swap(__c); @@ -1056,7 +1049,7 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il) { } template <class _Tp, class _Alloc> -inline list<_Tp, _Alloc>::list(list&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value) +inline list<_Tp, _Alloc>::list(list&& __c) noexcept(is_nothrow_move_constructible<__node_allocator>::value) : base(std::move(__c.__node_alloc())) { splice(end(), __c); } @@ -1072,9 +1065,9 @@ inline list<_Tp, _Alloc>::list(list&& __c, const __type_identity_t<allocator_typ } template <class _Tp, class _Alloc> -inline list<_Tp, _Alloc>& list<_Tp, _Alloc>::operator=(list&& __c) - _NOEXCEPT_(__node_alloc_traits::propagate_on_container_move_assignment::value&& - is_nothrow_move_assignable<__node_allocator>::value) { +inline list<_Tp, _Alloc>& list<_Tp, _Alloc>::operator=(list&& __c) noexcept( + __node_alloc_traits::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<__node_allocator>::value) { __move_assign(__c, integral_constant<bool, __node_alloc_traits::propagate_on_container_move_assignment::value>()); return *this; } @@ -1089,8 +1082,8 @@ void list<_Tp, _Alloc>::__move_assign(list& __c, false_type) { } template <class _Tp, class _Alloc> -void list<_Tp, _Alloc>::__move_assign(list& __c, true_type) - _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) { +void list<_Tp, _Alloc>::__move_assign(list& __c, + true_type) noexcept(is_nothrow_move_assignable<__node_allocator>::value) { clear(); base::__move_assign_alloc(__c); splice(end(), __c); @@ -1687,7 +1680,7 @@ template <class _Tp, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); + __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/locale b/contrib/libs/cxxsupp/libcxx/include/locale index 13b911c5d2..0b2ac488e1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/locale +++ b/contrib/libs/cxxsupp/libcxx/include/locale @@ -84,7 +84,7 @@ template <class charT> charT tolower(charT c, const locale& loc); template<class Codecvt, class Elem = wchar_t, class Wide_alloc = allocator<Elem>, class Byte_alloc = allocator<char>> -class wstring_convert +class wstring_convert // Removed in C++26 { public: typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string; @@ -119,7 +119,7 @@ public: }; template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> -class wbuffer_convert +class wbuffer_convert // Removed in C++26 : public basic_streambuf<Elem, Tr> { public: @@ -368,7 +368,11 @@ struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base { static const int __num_get_buf_sz = 40; static int __get_base(ios_base&); - static const char __src[33]; + static const char __src[33]; // "0123456789abcdefABCDEFxX+-pPiInN" + // count of leading characters in __src used for parsing integers ("012..X+-") + static const size_t __int_chr_cnt = 26; + // count of leading characters in __src used for parsing floating-point values ("012..-pP") + static const size_t __fp_chr_cnt = 28; }; _LIBCPP_EXPORTED_FROM_ABI void @@ -431,7 +435,7 @@ private: template <typename _Tp> const _Tp* __do_widen_p(ios_base& __iob, _Tp* __atoms) const { locale __loc = __iob.getloc(); - use_facet<ctype<_Tp> >(__loc).widen(__src, __src + 26, __atoms); + use_facet<ctype<_Tp> >(__loc).widen(__src, __src + __int_chr_cnt, __atoms); return __atoms; } @@ -447,7 +451,7 @@ private: template <class _CharT> string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) { locale __loc = __iob.getloc(); - std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 26, __atoms); + std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + __int_chr_cnt, __atoms); const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc); __thousands_sep = __np.thousands_sep(); return __np.grouping(); @@ -458,7 +462,7 @@ template <class _CharT> string __num_get<_CharT>::__stage2_float_prep( ios_base& __iob, _CharT* __atoms, _CharT& __decimal_point, _CharT& __thousands_sep) { locale __loc = __iob.getloc(); - std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 32, __atoms); + std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + __fp_chr_cnt, __atoms); const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc); __decimal_point = __np.decimal_point(); __thousands_sep = __np.thousands_sep(); @@ -490,7 +494,7 @@ __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& } return 0; } - ptrdiff_t __f = std::find(__atoms, __atoms + 26, __ct) - __atoms; + ptrdiff_t __f = std::find(__atoms, __atoms + __int_chr_cnt, __ct) - __atoms; if (__f >= 24) return -1; switch (__base) { @@ -546,8 +550,8 @@ int __num_get<_CharT>::__stage2_float_loop( } return 0; } - ptrdiff_t __f = std::find(__atoms, __atoms + 32, __ct) - __atoms; - if (__f >= 32) + ptrdiff_t __f = std::find(__atoms, __atoms + __num_get_base::__fp_chr_cnt, __ct) - __atoms; + if (__f >= static_cast<ptrdiff_t>(__num_get_base::__fp_chr_cnt)) return -1; char __x = __src[__f]; if (__x == '-' || __x == '+') { @@ -846,7 +850,7 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_signed( int __base = this->__get_base(__iob); // Stage 2 char_type __thousands_sep; - const int __atoms_size = 26; + const int __atoms_size = __num_get_base::__int_chr_cnt; #ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET char_type __atoms1[__atoms_size]; const char_type* __atoms = this->__do_widen(__iob, __atoms1); @@ -895,7 +899,7 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_unsigned( int __base = this->__get_base(__iob); // Stage 2 char_type __thousands_sep; - const int __atoms_size = 26; + const int __atoms_size = __num_get_base::__int_chr_cnt; #ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET char_type __atoms1[__atoms_size]; const char_type* __atoms = this->__do_widen(__iob, __atoms1); @@ -942,7 +946,7 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_floating_point( iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Fp& __v) const { // Stage 1, nothing to do // Stage 2 - char_type __atoms[32]; + char_type __atoms[__num_get_base::__fp_chr_cnt]; char_type __decimal_point; char_type __thousands_sep; string __grouping = this->__stage2_float_prep(__iob, __atoms, __decimal_point, __thousands_sep); @@ -951,10 +955,11 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_floating_point( char* __a = &__buf[0]; char* __a_end = __a; unsigned __g[__num_get_base::__num_get_buf_sz]; - unsigned* __g_end = __g; - unsigned __dc = 0; - bool __in_units = true; - char __exp = 'E'; + unsigned* __g_end = __g; + unsigned __dc = 0; + bool __in_units = true; + char __exp = 'E'; + bool __is_leading_parsed = false; for (; __b != __e; ++__b) { if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); @@ -977,6 +982,21 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_floating_point( __dc, __atoms)) break; + + // the leading character excluding the sign must be a decimal digit + if (!__is_leading_parsed) { + if (__a_end - __a >= 1 && __a[0] != '-' && __a[0] != '+') { + if (('0' <= __a[0] && __a[0] <= '9') || __a[0] == '.') + __is_leading_parsed = true; + else + break; + } else if (__a_end - __a >= 2 && (__a[0] == '-' || __a[0] == '+')) { + if (('0' <= __a[1] && __a[1] <= '9') || __a[1] == '.') + __is_leading_parsed = true; + else + break; + } + } } if (__grouping.size() != 0 && __in_units && __g_end - __g < __num_get_base::__num_get_buf_sz) *__g_end++ = __dc; @@ -996,10 +1016,11 @@ _InputIterator num_get<_CharT, _InputIterator>::do_get( // Stage 1 int __base = 16; // Stage 2 - char_type __atoms[26]; + char_type __atoms[__num_get_base::__int_chr_cnt]; char_type __thousands_sep = char_type(); string __grouping; - std::use_facet<ctype<_CharT> >(__iob.getloc()).widen(__num_get_base::__src, __num_get_base::__src + 26, __atoms); + std::use_facet<ctype<_CharT> >(__iob.getloc()) + .widen(__num_get_base::__src, __num_get_base::__src + __num_get_base::__int_chr_cnt, __atoms); string __buf; __buf.resize(__buf.capacity()); char* __a = &__buf[0]; @@ -3111,6 +3132,8 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>; extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>; #endif +#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT) + template <class _Codecvt, class _Elem = wchar_t, class _WideAlloc = allocator<_Elem>, @@ -3129,25 +3152,25 @@ private: state_type __cvtstate_; size_t __cvtcount_; - wstring_convert(const wstring_convert& __wc); - wstring_convert& operator=(const wstring_convert& __wc); - public: -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI wstring_convert() : wstring_convert(new _Codecvt) {} _LIBCPP_HIDE_FROM_ABI explicit wstring_convert(_Codecvt* __pcvt); -#else +# else _LIBCPP_HIDE_FROM_ABI _LIBCPP_EXPLICIT_SINCE_CXX14 wstring_convert(_Codecvt* __pcvt = new _Codecvt); -#endif +# endif _LIBCPP_HIDE_FROM_ABI wstring_convert(_Codecvt* __pcvt, state_type __state); _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()); -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI wstring_convert(wstring_convert&& __wc); -#endif +# endif _LIBCPP_HIDE_FROM_ABI ~wstring_convert(); + wstring_convert(const wstring_convert& __wc) = delete; + wstring_convert& operator=(const wstring_convert& __wc) = delete; + _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(char __byte) { return from_bytes(&__byte, &__byte + 1); } _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __ptr) { return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr)); @@ -3187,7 +3210,7 @@ wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert( __cvtptr_ = new _Codecvt; } -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(wstring_convert&& __wc) @@ -3199,7 +3222,7 @@ inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert __wc.__cvtptr_ = nullptr; } -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> @@ -3352,18 +3375,15 @@ private: bool __owns_ib_; bool __always_noconv_; - wbuffer_convert(const wbuffer_convert&); - wbuffer_convert& operator=(const wbuffer_convert&); - public: -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI wbuffer_convert() : wbuffer_convert(nullptr) {} explicit _LIBCPP_HIDE_FROM_ABI wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); -#else +# else _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI wbuffer_convert(streambuf* __bytebuf = nullptr, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); -#endif +# endif _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert(); @@ -3374,6 +3394,9 @@ public: return __r; } + wbuffer_convert(const wbuffer_convert&) = delete; + wbuffer_convert& operator=(const wbuffer_convert&) = delete; + _LIBCPP_HIDE_FROM_ABI state_type state() const { return __st_; } protected: @@ -3716,6 +3739,8 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::__ _LIBCPP_SUPPRESS_DEPRECATED_POP +#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT) + _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS diff --git a/contrib/libs/cxxsupp/libcxx/include/map b/contrib/libs/cxxsupp/libcxx/include/map index 3025557901..3fabceff68 100644 --- a/contrib/libs/cxxsupp/libcxx/include/map +++ b/contrib/libs/cxxsupp/libcxx/include/map @@ -575,7 +575,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20 #include <__algorithm/lexicographical_compare.h> #include <__algorithm/lexicographical_compare_three_way.h> #include <__assert> -#include <__availability> #include <__config> #include <__functional/binary_function.h> #include <__functional/is_transparent.h> @@ -642,7 +641,7 @@ public: _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const { return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first); } - _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) { using std::swap; swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y)); } @@ -680,7 +679,7 @@ public: _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const { return __comp_(__x, __y.__get_value().first); } - void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { + void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) { using std::swap; swap(__comp_, __y.__comp_); } @@ -716,8 +715,6 @@ public: private: allocator_type& __na_; - __map_node_destructor& operator=(const __map_node_destructor&); - public: bool __first_constructed; bool __second_constructed; @@ -736,6 +733,8 @@ public: } #endif // _LIBCPP_CXX03_LANG + __map_node_destructor& operator=(const __map_node_destructor&) = delete; + _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT { if (__second_constructed) __alloc_traits::destroy(__na_, std::addressof(__p->__value_.__get_value().second)); @@ -809,7 +808,6 @@ public: return *this; } -private: __value_type() = delete; ~__value_type() = delete; __value_type(const __value_type&) = delete; @@ -831,11 +829,10 @@ public: _LIBCPP_HIDE_FROM_ABI value_type& __get_value() { return __cc_; } _LIBCPP_HIDE_FROM_ABI const value_type& __get_value() const { return __cc_; } -private: - __value_type(); - __value_type(__value_type const&); - __value_type& operator=(__value_type const&); - ~__value_type(); + __value_type() = delete; + __value_type(__value_type const&) = delete; + __value_type& operator=(__value_type const&) = delete; + ~__value_type() = delete; }; #endif // _LIBCPP_CXX03_LANG @@ -975,7 +972,7 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); class _LIBCPP_TEMPLATE_VIS value_compare : public __binary_function<value_type, value_type, bool> { @@ -1000,9 +997,7 @@ private: typedef typename __base::__node_traits __node_traits; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); __base __tree_; @@ -1093,12 +1088,12 @@ public: #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI map(map&& __m) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI map(map&& __m) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__m.__tree_)) {} _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a); - _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) noexcept(is_nothrow_move_assignable<__base>::value) { __tree_ = std::move(__m.__tree_); return *this; } @@ -1149,7 +1144,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); } _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); } @@ -1361,18 +1356,16 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { - __tree_.swap(__m.__tree_); - } + _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); } _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __tree_.find(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __tree_.find(__k); } @@ -1380,7 +1373,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __tree_.__count_multi(__k); } @@ -1388,7 +1381,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -1397,12 +1390,12 @@ public: _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) { return __tree_.lower_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const { return __tree_.lower_bound(__k); } @@ -1411,11 +1404,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) { return __tree_.upper_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const { return __tree_.upper_bound(__k); } @@ -1428,11 +1421,11 @@ public: return __tree_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __tree_.__equal_range_multi(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __tree_.__equal_range_multi(__k); } @@ -1479,8 +1472,9 @@ template <class _Key, class _Allocator = allocator<pair<const _Key, _Tp>>, class = enable_if_t<!__is_allocator<_Compare>::value, void>, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator()) - -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; +map(initializer_list<pair<_Key, _Tp>>, + _Compare = _Compare(), + _Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; template <class _InputIterator, class _Allocator, @@ -1499,8 +1493,8 @@ map(from_range_t, _Range&&, _Allocator) # endif template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -map(initializer_list<pair<_Key, _Tp>>, _Allocator) - -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; +map(initializer_list<pair<_Key, _Tp>>, + _Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; #endif #ifndef _LIBCPP_CXX03_LANG @@ -1624,12 +1618,7 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, template <class _Key, class _Tp, class _Compare, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>> operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) { - return std::lexicographical_compare_three_way( - __x.begin(), - __x.end(), - __y.begin(), - __y.end(), - std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>); + return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // #if _LIBCPP_STD_VER <= 17 @@ -1661,7 +1650,8 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); class _LIBCPP_TEMPLATE_VIS value_compare : public __binary_function<value_type, value_type, bool> { @@ -1686,10 +1676,6 @@ private: typedef typename __base::__node_traits __node_traits; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - __base __tree_; public: @@ -1782,12 +1768,12 @@ public: #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__m.__tree_)) {} _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a); - _LIBCPP_HIDE_FROM_ABI multimap& operator=(multimap&& __m) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI multimap& operator=(multimap&& __m) noexcept(is_nothrow_move_assignable<__base>::value) { __tree_ = std::move(__m.__tree_); return *this; } @@ -1839,7 +1825,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); } _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); } @@ -1954,18 +1940,18 @@ public: _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); } - _LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); } _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __tree_.find(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __tree_.find(__k); } @@ -1973,7 +1959,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __tree_.__count_multi(__k); } @@ -1981,7 +1967,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -1990,12 +1976,12 @@ public: _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) { return __tree_.lower_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const { return __tree_.lower_bound(__k); } @@ -2004,11 +1990,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) { return __tree_.upper_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const { return __tree_.upper_bound(__k); } @@ -2021,11 +2007,11 @@ public: return __tree_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __tree_.__equal_range_multi(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __tree_.__equal_range_multi(__k); } @@ -2066,8 +2052,9 @@ template <class _Key, class _Allocator = allocator<pair<const _Key, _Tp>>, class = enable_if_t<!__is_allocator<_Compare>::value, void>, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator()) - -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; +multimap(initializer_list<pair<_Key, _Tp>>, + _Compare = _Compare(), + _Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; template <class _InputIterator, class _Allocator, @@ -2086,8 +2073,8 @@ multimap(from_range_t, _Range&&, _Allocator) # endif template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -multimap(initializer_list<pair<_Key, _Tp>>, _Allocator) - -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; +multimap(initializer_list<pair<_Key, _Tp>>, + _Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; #endif #ifndef _LIBCPP_CXX03_LANG @@ -2146,12 +2133,7 @@ template <class _Key, class _Tp, class _Compare, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>> operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) { - return std::lexicographical_compare_three_way( - __x.begin(), - __x.end(), - __y.begin(), - __y.end(), - std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>); + return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way); } #endif // #if _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/math.h b/contrib/libs/cxxsupp/libcxx/include/math.h index 376bbf75e2..4d245d4736 100644 --- a/contrib/libs/cxxsupp/libcxx/include/math.h +++ b/contrib/libs/cxxsupp/libcxx/include/math.h @@ -391,22 +391,22 @@ namespace __math { // template on non-double overloads to make them weaker than same overloads from MSVC runtime template <class = int> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(float __x) _NOEXCEPT { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } template <class = int> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(double __x) _NOEXCEPT { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } template <class = int> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(long double __x) _NOEXCEPT { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { return __x == 0 ? FP_ZERO : FP_NORMAL; } diff --git a/contrib/libs/cxxsupp/libcxx/include/math_cuda.h b/contrib/libs/cxxsupp/libcxx/include/math_cuda.h index 542c1d0544..afbea8a039 100644 --- a/contrib/libs/cxxsupp/libcxx/include/math_cuda.h +++ b/contrib/libs/cxxsupp/libcxx/include/math_cuda.h @@ -372,29 +372,29 @@ extern "C++" { // signbit template <class _A1, std::__enable_if_t<std::is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __builtin_signbit(__x); } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value && std::is_signed<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __x < 0; } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value && !std::is_signed<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1) _NOEXCEPT { return false; } // fpclassify template <class _A1, std::__enable_if_t<std::is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { return __x == 0 ? FP_ZERO : FP_NORMAL; } @@ -405,13 +405,13 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEX template <class _A1, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1 __x) _NOEXCEPT { return __builtin_isfinite((typename std::__promote<_A1>::type)__x); } template <class _A1, std::__enable_if_t<std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) _NOEXCEPT { return true; } @@ -419,27 +419,27 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i template <class _A1, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { return __builtin_isinf((typename std::__promote<_A1>::type)__x); } template <class _A1> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI typename std::enable_if< std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, bool>::type isinf(_A1) _NOEXCEPT { return false; } #if defined(_LIBCPP_PREFERRED_OVERLOAD) && !defined(__CUDACC__) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { return __builtin_isinf(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT { return __builtin_isinf(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT { return __builtin_isinf(__x); } # endif @@ -447,25 +447,25 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI // isnan template <class _A1, std::__enable_if_t<std::is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT { return __builtin_isnan(__x); } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT { return false; } #if defined(_LIBCPP_PREFERRED_OVERLOAD) && !defined(__CUDACC__) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { return __builtin_isnan(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isnan(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isnan(double __x) _NOEXCEPT { return __builtin_isnan(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT { return __builtin_isnan(__x); } # endif @@ -473,12 +473,12 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI // isnormal template <class _A1, std::__enable_if_t<std::is_floating_point<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __builtin_isnormal(__x); } template <class _A1, std::__enable_if_t<std::is_integral<_A1>::value, int> = 0> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __x != 0; } @@ -487,7 +487,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isgreater((type)__x, (type)__y); } @@ -497,7 +497,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 _ template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isgreaterequal((type)__x, (type)__y); } @@ -507,7 +507,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isless((type)__x, (type)__y); } @@ -517,7 +517,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_islessequal((type)__x, (type)__y); } @@ -527,7 +527,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_islessgreater((type)__x, (type)__y); } @@ -537,7 +537,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _ template <class _A1, class _A2, std::__enable_if_t<std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, int> = 0> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isunordered((type)__x, (type)__y); } @@ -634,17 +634,17 @@ atan2(_A1 __y, _A2 __x) _NOEXCEPT // ceil -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float ceil(float __x) _NOEXCEPT {return __builtin_ceilf(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float ceil(float __x) _NOEXCEPT {return __builtin_ceilf(__x);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double ceil(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double ceil(double __x) _NOEXCEPT { return __builtin_ceil(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double __x) _NOEXCEPT {return __builtin_ceill(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double __x) _NOEXCEPT {return __builtin_ceill(__x);} template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type ceil(_A1 __x) _NOEXCEPT {return __builtin_ceil((double)__x);} @@ -698,33 +698,33 @@ exp(_A1 __x) _NOEXCEPT {return __builtin_exp((double)__x);} // fabs -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT {return __builtin_fabsf(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT {return __builtin_fabsf(__x);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT { return __builtin_fabs(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT {return __builtin_fabsl(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT {return __builtin_fabsl(__x);} template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type fabs(_A1 __x) _NOEXCEPT {return __builtin_fabs((double)__x);} // floor -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float floor(float __x) _NOEXCEPT {return __builtin_floorf(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float floor(float __x) _NOEXCEPT {return __builtin_floorf(__x);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double floor(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double floor(double __x) _NOEXCEPT { return __builtin_floor(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double floor(long double __x) _NOEXCEPT {return __builtin_floorl(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double floor(long double __x) _NOEXCEPT {return __builtin_floorl(__x);} template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type floor(_A1 __x) _NOEXCEPT {return __builtin_floor((double)__x);} @@ -988,31 +988,31 @@ atanh(_A1 __x) _NOEXCEPT {return __builtin_atanh((double)__x);} // cbrt -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float cbrt(float __x) _NOEXCEPT {return __builtin_cbrtf(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float cbrt(float __x) _NOEXCEPT {return __builtin_cbrtf(__x);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double cbrt(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double cbrt(double __x) _NOEXCEPT { return __builtin_cbrt(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double cbrt(long double __x) _NOEXCEPT {return __builtin_cbrtl(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double cbrt(long double __x) _NOEXCEPT {return __builtin_cbrtl(__x);} template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type cbrt(_A1 __x) _NOEXCEPT {return __builtin_cbrt((double)__x);} // copysign -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float copysign(float __x, float __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float copysign(float __x, float __y) _NOEXCEPT { return ::__builtin_copysignf(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double copysign(long double __x, long double __y) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double copysign(long double __x, long double __y) _NOEXCEPT { return ::__builtin_copysignl(__x, __y); } template <class _A1, class _A2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::__enable_if_t < std::is_arithmetic<_A1>::value && @@ -1152,17 +1152,17 @@ fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT // fmax -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT {return __builtin_fmaxf(__x, __y);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT {return __builtin_fmaxf(__x, __y);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fmax(double __x, double __y) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fmax(double __x, double __y) _NOEXCEPT { return __builtin_fmax(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmax(long double __x, long double __y) _NOEXCEPT {return __builtin_fmaxl(__x, __y);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fmax(long double __x, long double __y) _NOEXCEPT {return __builtin_fmaxl(__x, __y);} template <class _A1, class _A2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::__enable_if_t < std::is_arithmetic<_A1>::value && @@ -1179,17 +1179,17 @@ fmax(_A1 __x, _A2 __y) _NOEXCEPT // fmin -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fmin(float __x, float __y) _NOEXCEPT {return __builtin_fminf(__x, __y);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmin(float __x, float __y) _NOEXCEPT {return __builtin_fminf(__x, __y);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fmin(double __x, double __y) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fmin(double __x, double __y) _NOEXCEPT { return __builtin_fmin(__x, __y); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmin(long double __x, long double __y) _NOEXCEPT {return __builtin_fminl(__x, __y);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fmin(long double __x, long double __y) _NOEXCEPT {return __builtin_fminl(__x, __y);} template <class _A1, class _A2> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::__enable_if_t < std::is_arithmetic<_A1>::value && @@ -1415,17 +1415,17 @@ lround(_A1 __x) _NOEXCEPT // nearbyint -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float nearbyint(float __x) _NOEXCEPT {return __builtin_nearbyintf(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float nearbyint(float __x) _NOEXCEPT {return __builtin_nearbyintf(__x);} template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double nearbyint(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double nearbyint(double __x) _NOEXCEPT { return __builtin_nearbyint(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double nearbyint(long double __x) _NOEXCEPT {return __builtin_nearbyintl(__x);} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double nearbyint(long double __x) _NOEXCEPT {return __builtin_nearbyintl(__x);} template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type nearbyint(_A1 __x) _NOEXCEPT {return __builtin_nearbyint((double)__x);} @@ -1528,23 +1528,23 @@ remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT // rint -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float rint(float __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float rint(float __x) _NOEXCEPT { return __builtin_rintf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double rint(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double rint(double __x) _NOEXCEPT { return __builtin_rint(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double rint(long double __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double rint(long double __x) _NOEXCEPT { return __builtin_rintl(__x); } template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type rint(_A1 __x) _NOEXCEPT { @@ -1553,23 +1553,23 @@ rint(_A1 __x) _NOEXCEPT // round -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { return __builtin_round(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double round(long double __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double round(long double __x) _NOEXCEPT { return __builtin_roundl(__x); } template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type round(_A1 __x) _NOEXCEPT { @@ -1626,23 +1626,23 @@ tgamma(_A1 __x) _NOEXCEPT {return __builtin_tgamma((double)__x);} // trunc -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); } template <class = int> -_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { +_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { return __builtin_trunc(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double trunc(long double __x) _NOEXCEPT +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double trunc(long double __x) _NOEXCEPT { return __builtin_truncl(__x); } template <class _A1> -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if<std::is_integral<_A1>::value, double>::type trunc(_A1 __x) _NOEXCEPT { diff --git a/contrib/libs/cxxsupp/libcxx/include/mdspan b/contrib/libs/cxxsupp/libcxx/include/mdspan index c13d9eef00..8d443f4acd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/mdspan +++ b/contrib/libs/cxxsupp/libcxx/include/mdspan @@ -370,7 +370,11 @@ namespace std { template<class ElementType, class... Integrals> requires((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0) explicit mdspan(ElementType*, Integrals...) - -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>; + -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>; // until C++26 + template<class ElementType, class... Integrals> + requires((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0) + explicit mdspan(ElementType*, Integrals...) + -> mdspan<ElementType, extents<size_t, maybe-static-ext<Integrals>...>>; // since C++26 template<class ElementType, class OtherIndexType, size_t N> mdspan(ElementType*, span<OtherIndexType, N>) diff --git a/contrib/libs/cxxsupp/libcxx/include/module.modulemap b/contrib/libs/cxxsupp/libcxx/include/module.modulemap index 22c380327f..9ffccf66ff 100644 --- a/contrib/libs/cxxsupp/libcxx/include/module.modulemap +++ b/contrib/libs/cxxsupp/libcxx/include/module.modulemap @@ -570,10 +570,6 @@ module std_private_assert [system] { header "__assert" export * } -module std_private_availability [system] { - header "__availability" - export * -} module std_private_bit_reference [system] { header "__bit_reference" export * @@ -583,6 +579,11 @@ module std_private_fwd_bit_reference [system] { } module std_private_config [system] { textual header "__config" + textual header "__configuration/abi.h" + textual header "__configuration/availability.h" + textual header "__configuration/compiler.h" + textual header "__configuration/language.h" + textual header "__configuration/platform.h" export * } module std_private_hash_table [system] { @@ -700,6 +701,7 @@ module std_private_algorithm_minmax_element [system module std_private_algorithm_mismatch [system] { header "__algorithm/mismatch.h" export std_private_algorithm_simd_utils + export std_private_iterator_aliasing_iterator } module std_private_algorithm_move [system] { header "__algorithm/move.h" } module std_private_algorithm_move_backward [system] { header "__algorithm/move_backward.h" } @@ -713,61 +715,10 @@ module std_private_algorithm_partition_copy [system module std_private_algorithm_partition_point [system] { header "__algorithm/partition_point.h" } module std_private_algorithm_pop_heap [system] { header "__algorithm/pop_heap.h" } module std_private_algorithm_prev_permutation [system] { header "__algorithm/prev_permutation.h" } -module std_private_algorithm_pstl_any_all_none_of [system] { header "__algorithm/pstl_any_all_none_of.h" } -module std_private_algorithm_pstl_backend [system] { - header "__algorithm/pstl_backend.h" - export * -} -module std_private_algorithm_pstl_backends_cpu_backend [system] { - header "__algorithm/pstl_backends/cpu_backend.h" - export * -} -module std_private_algorithm_pstl_backends_cpu_backends_any_of [system] { header "__algorithm/pstl_backends/cpu_backends/any_of.h" } -module std_private_algorithm_pstl_backends_cpu_backends_backend [system] { - header "__algorithm/pstl_backends/cpu_backends/backend.h" - export * -} -module std_private_algorithm_pstl_backends_cpu_backends_fill [system] { header "__algorithm/pstl_backends/cpu_backends/fill.h" } -module std_private_algorithm_pstl_backends_cpu_backends_find_if [system] { header "__algorithm/pstl_backends/cpu_backends/find_if.h" } -module std_private_algorithm_pstl_backends_cpu_backends_for_each [system] { header "__algorithm/pstl_backends/cpu_backends/for_each.h" } -module std_private_algorithm_pstl_backends_cpu_backends_libdispatch [system] { header "__algorithm/pstl_backends/cpu_backends/libdispatch.h" } -module std_private_algorithm_pstl_backends_cpu_backends_merge [system] { header "__algorithm/pstl_backends/cpu_backends/merge.h" } -module std_private_algorithm_pstl_backends_cpu_backends_serial [system] { textual header "__algorithm/pstl_backends/cpu_backends/serial.h" } -module std_private_algorithm_pstl_backends_cpu_backends_stable_sort [system] { header "__algorithm/pstl_backends/cpu_backends/stable_sort.h" } -module std_private_algorithm_pstl_backends_cpu_backends_thread [system] { textual header "__algorithm/pstl_backends/cpu_backends/thread.h" } -module std_private_algorithm_pstl_backends_cpu_backends_transform [system] { - header "__algorithm/pstl_backends/cpu_backends/transform.h" - export std_private_algorithm_transform -} -module std_private_algorithm_pstl_backends_cpu_backends_transform_reduce [system] { header "__algorithm/pstl_backends/cpu_backends/transform_reduce.h" } -module std_private_algorithm_pstl_copy [system] { header "__algorithm/pstl_copy.h" } -module std_private_algorithm_pstl_count [system] { header "__algorithm/pstl_count.h" } -module std_private_algorithm_pstl_equal [system] { header "__algorithm/pstl_equal.h" } -module std_private_algorithm_pstl_fill [system] { header "__algorithm/pstl_fill.h" } -module std_private_algorithm_pstl_find [system] { - header "__algorithm/pstl_find.h" - export * -} -module std_private_algorithm_pstl_for_each [system] { - header "__algorithm/pstl_for_each.h" +module std_private_algorithm_pstl [system] { + header "__algorithm/pstl.h" export * } -module std_private_algorithm_pstl_frontend_dispatch [system] { - header "__algorithm/pstl_frontend_dispatch.h" - export std_private_utility_forward -} -module std_private_algorithm_pstl_generate [system] { header "__algorithm/pstl_generate.h" } -module std_private_algorithm_pstl_is_partitioned [system] { header "__algorithm/pstl_is_partitioned.h" } -module std_private_algorithm_pstl_merge [system] { header "__algorithm/pstl_merge.h" } -module std_private_algorithm_pstl_move [system] { header "__algorithm/pstl_move.h" } -module std_private_algorithm_pstl_replace [system] { header "__algorithm/pstl_replace.h" } -module std_private_algorithm_pstl_rotate_copy [system] { header "__algorithm/pstl_rotate_copy.h" } -module std_private_algorithm_pstl_sort [system] { header "__algorithm/pstl_sort.h" } -module std_private_algorithm_pstl_stable_sort [system] { - header "__algorithm/pstl_stable_sort.h" - export std_private_functional_operations -} -module std_private_algorithm_pstl_transform [system] { header "__algorithm/pstl_transform.h" } module std_private_algorithm_push_heap [system] { header "__algorithm/push_heap.h" } module std_private_algorithm_ranges_adjacent_find [system] { header "__algorithm/ranges_adjacent_find.h" } module std_private_algorithm_ranges_all_of [system] { header "__algorithm/ranges_all_of.h" } @@ -1091,7 +1042,11 @@ module std_private_atomic_atomic_flag [system] { } module std_private_atomic_atomic_init [system] { header "__atomic/atomic_init.h" } module std_private_atomic_atomic_lock_free [system] { header "__atomic/atomic_lock_free.h" } -module std_private_atomic_atomic_sync [system] { header "__atomic/atomic_sync.h" } +module std_private_atomic_atomic_ref [system] { header "__atomic/atomic_ref.h" } +module std_private_atomic_atomic_sync [system] { + header "__atomic/atomic_sync.h" + export std_private_atomic_to_gcc_order +} module std_private_atomic_check_memory_order [system] { header "__atomic/check_memory_order.h" } module std_private_atomic_contention_t [system] { header "__atomic/contention_t.h" } module std_private_atomic_cxx_atomic_impl [system] { header "__atomic/cxx_atomic_impl.h" } @@ -1099,6 +1054,10 @@ module std_private_atomic_fence [system] { header "__atomic/fence. module std_private_atomic_is_always_lock_free [system] { header "__atomic/is_always_lock_free.h" } module std_private_atomic_kill_dependency [system] { header "__atomic/kill_dependency.h" } module std_private_atomic_memory_order [system] { header "__atomic/memory_order.h" } +module std_private_atomic_to_gcc_order [system] { + header "__atomic/to_gcc_order.h" + export std_private_atomic_memory_order +} module std_private_bit_bit_cast [system] { header "__bit/bit_cast.h" } module std_private_bit_bit_ceil [system] { header "__bit/bit_ceil.h" } @@ -1123,7 +1082,10 @@ module std_private_charconv_to_chars [system] { header "__charcon module std_private_charconv_to_chars_base_10 [system] { header "__charconv/to_chars_base_10.h" } module std_private_charconv_to_chars_floating_point [system] { header "__charconv/to_chars_floating_point.h" } module std_private_charconv_to_chars_integral [system] { header "__charconv/to_chars_integral.h" } -module std_private_charconv_to_chars_result [system] { header "__charconv/to_chars_result.h" } +module std_private_charconv_to_chars_result [system] { + header "__charconv/to_chars_result.h" + export * +} module std_private_charconv_traits [system] { header "__charconv/traits.h" } module std_private_chrono_calendar [system] { header "__chrono/calendar.h" } @@ -1135,6 +1097,7 @@ module std_private_chrono_duration [system] { header "__chrono/duration.h" export std_private_type_traits_is_convertible } +module std_private_chrono_exception [system] { header "__chrono/exception.h" } module std_private_chrono_file_clock [system] { header "__chrono/file_clock.h" } module std_private_chrono_formatter [system] { header "__chrono/formatter.h" @@ -1145,7 +1108,12 @@ module std_private_chrono_high_resolution_clock [system] { export std_private_chrono_steady_clock export std_private_chrono_system_clock } +module std_private_chrono_leap_second [system] { header "__chrono/leap_second.h" } module std_private_chrono_literals [system] { header "__chrono/literals.h" } +module std_private_chrono_local_info [system] { + header "__chrono/local_info.h" + export std_private_chrono_sys_info +} module std_private_chrono_month [system] { header "__chrono/month.h" } module std_private_chrono_month_weekday [system] { header "__chrono/month_weekday.h" } module std_private_chrono_monthday [system] { header "__chrono/monthday.h" } @@ -1166,6 +1134,9 @@ module std_private_chrono_time_zone [system] { module std_private_chrono_time_zone_link [system] { header "__chrono/time_zone_link.h" } +module std_private_chrono_sys_info [system] { + header "__chrono/sys_info.h" +} module std_private_chrono_system_clock [system] { header "__chrono/system_clock.h" export std_private_chrono_time_point @@ -1184,6 +1155,7 @@ module std_private_chrono_year [system] { header "__chrono/yea module std_private_chrono_year_month [system] { header "__chrono/year_month.h" } module std_private_chrono_year_month_day [system] { header "__chrono/year_month_day.h" } module std_private_chrono_year_month_weekday [system] { header "__chrono/year_month_weekday.h" } +module std_private_chrono_zoned_time [system] { header "__chrono/zoned_time.h" } module std_private_compare_common_comparison_category [system] { header "__compare/common_comparison_category.h" } module std_private_compare_compare_partial_order_fallback [system] { header "__compare/compare_partial_order_fallback.h" } @@ -1250,6 +1222,7 @@ module std_private_coroutine_noop_coroutine_handle [system] { header "__coroutin module std_private_coroutine_trivial_awaitables [system] { header "__coroutine/trivial_awaitables.h" } module std_private_debug_utils_randomize_range [system] { header "__debug_utils/randomize_range.h" } +module std_private_debug_utils_sanitizers [system] { header "__debug_utils/sanitizers.h" } module std_private_debug_utils_strict_weak_ordering_check [system] { header "__debug_utils/strict_weak_ordering_check.h" export std_private_type_traits_is_constant_evaluated @@ -1338,12 +1311,14 @@ module std_private_format_formatter_output [system] { header "__f module std_private_format_formatter_pointer [system] { header "__format/formatter_pointer.h" } module std_private_format_formatter_string [system] { header "__format/formatter_string.h" } module std_private_format_formatter_tuple [system] { header "__format/formatter_tuple.h" } +module std_private_format_indic_conjunct_break_table [system] { header "__format/indic_conjunct_break_table.h" } module std_private_format_parser_std_format_spec [system] { header "__format/parser_std_format_spec.h" } module std_private_format_range_default_formatter [system] { header "__format/range_default_formatter.h" } module std_private_format_range_formatter [system] { header "__format/range_formatter.h" } module std_private_format_unicode [system] { header "__format/unicode.h" export std_private_format_extended_grapheme_cluster_table + export std_private_format_indic_conjunct_break_table } module std_private_format_width_estimation_table [system] { header "__format/width_estimation_table.h" } module std_private_format_write_escaped [system] { header "__format/write_escaped.h" } @@ -1380,7 +1355,10 @@ module std_private_functional_invoke [system] { module std_private_functional_is_transparent [system] { header "__functional/is_transparent.h" } module std_private_functional_mem_fn [system] { header "__functional/mem_fn.h" } module std_private_functional_mem_fun_ref [system] { header "__functional/mem_fun_ref.h" } -module std_private_functional_not_fn [system] { header "__functional/not_fn.h" } +module std_private_functional_not_fn [system] { + header "__functional/not_fn.h" + export std_private_functional_perfect_forward +} module std_private_functional_operations [system] { header "__functional/operations.h" } module std_private_functional_perfect_forward [system] { header "__functional/perfect_forward.h" @@ -1405,6 +1383,7 @@ module std_private_iosfwd_streambuf_fwd [system] { header "__fwd/streambuf.h" } module std_private_iterator_access [system] { header "__iterator/access.h" } module std_private_iterator_advance [system] { header "__iterator/advance.h" } +module std_private_iterator_aliasing_iterator [system] { header "__iterator/aliasing_iterator.h" } module std_private_iterator_back_insert_iterator [system] { header "__iterator/back_insert_iterator.h" } module std_private_iterator_bounded_iter [system] { header "__iterator/bounded_iter.h" } module std_private_iterator_common_iterator [system] { header "__iterator/common_iterator.h" } @@ -1551,7 +1530,10 @@ module std_private_memory_shared_ptr [system] { } module std_private_memory_swap_allocator [system] { header "__memory/swap_allocator.h" } module std_private_memory_temp_value [system] { header "__memory/temp_value.h" } -module std_private_memory_temporary_buffer [system] { header "__memory/temporary_buffer.h" } +module std_private_memory_temporary_buffer [system] { + header "__memory/temporary_buffer.h" + export std_private_utility_pair +} module std_private_memory_uninitialized_algorithms [system] { header "__memory/uninitialized_algorithms.h" export std_private_algorithm_copy @@ -1592,9 +1574,8 @@ module std_private_numeric_inner_product [system] { header "__numeric module std_private_numeric_iota [system] { header "__numeric/iota.h" } module std_private_numeric_midpoint [system] { header "__numeric/midpoint.h" } module std_private_numeric_partial_sum [system] { header "__numeric/partial_sum.h" } -module std_private_numeric_pstl_reduce [system] { header "__numeric/pstl_reduce.h" } -module std_private_numeric_pstl_transform_reduce [system] { - header "__numeric/pstl_transform_reduce.h" +module std_private_numeric_pstl [system] { + header "__numeric/pstl.h" export * } module std_private_numeric_reduce [system] { header "__numeric/reduce.h" } @@ -1603,8 +1584,53 @@ module std_private_numeric_transform_exclusive_scan [system] { header "__numeric module std_private_numeric_transform_inclusive_scan [system] { header "__numeric/transform_inclusive_scan.h" } module std_private_numeric_transform_reduce [system] { header "__numeric/transform_reduce.h" } +module std_private_pstl_backend [system] { + header "__pstl/backend.h" + export * +} +module std_private_pstl_backend_fwd [system] { + header "__pstl/backend_fwd.h" + export * +} +module std_private_pstl_backends_default [system] { + header "__pstl/backends/default.h" + export * +} +module std_private_pstl_backends_libdispatch [system] { + header "__pstl/backends/libdispatch.h" + export * +} +module std_private_pstl_backends_serial [system] { + header "__pstl/backends/serial.h" + export * +} +module std_private_pstl_backends_std_thread [system] { + header "__pstl/backends/std_thread.h" + export * +} +module std_private_pstl_cpu_algos_any_of [system] { header "__pstl/cpu_algos/any_of.h" } +module std_private_pstl_cpu_algos_cpu_traits [system] { header "__pstl/cpu_algos/cpu_traits.h" } +module std_private_pstl_cpu_algos_fill [system] { header "__pstl/cpu_algos/fill.h" } +module std_private_pstl_cpu_algos_find_if [system] { header "__pstl/cpu_algos/find_if.h" } +module std_private_pstl_cpu_algos_for_each [system] { header "__pstl/cpu_algos/for_each.h" } +module std_private_pstl_cpu_algos_merge [system] { header "__pstl/cpu_algos/merge.h" } +module std_private_pstl_cpu_algos_stable_sort [system] { header "__pstl/cpu_algos/stable_sort.h" } +module std_private_pstl_cpu_algos_transform [system] { header "__pstl/cpu_algos/transform.h" } +module std_private_pstl_cpu_algos_transform_reduce [system] { header "__pstl/cpu_algos/transform_reduce.h" } +module std_private_pstl_dispatch [system] { header "__pstl/dispatch.h" } +module std_private_pstl_handle_exception [system] { header "__pstl/handle_exception.h" } + module std_private_queue_fwd [system] { header "__fwd/queue.h" } +module std_private_ostream_basic_ostream [system] { + header "__ostream/basic_ostream.h" + export std_streambuf +} +module std_private_ostream_print [system] { + header "__ostream/print.h" + export std_print +} + module std_private_random_bernoulli_distribution [system] { header "__random/bernoulli_distribution.h" } module std_private_random_binomial_distribution [system] { header "__random/binomial_distribution.h" } module std_private_random_cauchy_distribution [system] { header "__random/cauchy_distribution.h" } @@ -1842,11 +1868,6 @@ module std_private_type_traits_add_volatile [system module std_private_type_traits_aligned_storage [system] { header "__type_traits/aligned_storage.h" } module std_private_type_traits_aligned_union [system] { header "__type_traits/aligned_union.h" } module std_private_type_traits_alignment_of [system] { header "__type_traits/alignment_of.h" } -module std_private_type_traits_apply_cv [system] { - header "__type_traits/apply_cv.h" - export std_private_type_traits_is_const - export std_private_type_traits_is_volatile -} module std_private_type_traits_can_extract_key [system] { header "__type_traits/can_extract_key.h" } module std_private_type_traits_common_reference [system] { header "__type_traits/common_reference.h" @@ -1866,6 +1887,7 @@ module std_private_type_traits_decay [system export std_private_type_traits_add_pointer } module std_private_type_traits_dependent_type [system] { header "__type_traits/dependent_type.h" } +module std_private_type_traits_desugars_to [system] { header "__type_traits/desugars_to.h" } module std_private_type_traits_disjunction [system] { header "__type_traits/disjunction.h" } module std_private_type_traits_enable_if [system] { header "__type_traits/enable_if.h" } module std_private_type_traits_extent [system] { header "__type_traits/extent.h" } @@ -2016,7 +2038,6 @@ module std_private_type_traits_maybe_const [system module std_private_type_traits_nat [system] { header "__type_traits/nat.h" } module std_private_type_traits_negation [system] { header "__type_traits/negation.h" } module std_private_type_traits_noexcept_move_assign_container [system] { header "__type_traits/noexcept_move_assign_container.h" } -module std_private_type_traits_operation_traits [system] { header "__type_traits/operation_traits.h" } module std_private_type_traits_promote [system] { header "__type_traits/promote.h" } module std_private_type_traits_rank [system] { header "__type_traits/rank.h" } module std_private_type_traits_remove_all_extents [system] { header "__type_traits/remove_all_extents.h" } @@ -2063,6 +2084,7 @@ module std_private_utility_forward_like [system] { header "__utility/f module std_private_utility_in_place [system] { header "__utility/in_place.h" } module std_private_utility_integer_sequence [system] { header "__utility/integer_sequence.h" } module std_private_utility_is_pointer_in_range [system] { header "__utility/is_pointer_in_range.h" } +module std_private_utility_is_valid_range [system] { header "__utility/is_valid_range.h" } module std_private_utility_move [system] { header "__utility/move.h" export std_private_type_traits_is_copy_constructible @@ -2084,18 +2106,19 @@ module std_private_utility_pair [system] { export std_private_type_traits_is_nothrow_move_assignable export std_private_utility_pair_fwd } -module std_private_utility_pair_fwd [system] { header "__fwd/pair.h" } -module std_private_utility_piecewise_construct [system] { header "__utility/piecewise_construct.h" } -module std_private_utility_priority_tag [system] { header "__utility/priority_tag.h" } -module std_private_utility_rel_ops [system] { header "__utility/rel_ops.h" } -module std_private_utility_small_buffer [system] { header "__utility/small_buffer.h" } -module std_private_utility_swap [system] { +module std_private_utility_pair_fwd [system] { header "__fwd/pair.h" } +module std_private_utility_piecewise_construct [system] { header "__utility/piecewise_construct.h" } +module std_private_utility_priority_tag [system] { header "__utility/priority_tag.h" } +module std_private_utility_private_constructor_tag [system] { header "__utility/private_constructor_tag.h" } +module std_private_utility_rel_ops [system] { header "__utility/rel_ops.h" } +module std_private_utility_small_buffer [system] { header "__utility/small_buffer.h" } +module std_private_utility_swap [system] { header "__utility/swap.h" export std_private_type_traits_is_swappable } -module std_private_utility_to_underlying [system] { header "__utility/to_underlying.h" } -module std_private_utility_unreachable [system] { header "__utility/unreachable.h" } +module std_private_utility_to_underlying [system] { header "__utility/to_underlying.h" } +module std_private_utility_unreachable [system] { header "__utility/unreachable.h" } -module std_private_variant_monostate [system] { header "__variant/monostate.h" } +module std_private_variant_monostate [system] { header "__variant/monostate.h" } -module std_private_vector_fwd [system] { header "__fwd/vector.h" } +module std_private_vector_fwd [system] { header "__fwd/vector.h" } diff --git a/contrib/libs/cxxsupp/libcxx/include/mutex b/contrib/libs/cxxsupp/libcxx/include/mutex index 12fae9a88b..02c52dd72f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/mutex +++ b/contrib/libs/cxxsupp/libcxx/include/mutex @@ -427,10 +427,10 @@ class _LIBCPP_TEMPLATE_VIS scoped_lock; template <> class _LIBCPP_TEMPLATE_VIS scoped_lock<> { public: - explicit scoped_lock() {} + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock() {} ~scoped_lock() = default; - _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t) {} + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t) {} scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; @@ -445,13 +445,15 @@ private: mutex_type& __m_; public: - explicit scoped_lock(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) : __m_(__m) { + [[nodiscard]] + _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) + : __m_(__m) { __m_.lock(); } ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) { __m_.unlock(); } - _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t, mutex_type& __m) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) : __m_(__m) {} @@ -465,9 +467,11 @@ class _LIBCPP_TEMPLATE_VIS scoped_lock { typedef tuple<_MArgs&...> _MutexTuple; public: - _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(_MArgs&... __margs) : __t_(__margs...) { std::lock(__margs...); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(_MArgs&... __margs) : __t_(__margs...) { + std::lock(__margs...); + } - _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {} + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {} _LIBCPP_HIDE_FROM_ABI ~scoped_lock() { typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices; diff --git a/contrib/libs/cxxsupp/libcxx/include/new b/contrib/libs/cxxsupp/libcxx/include/new index 5a245dc5ef..214dbc3985 100644 --- a/contrib/libs/cxxsupp/libcxx/include/new +++ b/contrib/libs/cxxsupp/libcxx/include/new @@ -203,18 +203,18 @@ inline constexpr destroying_delete_t destroying_delete{}; #if !defined(_LIBCPP_ABI_VCRUNTIME) -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC; -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* -operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC; +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT + _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; # ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT; # endif -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC; -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* -operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC; +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT + _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; # ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION @@ -222,9 +222,8 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) # endif # ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* -operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; @@ -232,9 +231,9 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, c _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT; # endif -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; -_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* +_LIBCPP_NODISCARD _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; @@ -243,12 +242,8 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, # endif # endif -_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI void* operator new(std::size_t, void* __p) _NOEXCEPT { - return __p; -} -_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI void* operator new[](std::size_t, void* __p) _NOEXCEPT { - return __p; -} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI void* operator new(std::size_t, void* __p) _NOEXCEPT { return __p; } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI void* operator new[](std::size_t, void* __p) _NOEXCEPT { return __p; } inline _LIBCPP_HIDE_FROM_ABI void operator delete(void*, void*) _NOEXCEPT {} inline _LIBCPP_HIDE_FROM_ABI void operator delete[](void*, void*) _NOEXCEPT {} @@ -333,7 +328,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __libcpp_deallocate_unsized(void* __ptr, size_ } template <class _Tp> -_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT { static_assert(!(is_function<_Tp>::value), "can't launder functions"); static_assert(!(is_same<void, __remove_cv_t<_Tp> >::value), "can't launder cv-void"); return __builtin_launder(__p); @@ -341,7 +336,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp #if _LIBCPP_STD_VER >= 17 template <class _Tp> -_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept { +[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept { return std::__launder(__p); } #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/numeric b/contrib/libs/cxxsupp/libcxx/include/numeric index 8b429fa2f7..9fb5e9fb1d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/numeric +++ b/contrib/libs/cxxsupp/libcxx/include/numeric @@ -168,23 +168,30 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin #include <__numeric/iota.h> #include <__numeric/midpoint.h> #include <__numeric/partial_sum.h> -#include <__numeric/pstl_reduce.h> -#include <__numeric/pstl_transform_reduce.h> #include <__numeric/reduce.h> #include <__numeric/saturation_arithmetic.h> #include <__numeric/transform_exclusive_scan.h> #include <__numeric/transform_inclusive_scan.h> #include <__numeric/transform_reduce.h> +#if _LIBCPP_STD_VER >= 17 +# include <__numeric/pstl.h> +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include <climits> # include <cmath> # include <concepts> +# include <cstdint> +# include <execution> # include <functional> # include <iterator> +# include <new> +# include <optional> # include <type_traits> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/optional b/contrib/libs/cxxsupp/libcxx/include/optional index e6ff8532bc..992189b0e0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/optional +++ b/contrib/libs/cxxsupp/libcxx/include/optional @@ -178,7 +178,6 @@ namespace std { */ #include <__assert> -#include <__availability> #include <__compare/compare_three_way_result.h> #include <__compare/three_way_comparable.h> #include <__concepts/invocable.h> @@ -210,6 +209,7 @@ namespace std { #include <__type_traits/is_trivially_assignable.h> #include <__type_traits/is_trivially_constructible.h> #include <__type_traits/is_trivially_destructible.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/negation.h> #include <__type_traits/remove_const.h> #include <__type_traits/remove_cvref.h> @@ -581,6 +581,8 @@ class _LIBCPP_DECLSPEC_EMPTY_BASES optional public: using value_type = _Tp; + using __trivially_relocatable = conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, optional, void>; + private: // Disable the reference extension using this static assert. static_assert(!is_same_v<__remove_cvref_t<value_type>, in_place_t>, @@ -722,9 +724,9 @@ public: template < class _Up = value_type, class = enable_if_t< _And< _IsNotSame<__remove_cvref_t<_Up>, optional>, - _Or< _IsNotSame<__remove_cvref_t<_Up>, value_type>, _Not<is_scalar<value_type>> >, - is_constructible<value_type, _Up>, - is_assignable<value_type&, _Up> >::value> > + _Or< _IsNotSame<__remove_cvref_t<_Up>, value_type>, _Not<is_scalar<value_type>> >, + is_constructible<value_type, _Up>, + is_assignable<value_type&, _Up> >::value> > _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional& operator=(_Up&& __v) { if (this->has_value()) this->__get() = std::forward<_Up>(__v); @@ -1240,9 +1242,9 @@ operator<=>(const optional<_Tp>& __x, const _Up& __v) { # endif // _LIBCPP_STD_VER >= 20 template <class _Tp> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - enable_if_t< is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, void > - swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) { +inline _LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_SINCE_CXX20 enable_if_t< is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, void > +swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } diff --git a/contrib/libs/cxxsupp/libcxx/include/ostream b/contrib/libs/cxxsupp/libcxx/include/ostream index 51778a2286..f75110e7d7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/ostream +++ b/contrib/libs/cxxsupp/libcxx/include/ostream @@ -164,6 +164,7 @@ template<class... Args> void print(ostream& os, format_string<Args...> fmt, Args&&... args); template<class... Args> // since C++23 void println(ostream& os, format_string<Args...> fmt, Args&&... args); +void println(ostream& os); // since C++26 void vprint_unicode(ostream& os, string_view fmt, format_args args); // since C++23 void vprint_nonunicode(ostream& os, string_view fmt, format_args args); // since C++23 @@ -171,1007 +172,19 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args); */ -#include <__availability> #include <__config> -#include <__exception/operations.h> -#include <__fwd/ostream.h> -#include <__memory/shared_ptr.h> -#include <__memory/unique_ptr.h> -#include <__system_error/error_code.h> -#include <__type_traits/conjunction.h> -#include <__type_traits/enable_if.h> -#include <__type_traits/is_base_of.h> -#include <__type_traits/void_t.h> -#include <__utility/declval.h> -#include <bitset> -#include <cstdio> -#include <format> -#include <ios> -#include <locale> -#include <new> -#include <print> -#include <streambuf> -#include <string_view> +#include <__ostream/basic_ostream.h> +#include <__ostream/print.h> #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _CharT, class _Traits> -class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> { -public: - // types (inherited from basic_ios (27.5.4)): - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // 27.7.2.2 Constructor/destructor: - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb) { - this->init(__sb); - } - ~basic_ostream() override; - -protected: - inline _LIBCPP_HIDE_FROM_ABI basic_ostream(basic_ostream&& __rhs); - - // 27.7.2.3 Assign/swap - inline _LIBCPP_HIDE_FROM_ABI basic_ostream& operator=(basic_ostream&& __rhs); - - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void swap(basic_ostream& __rhs) { - basic_ios<char_type, traits_type>::swap(__rhs); - } - - basic_ostream(const basic_ostream& __rhs) = delete; - basic_ostream& operator=(const basic_ostream& __rhs) = delete; - -public: - // 27.7.2.4 Prefix/suffix: - class _LIBCPP_TEMPLATE_VIS sentry; - - // 27.7.2.6 Formatted output: - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&)) { - return __pf(*this); - } - - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& - operator<<(basic_ios<char_type, traits_type>& (*__pf)(basic_ios<char_type, traits_type>&)) { - __pf(*this); - return *this; - } - - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& operator<<(ios_base& (*__pf)(ios_base&)) { - __pf(*this); - return *this; - } - - basic_ostream& operator<<(bool __n); - basic_ostream& operator<<(short __n); - basic_ostream& operator<<(unsigned short __n); - basic_ostream& operator<<(int __n); - basic_ostream& operator<<(unsigned int __n); - basic_ostream& operator<<(long __n); - basic_ostream& operator<<(unsigned long __n); - basic_ostream& operator<<(long long __n); - basic_ostream& operator<<(unsigned long long __n); - basic_ostream& operator<<(float __f); - basic_ostream& operator<<(double __f); - basic_ostream& operator<<(long double __f); - basic_ostream& operator<<(const void* __p); - -#if _LIBCPP_STD_VER >= 23 - _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(const volatile void* __p) { - return operator<<(const_cast<const void*>(__p)); - } -#endif - - basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb); - -#if _LIBCPP_STD_VER >= 17 - // LWG 2221 - nullptr. This is not backported to older standards modes. - // See https://reviews.llvm.org/D127033 for more info on the rationale. - _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(nullptr_t) { return *this << "nullptr"; } -#endif - - // 27.7.2.7 Unformatted output: - basic_ostream& put(char_type __c); - basic_ostream& write(const char_type* __s, streamsize __n); - basic_ostream& flush(); - - // 27.7.2.5 seeks: - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 pos_type tellp(); - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(pos_type __pos); - inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_ostream& seekp(off_type __off, ios_base::seekdir __dir); - -protected: - _LIBCPP_HIDE_FROM_ABI basic_ostream() {} // extension, intentially does not initialize -}; - -template <class _CharT, class _Traits> -class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry { - bool __ok_; - basic_ostream<_CharT, _Traits>& __os_; - -public: - explicit sentry(basic_ostream<_CharT, _Traits>& __os); - ~sentry(); - sentry(const sentry&) = delete; - sentry& operator=(const sentry&) = delete; - - _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ok_; } -}; - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>::sentry::sentry(basic_ostream<_CharT, _Traits>& __os) : __ok_(false), __os_(__os) { - if (__os.good()) { - if (__os.tie()) - __os.tie()->flush(); - __ok_ = true; - } -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>::sentry::~sentry() { - if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf) && !uncaught_exception()) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - if (__os_.rdbuf()->pubsync() == -1) - __os_.setstate(ios_base::badbit); -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - } -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs) { - this->move(__rhs); -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs) { - swap(__rhs); - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>::~basic_ostream() {} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& -basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - if (__sb) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - typedef istreambuf_iterator<_CharT, _Traits> _Ip; - typedef ostreambuf_iterator<_CharT, _Traits> _Op; - _Ip __i(__sb); - _Ip __eof; - _Op __o(*this); - size_t __c = 0; - for (; __i != __eof; ++__i, ++__o, ++__c) { - *__o = *__i; - if (__o.failed()) - break; - } - if (__c == 0) - this->setstate(ios_base::failbit); -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_failbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - } else - this->setstate(ios_base::badbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(bool __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(short __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, - *this, - this->fill(), - __flags == ios_base::oct || __flags == ios_base::hex - ? static_cast<long>(static_cast<unsigned short>(__n)) - : static_cast<long>(__n)) - .failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(int __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, - *this, - this->fill(), - __flags == ios_base::oct || __flags == ios_base::hex - ? static_cast<long>(static_cast<unsigned int>(__n)) - : static_cast<long>(__n)) - .failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long long __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(float __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(double __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long double __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(const void* __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; - const _Fp& __f = std::use_facet<_Fp>(this->getloc()); - if (__f.put(*this, *this, this->fill(), __n).failed()) - this->setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -__put_character_sequence(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str, size_t __len) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - typename basic_ostream<_CharT, _Traits>::sentry __s(__os); - if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _Ip; - if (std::__pad_and_output( - _Ip(__os), - __str, - (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str, - __str + __len, - __os, - __os.fill()) - .failed()) - __os.setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - __os.__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return __os; -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) { - return std::__put_character_sequence(__os, &__c, 1); -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - typename basic_ostream<_CharT, _Traits>::sentry __s(__os); - if (__s) { - _CharT __c = __os.widen(__cn); - typedef ostreambuf_iterator<_CharT, _Traits> _Ip; - if (std::__pad_and_output( - _Ip(__os), - &__c, - (__os.flags() & ios_base::adjustfield) == ios_base::left ? &__c + 1 : &__c, - &__c + 1, - __os, - __os.fill()) - .failed()) - __os.setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - __os.__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return __os; -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, char __c) { - return std::__put_character_sequence(__os, &__c, 1); -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, signed char __c) { - return std::__put_character_sequence(__os, (char*)&__c, 1); -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c) { - return std::__put_character_sequence(__os, (char*)&__c, 1); -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str) { - return std::__put_character_sequence(__os, __str, _Traits::length(__str)); -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - typename basic_ostream<_CharT, _Traits>::sentry __s(__os); - if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _Ip; - size_t __len = char_traits<char>::length(__strn); - const int __bs = 100; - _CharT __wbb[__bs]; - _CharT* __wb = __wbb; - unique_ptr<_CharT, void (*)(void*)> __h(0, free); - if (__len > __bs) { - __wb = (_CharT*)malloc(__len * sizeof(_CharT)); - if (__wb == 0) - __throw_bad_alloc(); - __h.reset(__wb); - } - for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p) - *__p = __os.widen(*__strn); - if (std::__pad_and_output( - _Ip(__os), - __wb, - (__os.flags() & ios_base::adjustfield) == ios_base::left ? __wb + __len : __wb, - __wb + __len, - __os, - __os.fill()) - .failed()) - __os.setstate(ios_base::badbit | ios_base::failbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - __os.__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return __os; -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __os, const char* __str) { - return std::__put_character_sequence(__os, __str, _Traits::length(__str)); -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& -operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str) { - const char* __s = (const char*)__str; - return std::__put_character_sequence(__os, __s, _Traits::length(__s)); -} - -template <class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<char, _Traits>& -operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str) { - const char* __s = (const char*)__str; - return std::__put_character_sequence(__os, __s, _Traits::length(__s)); -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::put(char_type __c) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __s(*this); - if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _Op; - _Op __o(*this); - *__o = __c; - if (__o.failed()) - this->setstate(ios_base::badbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n) { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - sentry __sen(*this); - if (__sen && __n) { - if (this->rdbuf()->sputn(__s, __n) != __n) - this->setstate(ios_base::badbit); - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::flush() { -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - if (this->rdbuf()) { - sentry __s(*this); - if (__s) { - if (this->rdbuf()->pubsync() == -1) - this->setstate(ios_base::badbit); - } - } -#ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_HAS_NO_EXCEPTIONS - return *this; -} - -template <class _CharT, class _Traits> -typename basic_ostream<_CharT, _Traits>::pos_type basic_ostream<_CharT, _Traits>::tellp() { - if (this->fail()) - return pos_type(-1); - return this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::seekp(pos_type __pos) { - sentry __s(*this); - if (!this->fail()) { - if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1)) - this->setstate(ios_base::failbit); - } - return *this; -} - -template <class _CharT, class _Traits> -basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir) { - sentry __s(*this); - if (!this->fail()) { - if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1)) - this->setstate(ios_base::failbit); - } - return *this; -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { - __os.put(__os.widen('\n')); - __os.flush(); - return __os; -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) { - __os.put(_CharT()); - return __os; -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& flush(basic_ostream<_CharT, _Traits>& __os) { - __os.flush(); - return __os; -} - -template <class _Stream, class _Tp, class = void> -struct __is_ostreamable : false_type {}; - -template <class _Stream, class _Tp> -struct __is_ostreamable<_Stream, _Tp, decltype(std::declval<_Stream>() << std::declval<_Tp>(), void())> : true_type {}; - -template <class _Stream, - class _Tp, - __enable_if_t<_And<is_base_of<ios_base, _Stream>, __is_ostreamable<_Stream&, const _Tp&> >::value, int> = 0> -_LIBCPP_HIDE_FROM_ABI _Stream&& operator<<(_Stream&& __os, const _Tp& __x) { - __os << __x; - return std::move(__os); -} - -template <class _CharT, class _Traits, class _Allocator> -basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const basic_string<_CharT, _Traits, _Allocator>& __str) { - return std::__put_character_sequence(__os, __str.data(), __str.size()); -} - -template <class _CharT, class _Traits> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __sv) { - return std::__put_character_sequence(__os, __sv.data(), __sv.size()); -} - -template <class _CharT, class _Traits> -inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec) { - return __os << __ec.category().name() << ':' << __ec.value(); -} - -template <class _CharT, class _Traits, class _Yp> -inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p) { - return __os << __p.get(); -} - -template < - class _CharT, - class _Traits, - class _Yp, - class _Dp, - __enable_if_t<is_same<void, - __void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>() - << std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value, - int> = 0> -inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) { - return __os << __p.get(); -} - -template <class _CharT, class _Traits, size_t _Size> -_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) { - return __os << __x.template to_string<_CharT, _Traits>(std::use_facet<ctype<_CharT> >(__os.getloc()).widen('0'), - std::use_facet<ctype<_CharT> >(__os.getloc()).widen('1')); -} - -#if 0 - -# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete; - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete; - -# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS - -# ifndef _LIBCPP_HAS_NO_CHAR8_T -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char8_t) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete; - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete; - -template <class _Traits> -basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete; -# endif - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char16_t) = delete; - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete; - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete; - -template <class _Traits> -basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete; - -#endif // _LIBCPP_STD_VER >= 20 - -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>; -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>; -#endif - -#if _LIBCPP_STD_VER >= 23 - -template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). -_LIBCPP_HIDE_FROM_ABI inline void -__vprint_nonunicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) { - // [ostream.formatted.print]/3 - // Effects: Behaves as a formatted output function - // ([ostream.formatted.reqmts]) of os, except that: - // - failure to generate output is reported as specified below, and - // - any exception thrown by the call to vformat is propagated without regard - // to the value of os.exceptions() and without turning on ios_base::badbit - // in the error state of os. - // After constructing a sentry object, the function initializes an automatic - // variable via - // string out = vformat(os.getloc(), fmt, args); - - ostream::sentry __s(__os); - if (__s) { - string __o = std::vformat(__os.getloc(), __fmt, __args); - if (__write_nl) - __o += '\n'; - - const char* __str = __o.data(); - size_t __len = __o.size(); - -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -# endif // _LIBCPP_HAS_NO_EXCEPTIONS - typedef ostreambuf_iterator<char> _Ip; - if (std::__pad_and_output( - _Ip(__os), - __str, - (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str, - __str + __len, - __os, - __os.fill()) - .failed()) - __os.setstate(ios_base::badbit | ios_base::failbit); - -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - __os.__set_badbit_and_consider_rethrow(); - } -# endif // _LIBCPP_HAS_NO_EXCEPTIONS - } -} - -template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). -_LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view __fmt, format_args __args) { - std::__vprint_nonunicode(__os, __fmt, __args, false); -} - -// Returns the FILE* associated with the __os. -// Returns a nullptr when no FILE* is associated with __os. -// This function is in the dylib since the type of the buffer associated -// with std::cout, std::cerr, and std::clog is only known in the dylib. -// -// This function implements part of the implementation-defined behavior -// of [ostream.formatted.print]/3 -// If the function is vprint_unicode and os is a stream that refers to -// a terminal capable of displaying Unicode which is determined in an -// implementation-defined manner, writes out to the terminal using the -// native Unicode API; -// Whether the returned FILE* is "a terminal capable of displaying Unicode" -// is determined in the same way as the print(FILE*, ...) overloads. -_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os); - -# ifndef _LIBCPP_HAS_NO_UNICODE -template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). -_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) { -# if _LIBCPP_AVAILABILITY_HAS_PRINT == 0 - return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl); -# else - FILE* __file = std::__get_ostream_file(__os); - if (!__file || !__print::__is_terminal(__file)) - return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl); - - // [ostream.formatted.print]/3 - // If the function is vprint_unicode and os is a stream that refers to a - // terminal capable of displaying Unicode which is determined in an - // implementation-defined manner, writes out to the terminal using the - // native Unicode API; if out contains invalid code units, the behavior is - // undefined and implementations are encouraged to diagnose it. If the - // native Unicode API is used, the function flushes os before writing out. - // - // This is the path for the native API, start with flushing. - __os.flush(); - -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try { -# endif // _LIBCPP_HAS_NO_EXCEPTIONS - ostream::sentry __s(__os); - if (__s) { -# ifndef _LIBCPP_WIN32API - __print::__vprint_unicode_posix(__file, __fmt, __args, __write_nl, true); -# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) - __print::__vprint_unicode_windows(__file, __fmt, __args, __write_nl, true); -# else -# error "Windows builds with wchar_t disabled are not supported." -# endif - } - -# ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } catch (...) { - __os.__set_badbit_and_consider_rethrow(); - } -# endif // _LIBCPP_HAS_NO_EXCEPTIONS -# endif // _LIBCPP_AVAILABILITY_HAS_PRINT -} - -template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). -_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(ostream& __os, string_view __fmt, format_args __args) { - std::__vprint_unicode(__os, __fmt, __args, false); -} -# endif // _LIBCPP_HAS_NO_UNICODE - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI void print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) { -# ifndef _LIBCPP_HAS_NO_UNICODE - if constexpr (__print::__use_unicode_execution_charset) - std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), false); - else - std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false); -# else // _LIBCPP_HAS_NO_UNICODE - std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false); -# endif // _LIBCPP_HAS_NO_UNICODE -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI void println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) { -# ifndef _LIBCPP_HAS_NO_UNICODE - // Note the wording in the Standard is inefficient. The output of - // std::format is a std::string which is then copied. This solution - // just appends a newline at the end of the output. - if constexpr (__print::__use_unicode_execution_charset) - std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), true); - else - std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true); -# else // _LIBCPP_HAS_NO_UNICODE - std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true); -# endif // _LIBCPP_HAS_NO_UNICODE -} - -#endif // _LIBCPP_STD_VER >= 23 - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <atomic> # include <concepts> +# include <cstdio> # include <cstdlib> # include <iosfwd> # include <iterator> diff --git a/contrib/libs/cxxsupp/libcxx/include/print b/contrib/libs/cxxsupp/libcxx/include/print index a9f10433a7..1a579daff2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/print +++ b/contrib/libs/cxxsupp/libcxx/include/print @@ -15,8 +15,10 @@ namespace std { // [print.fun], print functions template<class... Args> void print(format_string<Args...> fmt, Args&&... args); + void println(); // Since C++26 template<class... Args> void print(FILE* stream, format_string<Args...> fmt, Args&&... args); + void println(FILE* stream); // Since C++26 template<class... Args> void println(format_string<Args...> fmt, Args&&... args); @@ -32,7 +34,6 @@ namespace std { */ #include <__assert> -#include <__availability> #include <__concepts/same_as.h> #include <__config> #include <__system_error/system_error.h> @@ -356,6 +357,16 @@ _LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt # endif // _LIBCPP_HAS_NO_UNICODE } +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void println(FILE* __stream) { + std::print(__stream, "\n"); +} + +template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563). +_LIBCPP_HIDE_FROM_ABI inline void println() { + println(stdout); +} + template <class... _Args> _LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __args) { std::println(stdout, __fmt, std::forward<_Args>(__args)...); diff --git a/contrib/libs/cxxsupp/libcxx/include/queue b/contrib/libs/cxxsupp/libcxx/include/queue index f94cd76718..9508de9f9e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/queue +++ b/contrib/libs/cxxsupp/libcxx/include/queue @@ -303,7 +303,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; - static_assert((is_same<_Tp, value_type>::value), ""); + static_assert(is_same<_Tp, value_type>::value, ""); protected: container_type c; @@ -341,10 +341,10 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI queue(queue&& __q) _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value) + _LIBCPP_HIDE_FROM_ABI queue(queue&& __q) noexcept(is_nothrow_move_constructible<container_type>::value) : c(std::move(__q.c)) {} - _LIBCPP_HIDE_FROM_ABI queue& operator=(queue&& __q) _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) { + _LIBCPP_HIDE_FROM_ABI queue& operator=(queue&& __q) noexcept(is_nothrow_move_assignable<container_type>::value) { c = std::move(__q.c); return *this; } @@ -372,7 +372,7 @@ public: _LIBCPP_HIDE_FROM_ABI queue(queue&& __q, const _Alloc& __a) : c(std::move(__q.c), __a) {} #endif // _LIBCPP_CXX03_LANG - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); } _LIBCPP_HIDE_FROM_ABI reference front() { return c.front(); } @@ -398,20 +398,20 @@ public: template <class... _Args> _LIBCPP_HIDE_FROM_ABI # if _LIBCPP_STD_VER >= 17 - decltype(auto) - emplace(_Args&&... __args) { + decltype(auto) + emplace(_Args&&... __args) { return c.emplace_back(std::forward<_Args>(__args)...); } # else - void - emplace(_Args&&... __args) { + void + emplace(_Args&&... __args) { c.emplace_back(std::forward<_Args>(__args)...); } # endif #endif // _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI void pop() { c.pop_front(); } - _LIBCPP_HIDE_FROM_ABI void swap(queue& __q) _NOEXCEPT_(__is_nothrow_swappable<container_type>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(queue& __q) _NOEXCEPT_(__is_nothrow_swappable_v<container_type>) { using std::swap; swap(c, __q.c); } @@ -500,7 +500,7 @@ operator<=>(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y #endif -template <class _Tp, class _Container, __enable_if_t<__is_swappable<_Container>::value, int> = 0> +template <class _Tp, class _Container, __enable_if_t<__is_swappable_v<_Container>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI void swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { __x.swap(__y); @@ -519,7 +519,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; - static_assert((is_same<_Tp, value_type>::value), ""); + static_assert(is_same<_Tp, value_type>::value, ""); protected: container_type c; @@ -539,12 +539,12 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI priority_queue(priority_queue&& __q) _NOEXCEPT_( - is_nothrow_move_constructible<container_type>::value&& is_nothrow_move_constructible<value_compare>::value) + _LIBCPP_HIDE_FROM_ABI priority_queue(priority_queue&& __q) noexcept( + is_nothrow_move_constructible<container_type>::value && is_nothrow_move_constructible<value_compare>::value) : c(std::move(__q.c)), comp(std::move(__q.comp)) {} - _LIBCPP_HIDE_FROM_ABI priority_queue& operator=(priority_queue&& __q) - _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value&& is_nothrow_move_assignable<value_compare>::value) { + _LIBCPP_HIDE_FROM_ABI priority_queue& operator=(priority_queue&& __q) noexcept( + is_nothrow_move_assignable<container_type>::value && is_nothrow_move_assignable<value_compare>::value) { c = std::move(__q.c); comp = std::move(__q.comp); return *this; @@ -649,7 +649,7 @@ public: #endif - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); } _LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.front(); } @@ -676,7 +676,7 @@ public: _LIBCPP_HIDE_FROM_ABI void pop(); _LIBCPP_HIDE_FROM_ABI void swap(priority_queue& __q) - _NOEXCEPT_(__is_nothrow_swappable<container_type>::value&& __is_nothrow_swappable<value_compare>::value); + _NOEXCEPT_(__is_nothrow_swappable_v<container_type>&& __is_nothrow_swappable_v<value_compare>); _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI const _Container& __get_container() const { return c; } }; @@ -922,7 +922,7 @@ inline void priority_queue<_Tp, _Container, _Compare>::pop() { template <class _Tp, class _Container, class _Compare> inline void priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q) - _NOEXCEPT_(__is_nothrow_swappable<container_type>::value&& __is_nothrow_swappable<value_compare>::value) { + _NOEXCEPT_(__is_nothrow_swappable_v<container_type>&& __is_nothrow_swappable_v<value_compare>) { using std::swap; swap(c, __q.c); swap(comp, __q.comp); @@ -931,7 +931,7 @@ inline void priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q) template <class _Tp, class _Container, class _Compare, - __enable_if_t<__is_swappable<_Container>::value && __is_swappable<_Compare>::value, int> = 0> + __enable_if_t<__is_swappable_v<_Container> && __is_swappable_v<_Compare>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI void swap(priority_queue<_Tp, _Container, _Compare>& __x, priority_queue<_Tp, _Container, _Compare>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { diff --git a/contrib/libs/cxxsupp/libcxx/include/ranges b/contrib/libs/cxxsupp/libcxx/include/ranges index 167d2137ea..07a525ed86 100644 --- a/contrib/libs/cxxsupp/libcxx/include/ranges +++ b/contrib/libs/cxxsupp/libcxx/include/ranges @@ -93,6 +93,11 @@ namespace std::ranges { template<class T> concept viewable_range = see below; + // [range.adaptor.object], range adaptor objects + template<class D> + requires is_class_v<D> && same_as<D, remove_cv_t<D>> + class range_adaptor_closure { }; // Since c++23 + // [view.interface], class template view_interface template<class D> requires is_class_v<D> && same_as<D, remove_cv_t<D>> diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex index dc3db93744..b814135121 100644 --- a/contrib/libs/cxxsupp/libcxx/include/regex +++ b/contrib/libs/cxxsupp/libcxx/include/regex @@ -792,7 +792,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator; #include <__algorithm/find.h> #include <__algorithm/search.h> #include <__assert> -#include <__availability> #include <__config> #include <__iterator/back_insert_iterator.h> #include <__iterator/default_sentinel.h> @@ -1346,13 +1345,12 @@ struct __state { template <class _CharT> class __node { - __node(const __node&); - __node& operator=(const __node&); - public: typedef std::__state<_CharT> __state; _LIBCPP_HIDE_FROM_ABI __node() {} + __node(const __node&) = delete; + __node& operator=(const __node&) = delete; _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~__node() {} @@ -1953,14 +1951,14 @@ class __match_char : public __owns_one_state<_CharT> { _CharT __c_; - __match_char(const __match_char&); - __match_char& operator=(const __match_char&); - public: typedef std::__state<_CharT> __state; _LIBCPP_HIDE_FROM_ABI __match_char(_CharT __c, __node<_CharT>* __s) : base(__s), __c_(__c) {} + __match_char(const __match_char&) = delete; + __match_char& operator=(const __match_char&) = delete; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; @@ -1985,15 +1983,15 @@ class __match_char_icase : public __owns_one_state<_CharT> { _Traits __traits_; _CharT __c_; - __match_char_icase(const __match_char_icase&); - __match_char_icase& operator=(const __match_char_icase&); - public: typedef std::__state<_CharT> __state; _LIBCPP_HIDE_FROM_ABI __match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s) : base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {} + __match_char_icase(const __match_char_icase&) = delete; + __match_char_icase& operator=(const __match_char_icase&) = delete; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; @@ -2018,15 +2016,15 @@ class __match_char_collate : public __owns_one_state<_CharT> { _Traits __traits_; _CharT __c_; - __match_char_collate(const __match_char_collate&); - __match_char_collate& operator=(const __match_char_collate&); - public: typedef std::__state<_CharT> __state; _LIBCPP_HIDE_FROM_ABI __match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s) : base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {} + __match_char_collate(const __match_char_collate&) = delete; + __match_char_collate& operator=(const __match_char_collate&) = delete; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; @@ -2062,9 +2060,6 @@ class __bracket_expression : public __owns_one_state<_CharT> { bool __collate_; bool __might_have_digraph_; - __bracket_expression(const __bracket_expression&); - __bracket_expression& operator=(const __bracket_expression&); - public: typedef std::__state<_CharT> __state; @@ -2079,6 +2074,9 @@ public: __collate_(__collate), __might_have_digraph_(__traits_.getloc().name() != "C") {} + __bracket_expression(const __bracket_expression&) = delete; + __bracket_expression& operator=(const __bracket_expression&) = delete; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; _LIBCPP_HIDE_FROM_ABI bool __negated() const { return __negate_; } @@ -2700,9 +2698,6 @@ class __lookahead : public __owns_one_state<_CharT> { unsigned __mexp_; bool __invert_; - __lookahead(const __lookahead&); - __lookahead& operator=(const __lookahead&); - public: typedef std::__state<_CharT> __state; @@ -2710,6 +2705,9 @@ public: __lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp) : base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {} + __lookahead(const __lookahead&) = delete; + __lookahead& operator=(const __lookahead&) = delete; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; @@ -4215,11 +4213,7 @@ public: _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return str().compare(__s); } _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return str().compare(__s); } - _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s) -#ifndef _LIBCPP_CXX03_LANG - _NOEXCEPT(__is_nothrow_swappable<_BidirectionalIterator>::value) -#endif // _LIBCPP_CXX03_LANG - { + _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s) _NOEXCEPT_(__is_nothrow_swappable_v<_BidirectionalIterator>) { this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s); std::swap(matched, __s.matched); } @@ -4583,7 +4577,7 @@ public: // size: _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __matches_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __matches_.max_size(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; } // element access: _LIBCPP_HIDE_FROM_ABI difference_type length(size_type __sub = 0) const { @@ -4701,6 +4695,9 @@ private: template <class, class> friend class __lookahead; + + template <class, class, class> + friend class regex_iterator; }; template <class _BidirectionalIterator, class _Allocator> @@ -5411,7 +5408,9 @@ template <class _BidirectionalIterator, class _CharT, class _Traits> regex_iterator<_BidirectionalIterator, _CharT, _Traits>& regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++() { __flags_ |= regex_constants::__no_update_pos; - _BidirectionalIterator __start = __match_[0].second; + _BidirectionalIterator __start = __match_[0].second; + _BidirectionalIterator __prefix_start = __start; + if (__match_[0].first == __match_[0].second) { if (__start == __end_) { __match_ = value_type(); @@ -5425,9 +5424,21 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++() { else ++__start; } + __flags_ |= regex_constants::match_prev_avail; - if (!std::regex_search(__start, __end_, __match_, *__pregex_, __flags_)) + if (!std::regex_search(__start, __end_, __match_, *__pregex_, __flags_)) { __match_ = value_type(); + + } else { + // The Standard mandates that if `regex_search` returns true ([re.regiter.incr]), "`match.prefix().first` shall be + // equal to the previous value of `match[0].second`... It is unspecified how the implementation makes these + // adjustments." The adjustment is necessary if we incremented `__start` above (the branch that deals with + // zero-length matches). + auto& __prefix = __match_.__prefix_; + __prefix.first = __prefix_start; + __prefix.matched = __prefix.first != __prefix.second; + } + return *this; } diff --git a/contrib/libs/cxxsupp/libcxx/include/scoped_allocator b/contrib/libs/cxxsupp/libcxx/include/scoped_allocator index c53261025b..a49ff465b1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/scoped_allocator +++ b/contrib/libs/cxxsupp/libcxx/include/scoped_allocator @@ -313,7 +313,7 @@ false_type __has_outer_allocator_test(const volatile _Alloc& __a); template <class _Alloc> struct __has_outer_allocator - : public common_type< decltype(std::__has_outer_allocator_test(std::declval<_Alloc&>())) >::type {}; + : public common_type< decltype(std::__has_outer_allocator_test(std::declval<_Alloc&>()))>::type {}; template <class _Alloc, bool = __has_outer_allocator<_Alloc>::value> struct __outermost { @@ -389,10 +389,10 @@ public: return _Base::outer_allocator(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n) { return allocator_traits<outer_allocator_type>::allocate(outer_allocator(), __n); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n, const_void_pointer __hint) { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n, const_void_pointer __hint) { return allocator_traits<outer_allocator_type>::allocate(outer_allocator(), __n, __hint); } diff --git a/contrib/libs/cxxsupp/libcxx/include/semaphore b/contrib/libs/cxxsupp/libcxx/include/semaphore index 1375ec3f7c..8d3b04475c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/semaphore +++ b/contrib/libs/cxxsupp/libcxx/include/semaphore @@ -55,7 +55,6 @@ using binary_semaphore = counting_semaphore<1>; #include <__atomic/atomic_base.h> #include <__atomic/atomic_sync.h> #include <__atomic/memory_order.h> -#include <__availability> #include <__chrono/time_point.h> #include <__thread/poll_with_backoff.h> #include <__thread/support.h> @@ -127,7 +126,7 @@ private: }; template <ptrdiff_t __least_max_value = _LIBCPP_SEMAPHORE_MAX> -class counting_semaphore { +class _LIBCPP_DEPRECATED_ATOMIC_SYNC counting_semaphore { __atomic_semaphore_base __semaphore_; public: @@ -172,7 +171,9 @@ public: } }; -using binary_semaphore = counting_semaphore<1>; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +using binary_semaphore _LIBCPP_DEPRECATED_ATOMIC_SYNC = counting_semaphore<1>; +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/set b/contrib/libs/cxxsupp/libcxx/include/set index 90a22c61d0..f2d2b05f93 100644 --- a/contrib/libs/cxxsupp/libcxx/include/set +++ b/contrib/libs/cxxsupp/libcxx/include/set @@ -516,7 +516,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20 #include <__algorithm/lexicographical_compare.h> #include <__algorithm/lexicographical_compare_three_way.h> #include <__assert> -#include <__availability> #include <__config> #include <__functional/is_transparent.h> #include <__functional/operations.h> @@ -572,16 +571,14 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); private: typedef __tree<value_type, value_compare, allocator_type> __base; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); __base __tree_; @@ -660,7 +657,7 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI set(set&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI set(set&& __s) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__s.__tree_)) {} #endif // _LIBCPP_CXX03_LANG @@ -693,7 +690,7 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) noexcept(is_nothrow_move_assignable<__base>::value) { __tree_ = std::move(__s.__tree_); return *this; } @@ -716,7 +713,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); } _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); } @@ -814,9 +811,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { - __tree_.swap(__s.__tree_); - } + _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); } _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); } _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); } @@ -826,11 +821,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __tree_.find(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __tree_.find(__k); } @@ -838,7 +833,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __tree_.__count_multi(__k); } @@ -846,7 +841,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -855,12 +850,12 @@ public: _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) { return __tree_.lower_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const { return __tree_.lower_bound(__k); } @@ -869,11 +864,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) { return __tree_.upper_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const { return __tree_.upper_bound(__k); } @@ -886,11 +881,11 @@ public: return __tree_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __tree_.__equal_range_multi(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __tree_.__equal_range_multi(__k); } @@ -928,13 +923,15 @@ template <class _InputIterator, class _Allocator, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -set(_InputIterator, _InputIterator, _Allocator) - -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>; +set(_InputIterator, + _InputIterator, + _Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>; # if _LIBCPP_STD_VER >= 23 template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -set(from_range_t, _Range&&, _Allocator) - -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; +set(from_range_t, + _Range&&, + _Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; # endif template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> @@ -997,8 +994,7 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, template <class _Key, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key> operator<=>(const set<_Key, _Allocator>& __x, const set<_Key, _Allocator>& __y) { - return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Key, _Key>); + return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 @@ -1030,16 +1026,14 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); private: typedef __tree<value_type, value_compare, allocator_type> __base; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); __base __tree_; @@ -1121,7 +1115,7 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__s.__tree_)) {} _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a); @@ -1177,7 +1171,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); } _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); } @@ -1273,7 +1267,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); } @@ -1285,11 +1279,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __tree_.find(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __tree_.find(__k); } @@ -1297,7 +1291,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __tree_.__count_multi(__k); } @@ -1305,7 +1299,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -1314,12 +1308,12 @@ public: _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) { return __tree_.lower_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const { return __tree_.lower_bound(__k); } @@ -1328,11 +1322,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) { return __tree_.upper_bound(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const { return __tree_.upper_bound(__k); } @@ -1345,11 +1339,11 @@ public: return __tree_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 14 - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __tree_.__equal_range_multi(__k); } - template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0> + template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __tree_.__equal_range_multi(__k); } @@ -1381,8 +1375,9 @@ template <class _Key, class _Allocator = allocator<_Key>, class = enable_if_t<__is_allocator<_Allocator>::value, void>, class = enable_if_t<!__is_allocator<_Compare>::value, void>> -multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) - -> multiset<_Key, _Compare, _Allocator>; +multiset(initializer_list<_Key>, + _Compare = _Compare(), + _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>; template <class _InputIterator, class _Allocator, @@ -1393,8 +1388,9 @@ multiset(_InputIterator, _InputIterator, _Allocator) # if _LIBCPP_STD_VER >= 23 template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -multiset(from_range_t, _Range&&, _Allocator) - -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; +multiset(from_range_t, + _Range&&, + _Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; # endif template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> @@ -1459,7 +1455,7 @@ template <class _Key, class _Allocator> _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key> operator<=>(const multiset<_Key, _Allocator>& __x, const multiset<_Key, _Allocator>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Key, _Key>); + __x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/shared_mutex b/contrib/libs/cxxsupp/libcxx/include/shared_mutex index 9cc391db6f..397ac290d9 100644 --- a/contrib/libs/cxxsupp/libcxx/include/shared_mutex +++ b/contrib/libs/cxxsupp/libcxx/include/shared_mutex @@ -220,8 +220,8 @@ public: }; # endif -class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_THREAD_SAFETY_ANNOTATION(__capability__("shared_timed_mutex")) - shared_timed_mutex { +class _LIBCPP_EXPORTED_FROM_ABI +_LIBCPP_THREAD_SAFETY_ANNOTATION(__capability__("shared_timed_mutex")) shared_timed_mutex { __shared_mutex_base __base_; public: diff --git a/contrib/libs/cxxsupp/libcxx/include/span b/contrib/libs/cxxsupp/libcxx/include/span index c0fe25ddb4..60d76d830f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/span +++ b/contrib/libs/cxxsupp/libcxx/include/span @@ -18,6 +18,20 @@ namespace std { // constants inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max(); +template<class T> + concept integral-constant-like = // exposition only, since C++26 + is_integral_v<decltype(T::value)> && + !is_same_v<bool, remove_const_t<decltype(T::value)>> && + convertible_to<T, decltype(T::value)> && + equality_comparable_with<T, decltype(T::value)> && + bool_constant<T() == T::value>::value && + bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value; + +template<class T> + constexpr size_t maybe-static-ext = dynamic_extent; // exposition only, since C++26 +template<integral-constant-like T> + constexpr size_t maybe-static-ext<T> = {T::value}; + // [views.span], class template span template <class ElementType, size_t Extent = dynamic_extent> class span; @@ -110,7 +124,9 @@ private: }; template<class It, class EndOrSize> - span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>; + span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>; // until C++26 +template<class It, class EndOrSize> + span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>, maybe-static-ext<EndOrSize>>; // since C++26 template<class T, size_t N> span(T (&)[N]) -> span<T, N>; @@ -129,6 +145,8 @@ template<class R> */ #include <__assert> +#include <__concepts/convertible_to.h> +#include <__concepts/equality_comparable.h> #include <__config> #include <__fwd/array.h> #include <__fwd/span.h> @@ -143,15 +161,19 @@ template<class R> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> #include <__ranges/size.h> +#include <__type_traits/integral_constant.h> #include <__type_traits/is_array.h> #include <__type_traits/is_const.h> #include <__type_traits/is_convertible.h> +#include <__type_traits/is_integral.h> +#include <__type_traits/is_same.h> +#include <__type_traits/remove_const.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_cvref.h> #include <__type_traits/remove_reference.h> #include <__type_traits/type_identity.h> #include <__utility/forward.h> -#include <cstddef> // for byte +#include <cstddef> // for byte #include <initializer_list> #include <stdexcept> #include <version> @@ -184,12 +206,12 @@ struct __is_std_span<span<_Tp, _Sz>> : true_type {}; template <class _Range, class _ElementType> concept __span_compatible_range = - ranges::contiguous_range<_Range> && // - ranges::sized_range<_Range> && // - (ranges::borrowed_range<_Range> || is_const_v<_ElementType>)&& // - !__is_std_span<remove_cvref_t<_Range>>::value && // - !__is_std_array<remove_cvref_t<_Range>>::value && // - !is_array_v<remove_cvref_t<_Range>> && // + ranges::contiguous_range<_Range> && // + ranges::sized_range<_Range> && // + (ranges::borrowed_range<_Range> || is_const_v<_ElementType>) && // + !__is_std_span<remove_cvref_t<_Range>>::value && // + !__is_std_array<remove_cvref_t<_Range>>::value && // + !is_array_v<remove_cvref_t<_Range>> && // is_convertible_v<remove_reference_t<ranges::range_reference_t<_Range>> (*)[], _ElementType (*)[]>; template <class _From, class _To> @@ -272,7 +294,8 @@ public: } template <__span_array_convertible<element_type> _OtherElementType> - _LIBCPP_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _Extent>& __other) : __data_{__other.data()} {} + _LIBCPP_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _Extent>& __other) noexcept + : __data_{__other.data()} {} template <__span_array_convertible<element_type> _OtherElementType> _LIBCPP_HIDE_FROM_ABI constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept @@ -303,8 +326,8 @@ public: } template <size_t _Offset, size_t _Count = dynamic_extent> - _LIBCPP_HIDE_FROM_ABI constexpr auto subspan() const noexcept - -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> { + _LIBCPP_HIDE_FROM_ABI constexpr auto + subspan() const noexcept -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> { static_assert(_Offset <= _Extent, "span<T, N>::subspan<Offset, Count>(): Offset out of range"); static_assert(_Count == dynamic_extent || _Count <= _Extent - _Offset, "span<T, N>::subspan<Offset, Count>(): Offset + Count out of range"); @@ -563,8 +586,26 @@ _LIBCPP_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept { return __s.__as_writable_bytes(); } +# if _LIBCPP_STD_VER >= 26 +template <class _Tp> +concept __integral_constant_like = + is_integral_v<decltype(_Tp::value)> && !is_same_v<bool, remove_const_t<decltype(_Tp::value)>> && + convertible_to<_Tp, decltype(_Tp::value)> && equality_comparable_with<_Tp, decltype(_Tp::value)> && + bool_constant<_Tp() == _Tp::value>::value && + bool_constant<static_cast<decltype(_Tp::value)>(_Tp()) == _Tp::value>::value; + +template <class _Tp> +inline constexpr size_t __maybe_static_ext = dynamic_extent; + +template <__integral_constant_like _Tp> +inline constexpr size_t __maybe_static_ext<_Tp> = {_Tp::value}; + +template <contiguous_iterator _It, class _EndOrSize> +span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>, __maybe_static_ext<_EndOrSize>>; +# else template <contiguous_iterator _It, class _EndOrSize> span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>; +# endif template <class _Tp, size_t _Sz> span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>; diff --git a/contrib/libs/cxxsupp/libcxx/include/sstream b/contrib/libs/cxxsupp/libcxx/include/sstream index 5873deb831..9ba43ffeb8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/sstream +++ b/contrib/libs/cxxsupp/libcxx/include/sstream @@ -205,7 +205,7 @@ public: basic_ostringstream(const T& t, const Allocator& a); // Since C++26 template<class T> basic_ostringstream(const T& t, ios_base::openmode which, const Allocator& a); // Since C++26 - basic_ostringstream(const basic_ostringstream&) = delete; + basic_ostringstream(const basic_ostringstream&) = delete; basic_ostringstream(basic_ostringstream&& rhs); // [ostringstream.assign] Assign and swap: @@ -312,13 +312,12 @@ typedef basic_stringstream<wchar_t> wstringstream; // clang-format on -#include <__availability> #include <__config> #include <__fwd/sstream.h> +#include <__ostream/basic_ostream.h> #include <__type_traits/is_convertible.h> #include <__utility/swap.h> #include <istream> -#include <ostream> #include <string> #include <string_view> #include <version> @@ -330,14 +329,6 @@ typedef basic_stringstream<wchar_t> wstringstream; _LIBCPP_PUSH_MACROS #include <__undef_macros> -// TODO(LLVM-19): Remove this once we drop support for Clang 16, -// which had this bug: https://github.com/llvm/llvm-project/issues/40363 -#ifdef _WIN32 -# define _LIBCPP_HIDE_FROM_ABI_SSTREAM _LIBCPP_ALWAYS_INLINE -#else -# define _LIBCPP_HIDE_FROM_ABI_SSTREAM _LIBCPP_HIDE_FROM_ABI -#endif - _LIBCPP_BEGIN_NAMESPACE_STD // Class template basic_stringbuf [stringbuf] @@ -460,9 +451,9 @@ public: #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY) string_type str() const; #else - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const& { return str(__str_.get_allocator()); } + _LIBCPP_HIDE_FROM_ABI string_type str() const& { return str(__str_.get_allocator()); } - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { + _LIBCPP_HIDE_FROM_ABI string_type str() && { const basic_string_view<_CharT, _Traits> __view = view(); typename string_type::size_type __pos = __view.empty() ? 0 : __view.data() - __str_.data(); // In C++23, this is just string_type(std::move(__str_), __pos, __view.size(), __str_.get_allocator()); @@ -948,9 +939,9 @@ public: #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY) _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); } #else - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const& { return __sb_.str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); } - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); } #endif #if _LIBCPP_STD_VER >= 20 @@ -1085,9 +1076,9 @@ public: #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY) _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); } #else - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const& { return __sb_.str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); } - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); } #endif #if _LIBCPP_STD_VER >= 20 @@ -1225,9 +1216,9 @@ public: #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY) _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); } #else - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const& { return __sb_.str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); } - _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); } + _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); } #endif #if _LIBCPP_STD_VER >= 20 @@ -1278,6 +1269,7 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS #if _LIBCPP_STD_VER <= 20 && !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) +# include <ostream> # include <type_traits> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/stack b/contrib/libs/cxxsupp/libcxx/include/stack index 08a392da68..90f8933cca 100644 --- a/contrib/libs/cxxsupp/libcxx/include/stack +++ b/contrib/libs/cxxsupp/libcxx/include/stack @@ -157,7 +157,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; - static_assert((is_same<_Tp, value_type>::value), ""); + static_assert(is_same<_Tp, value_type>::value, ""); protected: container_type c; @@ -173,10 +173,10 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI stack(stack&& __q) _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value) + _LIBCPP_HIDE_FROM_ABI stack(stack&& __q) noexcept(is_nothrow_move_constructible<container_type>::value) : c(std::move(__q.c)) {} - _LIBCPP_HIDE_FROM_ABI stack& operator=(stack&& __q) _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) { + _LIBCPP_HIDE_FROM_ABI stack& operator=(stack&& __q) noexcept(is_nothrow_move_assignable<container_type>::value) { c = std::move(__q.c); return *this; } @@ -219,7 +219,7 @@ public: template <class _InputIterator, class _Alloc, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0, - __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0> + __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc) : c(__first, __last, __alloc) {} @@ -231,7 +231,7 @@ public: #endif - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); } _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); } _LIBCPP_HIDE_FROM_ABI reference top() { return c.back(); } _LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.back(); } @@ -254,13 +254,13 @@ public: template <class... _Args> _LIBCPP_HIDE_FROM_ABI # if _LIBCPP_STD_VER >= 17 - decltype(auto) - emplace(_Args&&... __args) { + decltype(auto) + emplace(_Args&&... __args) { return c.emplace_back(std::forward<_Args>(__args)...); } # else - void - emplace(_Args&&... __args) { + void + emplace(_Args&&... __args) { c.emplace_back(std::forward<_Args>(__args)...); } # endif @@ -268,7 +268,7 @@ public: _LIBCPP_HIDE_FROM_ABI void pop() { c.pop_back(); } - _LIBCPP_HIDE_FROM_ABI void swap(stack& __s) _NOEXCEPT_(__is_nothrow_swappable<container_type>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(stack& __s) _NOEXCEPT_(__is_nothrow_swappable_v<container_type>) { using std::swap; swap(c, __s.c); } @@ -303,13 +303,15 @@ stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>; template <class _InputIterator, class _Alloc, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0, - __enable_if_t<__is_allocator<_Alloc>::value, int> = 0> -stack(_InputIterator, _InputIterator, _Alloc) - -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>; + __enable_if_t<__is_allocator<_Alloc>::value, int> = 0> +stack(_InputIterator, + _InputIterator, + _Alloc) -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>; template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0> -stack(from_range_t, _Range&&, _Alloc) - -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>; +stack(from_range_t, + _Range&&, + _Alloc) -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>; #endif @@ -354,7 +356,7 @@ operator<=>(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y #endif -template <class _Tp, class _Container, __enable_if_t<__is_swappable<_Container>::value, int> = 0> +template <class _Tp, class _Container, __enable_if_t<__is_swappable_v<_Container>, int> = 0> inline _LIBCPP_HIDE_FROM_ABI void swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { __x.swap(__y); diff --git a/contrib/libs/cxxsupp/libcxx/include/stdexcept b/contrib/libs/cxxsupp/libcxx/include/stdexcept index 4e4cd22a6a..853c185187 100644 --- a/contrib/libs/cxxsupp/libcxx/include/stdexcept +++ b/contrib/libs/cxxsupp/libcxx/include/stdexcept @@ -17,14 +17,14 @@ namespace std { class logic_error; - class domain_error; - class invalid_argument; - class length_error; - class out_of_range; +class domain_error; +class invalid_argument; +class length_error; +class out_of_range; class runtime_error; - class range_error; - class overflow_error; - class underflow_error; +class range_error; +class overflow_error; +class underflow_error; for each class xxx_error: diff --git a/contrib/libs/cxxsupp/libcxx/include/stdlib.h b/contrib/libs/cxxsupp/libcxx/include/stdlib.h index a9ba438a2c..a74344d491 100644 --- a/contrib/libs/cxxsupp/libcxx/include/stdlib.h +++ b/contrib/libs/cxxsupp/libcxx/include/stdlib.h @@ -110,21 +110,19 @@ extern "C++" { // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined # if !defined(_LIBCPP_MSVCRT) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long abs(long __x) _NOEXCEPT { return __builtin_labs(__x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long long abs(long long __x) _NOEXCEPT { - return __builtin_llabs(__x); -} +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long abs(long __x) _NOEXCEPT { return __builtin_labs(__x); } +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long long abs(long long __x) _NOEXCEPT { return __builtin_llabs(__x); } # endif // !defined(_LIBCPP_MSVCRT) -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float abs(float __lcpp_x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float abs(float __lcpp_x) _NOEXCEPT { return __builtin_fabsf(__lcpp_x); // Use builtins to prevent needing math.h } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double abs(double __lcpp_x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI double abs(double __lcpp_x) _NOEXCEPT { return __builtin_fabs(__lcpp_x); } -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double abs(long double __lcpp_x) _NOEXCEPT { +_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double abs(long double __lcpp_x) _NOEXCEPT { return __builtin_fabsl(__lcpp_x); } diff --git a/contrib/libs/cxxsupp/libcxx/include/streambuf b/contrib/libs/cxxsupp/libcxx/include/streambuf index aec537866c..5a3c17ef7c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/streambuf +++ b/contrib/libs/cxxsupp/libcxx/include/streambuf @@ -107,9 +107,12 @@ protected: */ +#include <__assert> #include <__config> #include <__fwd/streambuf.h> +#include <__locale> #include <__type_traits/is_same.h> +#include <__utility/is_valid_range.h> #include <climits> #include <ios> #include <iosfwd> @@ -134,7 +137,7 @@ public: typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; - static_assert((is_same<_CharT, typename traits_type::char_type>::value), + static_assert(is_same<_CharT, typename traits_type::char_type>::value, "traits_type::char_type must be the same type as CharT"); virtual ~basic_streambuf(); @@ -233,6 +236,9 @@ protected: inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void gbump(int __n) { __ninp_ += __n; } inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) { + _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gnext), "[gbeg, gnext) must be a valid range"); + _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gbeg, __gend), "[gbeg, gend) must be a valid range"); + _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__gnext, __gend), "[gnext, gend) must be a valid range"); __binp_ = __gbeg; __ninp_ = __gnext; __einp_ = __gend; @@ -248,6 +254,7 @@ protected: _LIBCPP_HIDE_FROM_ABI void __pbump(streamsize __n) { __nout_ += __n; } inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void setp(char_type* __pbeg, char_type* __pend) { + _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__pbeg, __pend), "[pbeg, pend) must be a valid range"); __bout_ = __nout_ = __pbeg; __eout_ = __pend; } diff --git a/contrib/libs/cxxsupp/libcxx/include/string b/contrib/libs/cxxsupp/libcxx/include/string index 64657021c2..74c0690617 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string +++ b/contrib/libs/cxxsupp/libcxx/include/string @@ -575,6 +575,7 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len ); #include <__algorithm/remove_if.h> #include <__assert> #include <__config> +#include <__debug_utils/sanitizers.h> #include <__format/enable_insertable.h> #include <__functional/hash.h> #include <__functional/unary_function.h> @@ -662,7 +663,6 @@ _LIBCPP_PUSH_MACROS #else # define _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS #endif -#define _LIBCPP_SHORT_STRING_ANNOTATIONS_ALLOWED false _LIBCPP_BEGIN_NAMESPACE_STD @@ -736,22 +736,52 @@ public: // // This string implementation doesn't contain any references into itself. It only contains a bit that says whether // it is in small or large string mode, so the entire structure is trivially relocatable if its members are. +#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) + // When compiling with AddressSanitizer (ASan), basic_string cannot be trivially + // relocatable. Because the object's memory might be poisoned when its content + // is kept inside objects memory (short string optimization), instead of in allocated + // external memory. In such cases, the destructor is responsible for unpoisoning + // the memory to avoid triggering false positives. + // Therefore it's crucial to ensure the destructor is called. + using __trivially_relocatable = void; +#else using __trivially_relocatable = __conditional_t< __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value, basic_string, void>; +#endif +#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __asan_volatile_wrapper(pointer const& __ptr) const { + if (__libcpp_is_constant_evaluated()) + return __ptr; + + pointer volatile __copy_ptr = __ptr; + + return const_cast<pointer&>(__copy_ptr); + } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer + __asan_volatile_wrapper(const_pointer const& __ptr) const { + if (__libcpp_is_constant_evaluated()) + return __ptr; + + const_pointer volatile __copy_ptr = __ptr; + + return const_cast<const_pointer&>(__copy_ptr); + } +# define _LIBCPP_ASAN_VOLATILE_WRAPPER(PTR) __asan_volatile_wrapper(PTR) +#else +# define _LIBCPP_ASAN_VOLATILE_WRAPPER(PTR) PTR +#endif - static_assert((!is_array<value_type>::value), "Character type of basic_string must not be an array"); - static_assert((is_standard_layout<value_type>::value), "Character type of basic_string must be standard-layout"); - static_assert((is_trivial<value_type>::value), "Character type of basic_string must be trivial"); - static_assert((is_same<_CharT, typename traits_type::char_type>::value), + static_assert(!is_array<value_type>::value, "Character type of basic_string must not be an array"); + static_assert(is_standard_layout<value_type>::value, "Character type of basic_string must be standard-layout"); + static_assert(is_trivial<value_type>::value, "Character type of basic_string must be trivial"); + static_assert(is_same<_CharT, typename traits_type::char_type>::value, "traits_type::char_type must be the same type as CharT"); - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); - - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); #if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 typedef pointer iterator; @@ -840,23 +870,9 @@ private: static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); - union __ulx { - __long __lx; - __short __lxx; - }; - - enum { __n_words = sizeof(__ulx) / sizeof(size_type) }; - - struct __raw { - size_type __words[__n_words]; - }; - - struct __rep { - union { - __short __s; - __long __l; - __raw __r; - }; + union __rep { + __short __s; + __long __l; }; __compressed_pair<__rep, allocator_type> __r_; @@ -1083,8 +1099,8 @@ public: __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value, int> = 0> - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string( - const _Tp& __t, const allocator_type& __a) + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a) : __r_(__default_init_tag(), __a) { __self_view __sv = __t; __init(__sv.data(), __sv.size()); @@ -1151,8 +1167,8 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(basic_string&& __str) - _NOEXCEPT_(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + operator=(basic_string&& __str) noexcept(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) { __move_assign(__str, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>()); return *this; } @@ -1261,7 +1277,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT; - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT { return size() == 0; } @@ -1335,8 +1351,8 @@ public: int> = 0> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string& - append(const _Tp& __t, size_type __pos, size_type __n = npos); + basic_string& + append(const _Tp& __t, size_type __pos, size_type __n = npos); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s); @@ -1427,8 +1443,8 @@ public: return *this = __str; } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(basic_string&& __str) - _NOEXCEPT_(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + assign(basic_string&& __str) noexcept(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) { *this = std::move(__str); return *this; } @@ -1637,7 +1653,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* c_str() const _NOEXCEPT { return data(); } @@ -1913,16 +1929,18 @@ private: __r_.first().__l.__data_ = __p; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT { - return __r_.first().__l.__data_; + return _LIBCPP_ASAN_VOLATILE_WRAPPER(__r_.first().__l.__data_); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer __get_long_pointer() const _NOEXCEPT { - return __r_.first().__l.__data_; + return _LIBCPP_ASAN_VOLATILE_WRAPPER(__r_.first().__l.__data_); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_short_pointer() _NOEXCEPT { - return pointer_traits<pointer>::pointer_to(__r_.first().__s.__data_[0]); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS pointer + __get_short_pointer() _NOEXCEPT { + return _LIBCPP_ASAN_VOLATILE_WRAPPER(pointer_traits<pointer>::pointer_to(__r_.first().__s.__data_[0])); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer __get_short_pointer() const _NOEXCEPT { - return pointer_traits<const_pointer>::pointer_to(__r_.first().__s.__data_[0]); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS const_pointer + __get_short_pointer() const _NOEXCEPT { + return _LIBCPP_ASAN_VOLATILE_WRAPPER(pointer_traits<const_pointer>::pointer_to(__r_.first().__s.__data_[0])); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_pointer() _NOEXCEPT { return __is_long() ? __get_long_pointer() : __get_short_pointer(); @@ -1937,29 +1955,21 @@ private: (void)__old_mid; (void)__new_mid; #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) - const void* __begin = data(); - const void* __end = data() + capacity() + 1; - if (__asan_annotate_container_with_allocator<allocator_type>::value && !__libcpp_is_constant_evaluated()) - __sanitizer_annotate_contiguous_container(__begin, __end, __old_mid, __new_mid); + std::__annotate_contiguous_container<_Allocator>(data(), data() + capacity() + 1, __old_mid, __new_mid); #endif } - // ASan: short string is poisoned if and only if this function returns true. - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __asan_short_string_is_annotated() const _NOEXCEPT { - return _LIBCPP_SHORT_STRING_ANNOTATIONS_ALLOWED && !__libcpp_is_constant_evaluated(); - } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_new(size_type __current_size) const _NOEXCEPT { (void)__current_size; #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) - if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long())) + if (!__libcpp_is_constant_evaluated()) __annotate_contiguous_container(data() + capacity() + 1, data() + __current_size + 1); #endif } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_delete() const _NOEXCEPT { #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) - if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long())) + if (!__libcpp_is_constant_evaluated()) __annotate_contiguous_container(data() + size() + 1, data() + capacity() + 1); #endif } @@ -1967,7 +1977,7 @@ private: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_increase(size_type __n) const _NOEXCEPT { (void)__n; #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) - if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long())) + if (!__libcpp_is_constant_evaluated()) __annotate_contiguous_container(data() + size() + 1, data() + size() + 1 + __n); #endif } @@ -1975,7 +1985,7 @@ private: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_shrink(size_type __old_size) const _NOEXCEPT { (void)__old_size; #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN) - if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long())) + if (!__libcpp_is_constant_evaluated()) __annotate_contiguous_container(data() + __old_size + 1, data() + size() + 1); #endif } @@ -1989,10 +1999,10 @@ private: if (__s < __min_cap) { return static_cast<size_type>(__min_cap) - 1; } - const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1; + const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : __endian_factor; size_type __guess = __align_it<__boundary>(__s + 1) - 1; if (__guess == __min_cap) - ++__guess; + __guess += __endian_factor; return __guess; } @@ -2025,15 +2035,15 @@ private: _LIBCPP_CONSTEXPR_SINCE_CXX20 #if _LIBCPP_ABI_VERSION >= 2 // We want to use the function in the dylib in ABIv1 - _LIBCPP_HIDE_FROM_ABI + _LIBCPP_HIDE_FROM_ABI #endif - _LIBCPP_DEPRECATED_("use __grow_by_without_replace") void __grow_by( - size_type __old_cap, - size_type __delta_cap, - size_type __old_sz, - size_type __n_copy, - size_type __n_del, - size_type __n_add = 0); + _LIBCPP_DEPRECATED_("use __grow_by_without_replace") void __grow_by( + size_type __old_cap, + size_type __delta_cap, + size_type __old_sz, + size_type __n_copy, + size_type __n_del, + size_type __n_add = 0); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __grow_by_without_replace( size_type __old_cap, size_type __delta_cap, @@ -2096,14 +2106,14 @@ private: __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT {} #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign(basic_string& __str, false_type) - _NOEXCEPT_(__alloc_traits::is_always_equal::value); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void + __move_assign(basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void __move_assign(basic_string& __str, true_type) # if _LIBCPP_STD_VER >= 17 - _NOEXCEPT; + noexcept; # else - _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value); + noexcept(is_nothrow_move_assignable<allocator_type>::value); # endif #endif @@ -2199,8 +2209,8 @@ template <class _CharT, class _Traits, class _Allocator = allocator<_CharT>, class = enable_if_t<__is_allocator<_Allocator>::value> > -explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator()) - -> basic_string<_CharT, _Traits, _Allocator>; +explicit basic_string(basic_string_view<_CharT, _Traits>, + const _Allocator& = _Allocator()) -> basic_string<_CharT, _Traits, _Allocator>; template <class _CharT, class _Traits, @@ -2435,15 +2445,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__ template <class _CharT, class _Traits, class _Allocator> void _LIBCPP_CONSTEXPR_SINCE_CXX20 #if _LIBCPP_ABI_VERSION >= 2 // We want to use the function in the dylib in ABIv1 - _LIBCPP_HIDE_FROM_ABI +_LIBCPP_HIDE_FROM_ABI #endif - _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Traits, _Allocator>::__grow_by( - size_type __old_cap, - size_type __delta_cap, - size_type __old_sz, - size_type __n_copy, - size_type __n_del, - size_type __n_add) { +_LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Traits, _Allocator>::__grow_by( + size_type __old_cap, + size_type __delta_cap, + size_type __old_sz, + size_type __n_copy, + size_type __n_del, + size_type __n_add) { size_type __ms = max_size(); if (__delta_cap > __ms - __old_cap) __throw_length_error(); @@ -2594,9 +2604,8 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) #ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void -basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, false_type) - _NOEXCEPT_(__alloc_traits::is_always_equal::value) { +inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__move_assign( + basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value) { if (__alloc() != __str.__alloc()) assign(__str); else @@ -2607,9 +2616,9 @@ template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type) # if _LIBCPP_STD_VER >= 17 - _NOEXCEPT + noexcept # else - _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) + noexcept(is_nothrow_move_assignable<allocator_type>::value) # endif { __annotate_delete(); @@ -3352,7 +3361,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) #endif { _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR( @@ -3748,17 +3757,10 @@ template <class _Allocator> inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool operator==(const basic_string<char, char_traits<char>, _Allocator>& __lhs, const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT { - size_t __lhs_sz = __lhs.size(); - if (__lhs_sz != __rhs.size()) + size_t __sz = __lhs.size(); + if (__sz != __rhs.size()) return false; - const char* __lp = __lhs.data(); - const char* __rp = __rhs.data(); - if (__lhs.__is_long()) - return char_traits<char>::compare(__lp, __rp, __lhs_sz) == 0; - for (; __lhs_sz != 0; --__lhs_sz, ++__lp, ++__rp) - if (*__lp != *__rp) - return false; - return true; + return char_traits<char>::compare(__lhs.data(), __rhs.data(), __sz) == 0; } #if _LIBCPP_STD_VER <= 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/string_view b/contrib/libs/cxxsupp/libcxx/include/string_view index 4df4f02bc9..058ca72184 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string_view +++ b/contrib/libs/cxxsupp/libcxx/include/string_view @@ -293,10 +293,10 @@ public: using difference_type = ptrdiff_t; static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1); - static_assert((!is_array<value_type>::value), "Character type of basic_string_view must not be an array"); - static_assert((is_standard_layout<value_type>::value), "Character type of basic_string_view must be standard-layout"); - static_assert((is_trivial<value_type>::value), "Character type of basic_string_view must be trivial"); - static_assert((is_same<_CharT, typename traits_type::char_type>::value), + static_assert(!is_array<value_type>::value, "Character type of basic_string_view must not be an array"); + static_assert(is_standard_layout<value_type>::value, "Character type of basic_string_view must be standard-layout"); + static_assert(is_trivial<value_type>::value, "Character type of basic_string_view must be trivial"); + static_assert(is_same<_CharT, typename traits_type::char_type>::value, "traits_type::char_type must be the same type as CharT"); // [string.view.cons], construct/copy @@ -396,9 +396,7 @@ public: return numeric_limits<size_type>::max() / sizeof(value_type); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { - return __size_ == 0; - } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return __size_ == 0; } // [string.view.access], element access _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __pos) const _NOEXCEPT { @@ -906,32 +904,31 @@ struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_ #if _LIBCPP_STD_VER >= 14 inline namespace literals { inline namespace string_view_literals { -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR basic_string_view<char> -operator""sv(const char* __str, size_t __len) _NOEXCEPT { +inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char> operator""sv(const char* __str, size_t __len) noexcept { return basic_string_view<char>(__str, __len); } # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR basic_string_view<wchar_t> -operator""sv(const wchar_t* __str, size_t __len) _NOEXCEPT { +inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<wchar_t> +operator""sv(const wchar_t* __str, size_t __len) noexcept { return basic_string_view<wchar_t>(__str, __len); } # endif # ifndef _LIBCPP_HAS_NO_CHAR8_T -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR basic_string_view<char8_t> -operator""sv(const char8_t* __str, size_t __len) _NOEXCEPT { +inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char8_t> +operator""sv(const char8_t* __str, size_t __len) noexcept { return basic_string_view<char8_t>(__str, __len); } # endif -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR basic_string_view<char16_t> -operator""sv(const char16_t* __str, size_t __len) _NOEXCEPT { +inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char16_t> +operator""sv(const char16_t* __str, size_t __len) noexcept { return basic_string_view<char16_t>(__str, __len); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR basic_string_view<char32_t> -operator""sv(const char32_t* __str, size_t __len) _NOEXCEPT { +inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char32_t> +operator""sv(const char32_t* __str, size_t __len) noexcept { return basic_string_view<char32_t>(__str, __len); } } // namespace string_view_literals diff --git a/contrib/libs/cxxsupp/libcxx/include/strstream b/contrib/libs/cxxsupp/libcxx/include/strstream index e9f533644f..9ff4024a7c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/strstream +++ b/contrib/libs/cxxsupp/libcxx/include/strstream @@ -13,7 +13,7 @@ /* strstream synopsis -class strstreambuf +class strstreambuf // Removed in C++26 : public basic_streambuf<char> { public: @@ -63,7 +63,7 @@ private: void (*pfree)(void*); // exposition only }; -class istrstream +class istrstream // Removed in C++26 : public basic_istream<char> { public: @@ -81,7 +81,7 @@ private: strstreambuf sb; // exposition only }; -class ostrstream +class ostrstream // Removed in C++26 : public basic_ostream<char> { public: @@ -99,7 +99,7 @@ private: strstreambuf sb; // exposition only }; -class strstream +class strstream // Removed in C++26 : public basic_iostream<char> { public: @@ -138,19 +138,21 @@ private: # pragma GCC system_header #endif +#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY) + _LIBCPP_PUSH_MACROS -#include <__undef_macros> +# include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf { public: -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI strstreambuf() : strstreambuf(0) {} explicit strstreambuf(streamsize __alsize); -#else +# else explicit strstreambuf(streamsize __alsize = 0); -#endif +# endif strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*)); strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr); strstreambuf(const char* __gnext, streamsize __n); @@ -160,10 +162,10 @@ public: strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr); strstreambuf(const unsigned char* __gnext, streamsize __n); -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI strstreambuf(strstreambuf&& __rhs); _LIBCPP_HIDE_FROM_ABI strstreambuf& operator=(strstreambuf&& __rhs); -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG ~strstreambuf() override; @@ -197,7 +199,7 @@ private: void __init(char* __gnext, streamsize __n, char* __pbeg); }; -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_HIDE_FROM_ABI strstreambuf::strstreambuf(strstreambuf&& __rhs) : streambuf(__rhs), @@ -226,7 +228,7 @@ inline _LIBCPP_HIDE_FROM_ABI strstreambuf& strstreambuf::operator=(strstreambuf& return *this; } -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI istrstream : public istream { public: @@ -235,7 +237,7 @@ public: _LIBCPP_HIDE_FROM_ABI istrstream(const char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {} _LIBCPP_HIDE_FROM_ABI istrstream(char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {} -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI istrstream(istrstream&& __rhs) // extension : istream(std::move(static_cast<istream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) { istream::set_rdbuf(&__sb_); @@ -246,7 +248,7 @@ public: istream::operator=(std::move(__rhs)); return *this; } -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG ~istrstream() override; @@ -268,7 +270,7 @@ public: _LIBCPP_HIDE_FROM_ABI ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out) : ostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {} -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI ostrstream(ostrstream&& __rhs) // extension : ostream(std::move(static_cast<ostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) { ostream::set_rdbuf(&__sb_); @@ -279,7 +281,7 @@ public: ostream::operator=(std::move(__rhs)); return *this; } -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG ~ostrstream() override; @@ -310,7 +312,7 @@ public: _LIBCPP_HIDE_FROM_ABI strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out) : iostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {} -#ifndef _LIBCPP_CXX03_LANG +# ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI strstream(strstream&& __rhs) // extension : iostream(std::move(static_cast<iostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) { iostream::set_rdbuf(&__sb_); @@ -321,7 +323,7 @@ public: iostream::operator=(std::move(__rhs)); return *this; } -#endif // _LIBCPP_CXX03_LANG +# endif // _LIBCPP_CXX03_LANG ~strstream() override; @@ -344,4 +346,6 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS +#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY) + #endif // _LIBCPP_STRSTREAM diff --git a/contrib/libs/cxxsupp/libcxx/include/syncstream b/contrib/libs/cxxsupp/libcxx/include/syncstream index c54e8ce9f5..e6f35b6f42 100644 --- a/contrib/libs/cxxsupp/libcxx/include/syncstream +++ b/contrib/libs/cxxsupp/libcxx/include/syncstream @@ -117,7 +117,9 @@ namespace std { #include <__config> #include <__utility/move.h> +#include <ios> #include <iosfwd> // required for declaration of default arguments +#include <streambuf> #include <string> #ifndef _LIBCPP_HAS_NO_THREADS diff --git a/contrib/libs/cxxsupp/libcxx/include/tuple b/contrib/libs/cxxsupp/libcxx/include/tuple index ed7d9121c6..9caeaaf926 100644 --- a/contrib/libs/cxxsupp/libcxx/include/tuple +++ b/contrib/libs/cxxsupp/libcxx/include/tuple @@ -222,7 +222,6 @@ template <class... Types> #include <__tuple/tuple_like_ext.h> #include <__tuple/tuple_size.h> #include <__tuple/tuple_types.h> -#include <__type_traits/apply_cv.h> #include <__type_traits/common_reference.h> #include <__type_traits/common_type.h> #include <__type_traits/conditional.h> @@ -241,6 +240,7 @@ template <class... Types> #include <__type_traits/is_reference.h> #include <__type_traits/is_same.h> #include <__type_traits/is_swappable.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/lazy.h> #include <__type_traits/maybe_const.h> #include <__type_traits/nat.h> @@ -279,15 +279,14 @@ class __tuple_leaf; template <size_t _Ip, class _Hp, bool _Ep> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void -swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y) - _NOEXCEPT_(__is_nothrow_swappable<_Hp>::value) { +swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y) noexcept(__is_nothrow_swappable_v<_Hp>) { swap(__x.get(), __y.get()); } template <size_t _Ip, class _Hp, bool _Ep> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void -swap(const __tuple_leaf<_Ip, _Hp, _Ep>& __x, const __tuple_leaf<_Ip, _Hp, _Ep>& __y) - _NOEXCEPT_(__is_nothrow_swappable<const _Hp>::value) { +swap(const __tuple_leaf<_Ip, _Hp, _Ep>& __x, + const __tuple_leaf<_Ip, _Hp, _Ep>& __y) noexcept(__is_nothrow_swappable_v<const _Hp>) { swap(__x.get(), __y.get()); } @@ -304,10 +303,10 @@ class __tuple_leaf { # endif } - _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&); - public: - _LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : __value_() { + _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&) = delete; + + _LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() noexcept(is_nothrow_default_constructible<_Hp>::value) : __value_() { static_assert(!is_reference<_Hp>::value, "Attempted to default construct a reference element in a tuple"); } @@ -327,34 +326,34 @@ public: static_assert(!is_reference<_Hp>::value, "Attempted to default construct a reference element in a tuple"); } - template <class _Tp, - __enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value, - int> = 0> + template < + class _Tp, + __enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_(is_nothrow_constructible<_Hp, _Tp>::value) + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(_Tp&& __t) noexcept(is_nothrow_constructible<_Hp, _Tp>::value) : __value_(std::forward<_Tp>(__t)) { static_assert(__can_bind_reference<_Tp&&>(), "Attempted construction of reference element binds to a temporary whose lifetime has ended"); } template <class _Tp, class _Alloc> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf( - integral_constant<int, 0>, const _Alloc&, _Tp&& __t) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t) : __value_(std::forward<_Tp>(__t)) { static_assert(__can_bind_reference<_Tp&&>(), "Attempted construction of reference element binds to a temporary whose lifetime has ended"); } template <class _Tp, class _Alloc> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf( - integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t) : __value_(allocator_arg_t(), __a, std::forward<_Tp>(__t)) { static_assert(!is_reference<_Hp>::value, "Attempted to uses-allocator construct a reference element in a tuple"); } template <class _Tp, class _Alloc> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf( - integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t) : __value_(std::forward<_Tp>(__t), __a) { static_assert(!is_reference<_Hp>::value, "Attempted to uses-allocator construct a reference element in a tuple"); } @@ -362,14 +361,14 @@ public: _LIBCPP_HIDE_FROM_ABI __tuple_leaf(const __tuple_leaf& __t) = default; _LIBCPP_HIDE_FROM_ABI __tuple_leaf(__tuple_leaf&& __t) = default; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int swap(__tuple_leaf& __t) - _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int + swap(__tuple_leaf& __t) noexcept(__is_nothrow_swappable_v<__tuple_leaf>) { std::swap(*this, __t); return 0; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int swap(const __tuple_leaf& __t) const - _NOEXCEPT_(__is_nothrow_swappable<const __tuple_leaf>::value) { + noexcept(__is_nothrow_swappable_v<const __tuple_leaf>) { std::swap(*this, __t); return 0; } @@ -380,10 +379,10 @@ public: template <size_t _Ip, class _Hp> class __tuple_leaf<_Ip, _Hp, true> : private _Hp { - _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&); - public: - _LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) {} + _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&) = delete; + + _LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() noexcept(is_nothrow_default_constructible<_Hp>::value) {} template <class _Alloc> _LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf(integral_constant<int, 0>, const _Alloc&) {} @@ -399,7 +398,7 @@ public: __enable_if_t< _And< _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_(is_nothrow_constructible<_Hp, _Tp>::value) + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(_Tp&& __t) noexcept(is_nothrow_constructible<_Hp, _Tp>::value) : _Hp(std::forward<_Tp>(__t)) {} template <class _Tp, class _Alloc> @@ -417,14 +416,14 @@ public: __tuple_leaf(__tuple_leaf const&) = default; __tuple_leaf(__tuple_leaf&&) = default; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int swap(__tuple_leaf& __t) - _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int + swap(__tuple_leaf& __t) noexcept(__is_nothrow_swappable_v<__tuple_leaf>) { std::swap(*this, __t); return 0; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int swap(const __tuple_leaf& __rhs) const - _NOEXCEPT_(__is_nothrow_swappable<const __tuple_leaf>::value) { + noexcept(__is_nothrow_swappable_v<const __tuple_leaf>) { std::swap(*this, __rhs); return 0; } @@ -452,14 +451,17 @@ struct __tuple_impl; template <size_t... _Indx, class... _Tp> struct _LIBCPP_DECLSPEC_EMPTY_BASES __tuple_impl<__tuple_indices<_Indx...>, _Tp...> : public __tuple_leaf<_Indx, _Tp>... { - _LIBCPP_HIDE_FROM_ABI constexpr __tuple_impl() - _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {} + _LIBCPP_HIDE_FROM_ABI constexpr __tuple_impl() noexcept( + __all<is_nothrow_default_constructible<_Tp>::value...>::value) {} template <size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl( - __tuple_indices<_Uf...>, __tuple_types<_Tf...>, __tuple_indices<_Ul...>, __tuple_types<_Tl...>, _Up&&... __u) - _NOEXCEPT_(__all<is_nothrow_constructible<_Tf, _Up>::value...>::value&& - __all<is_nothrow_default_constructible<_Tl>::value...>::value) + __tuple_indices<_Uf...>, + __tuple_types<_Tf...>, + __tuple_indices<_Ul...>, + __tuple_types<_Tl...>, + _Up&&... __u) noexcept(__all<is_nothrow_constructible<_Tf, _Up>::value...>::value && + __all<is_nothrow_default_constructible<_Tl>::value...>::value) : __tuple_leaf<_Uf, _Tf>(std::forward<_Up>(__u))..., __tuple_leaf<_Ul, _Tl>()... {} template <class _Alloc, size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up> @@ -475,7 +477,7 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES __tuple_impl<__tuple_indices<_Indx...>, _Tp. __tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)... {} template <class _Tuple, __enable_if_t<__tuple_constructible<_Tuple, tuple<_Tp...> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(_Tuple&& __t) _NOEXCEPT_( + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(_Tuple&& __t) noexcept( (__all<is_nothrow_constructible< _Tp, typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>::value...>::value)) @@ -496,13 +498,13 @@ struct _LIBCPP_DECLSPEC_EMPTY_BASES __tuple_impl<__tuple_indices<_Indx...>, _Tp. __tuple_impl(const __tuple_impl&) = default; __tuple_impl(__tuple_impl&&) = default; - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void swap(__tuple_impl& __t) - _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void + swap(__tuple_impl& __t) noexcept(__all<__is_nothrow_swappable_v<_Tp>...>::value) { std::__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void swap(const __tuple_impl& __t) const - _NOEXCEPT_(__all<__is_nothrow_swappable<const _Tp>::value...>::value) { + noexcept(__all<__is_nothrow_swappable_v<const _Tp>...>::value) { std::__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t))...); } }; @@ -538,14 +540,16 @@ class _LIBCPP_TEMPLATE_VIS tuple { get(const tuple<_Up...>&&) _NOEXCEPT; public: + using __trivially_relocatable = __conditional_t<_And<__libcpp_is_trivially_relocatable<_Tp>...>::value, tuple, void>; + // [tuple.cnstr] // tuple() constructors (including allocator_arg_t variants) template <template <class...> class _IsImpDefault = __is_implicitly_default_constructible, template <class...> class _IsDefault = is_default_constructible, __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value) tuple() - _NOEXCEPT_(_And<is_nothrow_default_constructible<_Tp>...>::value) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value) + tuple() noexcept(_And<is_nothrow_default_constructible<_Tp>...>::value) {} template <class _Alloc, template <class...> class _IsImpDefault = __is_implicitly_default_constructible, @@ -563,9 +567,9 @@ public: // tuple(const T&...) constructors (including allocator_arg_t variants) template <template <class...> class _And = _And, __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - _Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value) tuple(const _Tp&... __t) - _NOEXCEPT_(_And<is_nothrow_copy_constructible<_Tp>...>::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value) + tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value) : __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(), typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(), typename __make_tuple_indices<0>::type(), @@ -575,8 +579,8 @@ public: template <class _Alloc, template <class...> class _And = _And, __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit( - _Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value) tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t) : __base_(allocator_arg_t(), __a, @@ -610,7 +614,7 @@ public: >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value) - tuple(_Up&&... __u) _NOEXCEPT_(_And<is_nothrow_constructible<_Tp, _Up>...>::value) + tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value) : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(), typename __make_tuple_types<tuple, sizeof...(_Up)>::type(), typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(), @@ -675,16 +679,16 @@ public: _Not<is_constructible<_Tp, _OtherTuple> >... > > > {}; template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - _Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value) tuple(const tuple<_Up...>& __t) - _NOEXCEPT_(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value) + tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value) : __base_(__t) {} template <class... _Up, class _Alloc, __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit( - _Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value) tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t) : __base_(allocator_arg_t(), __a, __t) {} @@ -704,7 +708,7 @@ public: // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants) template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value) - tuple(tuple<_Up...>&& __t) _NOEXCEPT_(_And<is_nothrow_constructible<_Tp, _Up>...>::value) + tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value) : __base_(std::move(__t)) {} template <class _Alloc, @@ -759,9 +763,9 @@ public: class _Up2, template <class...> class _And = _And, __enable_if_t< _And< _EnableCtorFromPair<const pair<_Up1, _Up2>&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - _Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value) tuple(const pair<_Up1, _Up2>& __p) - _NOEXCEPT_(_NothrowConstructibleFromPair<const pair<_Up1, _Up2>&>::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value) + tuple(const pair<_Up1, _Up2>& __p) noexcept(_NothrowConstructibleFromPair<const pair<_Up1, _Up2>&>::value) : __base_(__p) {} template <class _Alloc, @@ -769,8 +773,8 @@ public: class _Up2, template <class...> class _And = _And, __enable_if_t< _And< _EnableCtorFromPair<const pair<_Up1, _Up2>&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit( - _Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<const pair<_Up1, _Up2>&> >::value) tuple(allocator_arg_t, const _Alloc& __a, const pair<_Up1, _Up2>& __p) : __base_(allocator_arg_t(), __a, __p) {} @@ -797,9 +801,9 @@ public: class _Up2, template <class...> class _And = _And, __enable_if_t< _And< _EnableCtorFromPair<pair<_Up1, _Up2>&&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit( - _Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value) tuple(pair<_Up1, _Up2>&& __p) - _NOEXCEPT_(_NothrowConstructibleFromPair<pair<_Up1, _Up2>&&>::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value) + tuple(pair<_Up1, _Up2>&& __p) noexcept(_NothrowConstructibleFromPair<pair<_Up1, _Up2>&&>::value) : __base_(std::move(__p)) {} template <class _Alloc, @@ -807,8 +811,8 @@ public: class _Up2, template <class...> class _And = _And, __enable_if_t< _And< _EnableCtorFromPair<pair<_Up1, _Up2>&&> >::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit( - _Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value) + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_BothImplicitlyConvertible<pair<_Up1, _Up2>&&> >::value) tuple(allocator_arg_t, const _Alloc& __a, pair<_Up1, _Up2>&& __p) : __base_(allocator_arg_t(), __a, std::move(__p)) {} @@ -832,7 +836,7 @@ public: // [tuple.assign] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(_If<_And<is_copy_assignable<_Tp>...>::value, tuple, __nat> const& __tuple) - _NOEXCEPT_(_And<is_nothrow_copy_assignable<_Tp>...>::value) { + noexcept(_And<is_nothrow_copy_assignable<_Tp>...>::value) { std::__memberwise_copy_assign(*this, __tuple, typename __make_tuple_indices<sizeof...(_Tp)>::type()); return *this; } @@ -856,7 +860,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple) - _NOEXCEPT_(_And<is_nothrow_move_assignable<_Tp>...>::value) { + noexcept(_And<is_nothrow_move_assignable<_Tp>...>::value) { std::__memberwise_forward_assign( *this, std::move(__tuple), __tuple_types<_Tp...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type()); return *this; @@ -867,7 +871,7 @@ public: __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) == sizeof...(_Up)>, is_assignable<_Tp&, _Up const&>... >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(tuple<_Up...> const& __tuple) - _NOEXCEPT_(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) { + noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) { std::__memberwise_copy_assign(*this, __tuple, typename __make_tuple_indices<sizeof...(_Tp)>::type()); return *this; } @@ -876,7 +880,7 @@ public: __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) == sizeof...(_Up)>, is_assignable<_Tp&, _Up>... >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(tuple<_Up...>&& __tuple) - _NOEXCEPT_(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) { + noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) { std::__memberwise_forward_assign( *this, std::move(__tuple), __tuple_types<_Up...>(), typename __make_tuple_indices<sizeof...(_Tp)>::type()); return *this; @@ -941,7 +945,7 @@ public: class _Up2, __enable_if_t< _EnableAssignFromPair<false, pair<_Up1, _Up2> const&>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(pair<_Up1, _Up2> const& __pair) - _NOEXCEPT_(_NothrowAssignFromPair<false, pair<_Up1, _Up2> const&>::value) { + noexcept(_NothrowAssignFromPair<false, pair<_Up1, _Up2> const&>::value) { std::get<0>(*this) = __pair.first; std::get<1>(*this) = __pair.second; return *this; @@ -949,7 +953,7 @@ public: template <class _Up1, class _Up2, __enable_if_t< _EnableAssignFromPair<false, pair<_Up1, _Up2>&&>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(pair<_Up1, _Up2>&& __pair) - _NOEXCEPT_(_NothrowAssignFromPair<false, pair<_Up1, _Up2>&&>::value) { + noexcept(_NothrowAssignFromPair<false, pair<_Up1, _Up2>&&>::value) { std::get<0>(*this) = std::forward<_Up1>(__pair.first); std::get<1>(*this) = std::forward<_Up2>(__pair.second); return *this; @@ -961,7 +965,7 @@ public: size_t _Np, __enable_if_t< _And< _BoolConstant<_Np == sizeof...(_Tp)>, is_assignable<_Tp&, _Up const&>... >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(array<_Up, _Np> const& __array) - _NOEXCEPT_(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) { + noexcept(_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value) { std::__memberwise_copy_assign(*this, __array, typename __make_tuple_indices<sizeof...(_Tp)>::type()); return *this; } @@ -972,7 +976,7 @@ public: class = void, __enable_if_t< _And< _BoolConstant<_Np == sizeof...(_Tp)>, is_assignable<_Tp&, _Up>... >::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple& operator=(array<_Up, _Np>&& __array) - _NOEXCEPT_(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) { + noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) { std::__memberwise_forward_assign( *this, std::move(__array), @@ -983,7 +987,7 @@ public: // [tuple.swap] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(tuple& __t) - _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value) { + noexcept(__all<__is_nothrow_swappable_v<_Tp>...>::value) { __base_.swap(__t.__base_); } @@ -1040,9 +1044,9 @@ template <class _Alloc, class... _Tp> tuple(allocator_arg_t, _Alloc, tuple<_Tp...>) -> tuple<_Tp...>; # endif -template <class... _Tp, __enable_if_t<__all<__is_swappable<_Tp>::value...>::value, int> = 0> +template <class... _Tp, __enable_if_t<__all<__is_swappable_v<_Tp>...>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) - _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value) { + noexcept(__all<__is_nothrow_swappable_v<_Tp>...>::value) { __t.swap(__u); } @@ -1294,14 +1298,14 @@ struct __tuple_cat_return_ref_imp; template <class... _Types, size_t... _I0, class _Tuple0> struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0> { typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0; - typedef tuple<_Types..., __apply_cv_t<_Tuple0, typename tuple_element<_I0, _T0>::type>&&...> type; + typedef tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_I0, _T0>::type>&&...> type; }; template <class... _Types, size_t... _I0, class _Tuple0, class _Tuple1, class... _Tuples> struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0, _Tuple1, _Tuples...> : public __tuple_cat_return_ref_imp< tuple<_Types..., - __apply_cv_t<_Tuple0, typename tuple_element<_I0, __libcpp_remove_reference_t<_Tuple0>>::type>&&...>, + __copy_cvref_t<_Tuple0, typename tuple_element<_I0, __libcpp_remove_reference_t<_Tuple0>>::type>&&...>, typename __make_tuple_indices<tuple_size<__libcpp_remove_reference_t<_Tuple1> >::value>::type, _Tuple1, _Tuples...> {}; @@ -1321,8 +1325,8 @@ template <class... _Types, size_t... _I0, size_t... _J0> struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> > { template <class _Tuple0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type - operator()(tuple<_Types...> __t, _Tuple0&& __t0) { + typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type + operator()(tuple<_Types...> __t, _Tuple0&& __t0) { (void)__t; // avoid unused parameter warning on GCC when _I0 is empty return std::forward_as_tuple( std::forward<_Types>(std::get<_I0>(__t))..., std::get<_J0>(std::forward<_Tuple0>(__t0))...); @@ -1330,12 +1334,12 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J template <class _Tuple0, class _Tuple1, class... _Tuples> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 - typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type - operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&&... __tpls) { + typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type + operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&&... __tpls) { (void)__t; // avoid unused parameter warning on GCC when _I0 is empty typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0; typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple1> _T1; - return __tuple_cat<tuple<_Types..., __apply_cv_t<_Tuple0, typename tuple_element<_J0, _T0>::type>&&...>, + return __tuple_cat<tuple<_Types..., __copy_cvref_t<_Tuple0, typename tuple_element<_J0, _T0>::type>&&...>, typename __make_tuple_indices<sizeof...(_Types) + tuple_size<_T0>::value>::type, typename __make_tuple_indices<tuple_size<_T1>::value>::type>()( std::forward_as_tuple( @@ -1383,22 +1387,22 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, } #else template <class _Tp, class _Tuple, size_t... _Idx> -inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>, +inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>, enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...>> * = nullptr) _LIBCPP_NOEXCEPT_RETURN(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...)) #endif // _LIBCPP_STD_VER >= 20 -template <class _Tp, class _Tuple, +template <class _Tp, class _Tuple, class _Seq = typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type, class = void> inline constexpr bool __can_make_from_tuple = false; template <class _Tp, class _Tuple, size_t... _Idx> -inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, __tuple_indices<_Idx...>, +inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, __tuple_indices<_Idx...>, enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::declval<_Tuple>()))...>>> = true; -// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9, -// the standard allows to impose requirements, we constraint std::make_from_tuple to make std::make_from_tuple -// SFINAE friendly and also avoid worse diagnostic messages. We still keep the constraints of std::__make_from_tuple_impl +// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9, +// the standard allows to impose requirements, we constraint std::make_from_tuple to make std::make_from_tuple +// SFINAE friendly and also avoid worse diagnostic messages. We still keep the constraints of std::__make_from_tuple_impl // so that std::__make_from_tuple_impl will have the same advantages when used alone. #if _LIBCPP_STD_VER >= 20 template <class _Tp, class _Tuple> diff --git a/contrib/libs/cxxsupp/libcxx/include/type_traits b/contrib/libs/cxxsupp/libcxx/include/type_traits index 10f9b881c0..aee9fcf413 100644 --- a/contrib/libs/cxxsupp/libcxx/include/type_traits +++ b/contrib/libs/cxxsupp/libcxx/include/type_traits @@ -428,7 +428,6 @@ namespace std #include <__type_traits/aligned_storage.h> #include <__type_traits/aligned_union.h> #include <__type_traits/alignment_of.h> -#include <__type_traits/apply_cv.h> #include <__type_traits/can_extract_key.h> #include <__type_traits/common_reference.h> #include <__type_traits/common_type.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/typeinfo b/contrib/libs/cxxsupp/libcxx/include/typeinfo index bc8969ac74..266ae9550e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/typeinfo +++ b/contrib/libs/cxxsupp/libcxx/include/typeinfo @@ -281,7 +281,19 @@ struct __type_info_implementations { __impl; }; -class _LIBCPP_EXPORTED_FROM_ABI type_info { +# if defined(__arm64__) && __has_cpp_attribute(clang::ptrauth_vtable_pointer) +# if __has_feature(ptrauth_type_info_discriminated_vtable_pointer) +# define _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH \ + [[clang::ptrauth_vtable_pointer(process_independent, address_discrimination, type_discrimination)]] +# else +# define _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH \ + [[clang::ptrauth_vtable_pointer(process_independent, no_address_discrimination, no_extra_discrimination)]] +# endif +# else +# define _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH +# endif + +class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH type_info { type_info& operator=(const type_info&); type_info(const type_info&); diff --git a/contrib/libs/cxxsupp/libcxx/include/unordered_map b/contrib/libs/cxxsupp/libcxx/include/unordered_map index ca3d1a80bd..7c31c4fce2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/unordered_map +++ b/contrib/libs/cxxsupp/libcxx/include/unordered_map @@ -585,7 +585,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc> #include <__algorithm/is_permutation.h> #include <__assert> -#include <__availability> #include <__config> #include <__functional/is_transparent.h> #include <__functional/operations.h> @@ -651,7 +650,7 @@ public: return static_cast<const _Hash&>(*this)(__x); } #endif - _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Hash>) { using std::swap; swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y)); } @@ -675,7 +674,7 @@ public: return __hash_(__x); } #endif - _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Hash>) { using std::swap; swap(__hash_, __y.__hash_); } @@ -726,7 +725,7 @@ public: return static_cast<const _Pred&>(*this)(__x, __y); } #endif - _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Pred>) { using std::swap; swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y)); } @@ -769,7 +768,7 @@ public: return __pred_(__x, __y); } #endif - _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Pred>) { using std::swap; swap(__pred_, __y.__pred_); } @@ -793,12 +792,12 @@ public: private: allocator_type& __na_; - __hash_map_node_destructor& operator=(const __hash_map_node_destructor&); - public: bool __first_constructed; bool __second_constructed; + __hash_map_node_destructor& operator=(const __hash_map_node_destructor&) = delete; + _LIBCPP_HIDE_FROM_ABI explicit __hash_map_node_destructor(allocator_type& __na) _NOEXCEPT : __na_(__na), __first_constructed(false), @@ -883,7 +882,6 @@ public: return *this; } -private: __hash_value_type(const __hash_value_type& __v) = delete; __hash_value_type(__hash_value_type&& __v) = delete; template <class... _Args> @@ -907,8 +905,7 @@ public: _LIBCPP_HIDE_FROM_ABI value_type& __get_value() { return __cc_; } _LIBCPP_HIDE_FROM_ABI const value_type& __get_value() const { return __cc_; } -private: - ~__hash_value_type(); + ~__hash_value_type() = delete; }; #endif @@ -1037,7 +1034,7 @@ public: typedef pair<const key_type, mapped_type> value_type; typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); private: @@ -1060,12 +1057,10 @@ private: typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); - static_assert((is_same<typename __table::__container_value_type, value_type>::value), ""); - static_assert((is_same<typename __table::__node_value_type, __value_type>::value), ""); + static_assert(is_same<typename __table::__container_value_type, value_type>::value, ""); + static_assert(is_same<typename __table::__node_value_type, __value_type>::value, ""); public: typedef typename __alloc_traits::pointer pointer; @@ -1207,7 +1202,7 @@ public: return allocator_type(__table_.__node_alloc()); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); } @@ -1374,7 +1369,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(unordered_map& __u) _NOEXCEPT_(__is_nothrow_swappable<__table>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(unordered_map& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) { __table_.swap(__u.__table_); } @@ -1384,13 +1379,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __table_.find(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __table_.find(__k); } @@ -1398,8 +1391,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __table_.__count_unique(__k); } @@ -1408,8 +1400,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -1422,13 +1413,11 @@ public: return __table_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __table_.__equal_range_unique(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __table_.__equal_range_unique(__k); } @@ -1848,7 +1837,8 @@ public: typedef pair<const key_type, mapped_type> value_type; typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); private: @@ -1868,13 +1858,9 @@ private: typedef __hash_map_node_destructor<__node_allocator> _Dp; typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert((is_same<typename __node_traits::size_type, typename __alloc_traits::size_type>::value), + static_assert(is_same<typename __node_traits::size_type, typename __alloc_traits::size_type>::value, "Allocator uses different size_type for different types"); - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - public: typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; @@ -2015,7 +2001,7 @@ public: return allocator_type(__table_.__node_alloc()); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); } @@ -2125,7 +2111,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(unordered_multimap& __u) _NOEXCEPT_(__is_nothrow_swappable<__table>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(unordered_multimap& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) { __table_.swap(__u.__table_); } @@ -2135,13 +2121,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __table_.find(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __table_.find(__k); } @@ -2149,8 +2133,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __table_.__count_multi(__k); } @@ -2159,8 +2142,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -2173,13 +2155,11 @@ public: return __table_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __table_.__equal_range_multi(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __table_.__equal_range_multi(__k); } @@ -2254,12 +2234,12 @@ template <class _Key, class = enable_if_t<!is_integral<_Hash>::value>, class = enable_if_t<!__is_allocator<_Pred>::value>, class = enable_if_t<__is_allocator<_Allocator>::value>> -unordered_multimap(initializer_list<pair<_Key, _Tp>>, - typename allocator_traits<_Allocator>::size_type = 0, - _Hash = _Hash(), - _Pred = _Pred(), - _Allocator = _Allocator()) - -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>; +unordered_multimap( + initializer_list<pair<_Key, _Tp>>, + typename allocator_traits<_Allocator>::size_type = 0, + _Hash = _Hash(), + _Pred = _Pred(), + _Allocator = _Allocator()) -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>; template <class _InputIterator, class _Allocator, diff --git a/contrib/libs/cxxsupp/libcxx/include/unordered_set b/contrib/libs/cxxsupp/libcxx/include/unordered_set index 64a02de3cf..3297294a89 100644 --- a/contrib/libs/cxxsupp/libcxx/include/unordered_set +++ b/contrib/libs/cxxsupp/libcxx/include/unordered_set @@ -533,7 +533,6 @@ template <class Value, class Hash, class Pred, class Alloc> #include <__algorithm/is_permutation.h> #include <__assert> -#include <__availability> #include <__config> #include <__functional/is_transparent.h> #include <__functional/operations.h> @@ -589,13 +588,10 @@ public: typedef __type_identity_t<_Alloc> allocator_type; typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); - static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - private: typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; @@ -735,7 +731,7 @@ public: return allocator_type(__table_.__node_alloc()); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); } @@ -829,7 +825,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(unordered_set& __u) _NOEXCEPT_(__is_nothrow_swappable<__table>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(unordered_set& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) { __table_.swap(__u.__table_); } @@ -839,13 +835,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __table_.find(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __table_.find(__k); } @@ -853,8 +847,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __table_.__count_unique(__k); } @@ -863,8 +856,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -877,13 +869,11 @@ public: return __table_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __table_.__equal_range_unique(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __table_.__equal_range_unique(__k); } @@ -935,13 +925,13 @@ template <ranges::input_range _Range, class = enable_if_t<!is_integral<_Hash>::value>, class = enable_if_t<!__is_allocator<_Pred>::value>, class = enable_if_t<__is_allocator<_Allocator>::value>> -unordered_set(from_range_t, - _Range&&, - typename allocator_traits<_Allocator>::size_type = 0, - _Hash = _Hash(), - _Pred = _Pred(), - _Allocator = _Allocator()) - -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23 +unordered_set( + from_range_t, + _Range&&, + typename allocator_traits<_Allocator>::size_type = 0, + _Hash = _Hash(), + _Pred = _Pred(), + _Allocator = _Allocator()) -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23 # endif template <class _Tp, @@ -1193,7 +1183,7 @@ public: typedef __type_identity_t<_Alloc> allocator_type; typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), + static_assert(is_same<value_type, typename allocator_type::value_type>::value, "Allocator::value_type must be same type as value_type"); private: @@ -1335,7 +1325,7 @@ public: return allocator_type(__table_.__node_alloc()); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __table_.size() == 0; } _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); } _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); } @@ -1432,7 +1422,7 @@ public: } _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); } - _LIBCPP_HIDE_FROM_ABI void swap(unordered_multiset& __u) _NOEXCEPT_(__is_nothrow_swappable<__table>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(unordered_multiset& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) { __table_.swap(__u.__table_); } @@ -1442,13 +1432,11 @@ public: _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); } _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) { return __table_.find(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const { return __table_.find(__k); } @@ -1456,8 +1444,7 @@ public: _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const { return __table_.__count_multi(__k); } @@ -1466,8 +1453,7 @@ public: #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const { return find(__k) != end(); } @@ -1480,13 +1466,11 @@ public: return __table_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 20 - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) { return __table_.__equal_range_multi(__k); } - template <class _K2, - enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr> + template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr> _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const { return __table_.__equal_range_multi(__k); } diff --git a/contrib/libs/cxxsupp/libcxx/include/valarray b/contrib/libs/cxxsupp/libcxx/include/valarray index 3d45925a25..44341eb2ba 100644 --- a/contrib/libs/cxxsupp/libcxx/include/valarray +++ b/contrib/libs/cxxsupp/libcxx/include/valarray @@ -2667,8 +2667,8 @@ operator*(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator*(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator*(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<multiplies<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(multiplies<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2676,8 +2676,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator*(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator*(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<multiplies<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(multiplies<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2695,8 +2695,8 @@ operator/(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<divides<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator/(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<divides<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator/(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<divides<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(divides<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2704,8 +2704,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<divides<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator/(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<divides<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator/(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<divides<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(divides<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2723,8 +2723,8 @@ operator%(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<modulus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator%(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<modulus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator%(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<modulus<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(modulus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2732,8 +2732,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<modulus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator%(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<modulus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator%(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<modulus<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(modulus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2751,8 +2751,8 @@ operator+(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<plus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator+(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<plus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator+(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<plus<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(plus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2760,8 +2760,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<plus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator+(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<plus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator+(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<plus<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(plus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2779,8 +2779,8 @@ operator-(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<minus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator-(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<minus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator-(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<minus<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(minus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2788,8 +2788,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<minus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator-(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<minus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator-(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<minus<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(minus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2807,8 +2807,8 @@ operator^(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator^(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator^(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_xor<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(bit_xor<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2816,8 +2816,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator^(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator^(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_xor<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(bit_xor<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2835,8 +2835,8 @@ operator&(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator&(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator&(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_and<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(bit_and<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2844,8 +2844,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator&(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator&(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_and<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(bit_and<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2863,8 +2863,8 @@ operator|(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator|(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator|(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_or<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(bit_or<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2872,8 +2872,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator|(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator|(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<bit_or<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(bit_or<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2890,8 +2890,8 @@ operator<<(const _Expr1& __x, const _Expr2& __y) { } template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI __val_expr< - _BinaryOp<__bit_shift_left<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +inline _LIBCPP_HIDE_FROM_ABI +__val_expr< _BinaryOp<__bit_shift_left<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > operator<<(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__bit_shift_left<value_type>, _Expr, __scalar_expr<value_type> > _Op; @@ -2899,8 +2899,8 @@ operator<<(const _Expr& __x, const typename _Expr::value_type& __y) { } template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI __val_expr< - _BinaryOp<__bit_shift_left<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +inline _LIBCPP_HIDE_FROM_ABI +__val_expr< _BinaryOp<__bit_shift_left<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > operator<<(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__bit_shift_left<value_type>, __scalar_expr<value_type>, _Expr> _Op; @@ -2927,8 +2927,8 @@ operator>>(const _Expr& __x, const typename _Expr::value_type& __y) { } template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> -inline _LIBCPP_HIDE_FROM_ABI __val_expr< - _BinaryOp<__bit_shift_right<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +inline _LIBCPP_HIDE_FROM_ABI +__val_expr< _BinaryOp<__bit_shift_right<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > operator>>(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__bit_shift_right<value_type>, __scalar_expr<value_type>, _Expr> _Op; @@ -2947,8 +2947,8 @@ operator&&(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator&&(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator&&(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<logical_and<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(logical_and<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2956,8 +2956,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator&&(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator&&(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<logical_and<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(logical_and<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -2975,8 +2975,8 @@ operator||(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator||(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator||(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<logical_or<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(logical_or<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -2984,8 +2984,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator||(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator||(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<logical_or<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(logical_or<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3003,8 +3003,8 @@ operator==(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator==(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator==(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<equal_to<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(equal_to<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3012,8 +3012,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator==(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator==(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<equal_to<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(equal_to<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3031,8 +3031,8 @@ operator!=(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator!=(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator!=(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<not_equal_to<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3040,8 +3040,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator!=(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator!=(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<not_equal_to<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3059,8 +3059,8 @@ operator<(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<less<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator<(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<less<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator<(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<less<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(less<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3068,8 +3068,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<less<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator<(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<less<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator<(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<less<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(less<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3087,8 +3087,8 @@ operator>(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<greater<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator>(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<greater<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator>(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<greater<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(greater<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3096,8 +3096,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<greater<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator>(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<greater<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator>(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<greater<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(greater<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3115,8 +3115,8 @@ operator<=(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator<=(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator<=(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<less_equal<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(less_equal<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3124,8 +3124,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator<=(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator<=(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<less_equal<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(less_equal<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3143,8 +3143,8 @@ operator>=(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - operator>=(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +operator>=(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<greater_equal<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(greater_equal<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3152,8 +3152,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - operator>=(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +operator>=(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<greater_equal<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(greater_equal<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3203,8 +3203,8 @@ atan2(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - atan2(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +atan2(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__atan2_expr<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3212,8 +3212,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - atan2(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +atan2(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__atan2_expr<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); @@ -3271,8 +3271,8 @@ pow(const _Expr1& __x, const _Expr2& __y) { template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > - pow(const _Expr& __x, const typename _Expr::value_type& __y) { +__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > > +pow(const _Expr& __x, const typename _Expr::value_type& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__pow_expr<value_type>, _Expr, __scalar_expr<value_type> > _Op; return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size()))); @@ -3280,8 +3280,8 @@ inline _LIBCPP_HIDE_FROM_ABI template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI - __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > - pow(const typename _Expr::value_type& __x, const _Expr& __y) { +__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> > +pow(const typename _Expr::value_type& __x, const _Expr& __y) { typedef typename _Expr::value_type value_type; typedef _BinaryOp<__pow_expr<value_type>, __scalar_expr<value_type>, _Expr> _Op; return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y)); diff --git a/contrib/libs/cxxsupp/libcxx/include/variant b/contrib/libs/cxxsupp/libcxx/include/variant index 1b5e84e954..5f2d03b722 100644 --- a/contrib/libs/cxxsupp/libcxx/include/variant +++ b/contrib/libs/cxxsupp/libcxx/include/variant @@ -42,26 +42,28 @@ namespace std { in_place_index_t<I>, initializer_list<U>, Args&&...); // 20.7.2.2, destructor - ~variant(); + constexpr ~variant(); // constexpr since c++20 // 20.7.2.3, assignment constexpr variant& operator=(const variant&); constexpr variant& operator=(variant&&) noexcept(see below); - template <class T> variant& operator=(T&&) noexcept(see below); + template <class T> + constexpr variant& operator=(T&&) noexcept(see below); // constexpr since c++20 // 20.7.2.4, modifiers template <class T, class... Args> - T& emplace(Args&&...); + constexpr T& emplace(Args&&...); // constexpr since c++20 template <class T, class U, class... Args> - T& emplace(initializer_list<U>, Args&&...); + constexpr T& emplace(initializer_list<U>, Args&&...); // constexpr since c++20 template <size_t I, class... Args> - variant_alternative_t<I, variant>& emplace(Args&&...); + constexpr variant_alternative_t<I, variant>& emplace(Args&&...); // constexpr since c++20 template <size_t I, class U, class... Args> - variant_alternative_t<I, variant>& emplace(initializer_list<U>, Args&&...); + constexpr variant_alternative_t<I, variant>& + emplace(initializer_list<U>, Args&&...); // constexpr since c++20 // 20.7.2.5, value status constexpr bool valueless_by_exception() const noexcept; @@ -210,7 +212,6 @@ namespace std { */ -#include <__availability> #include <__compare/common_comparison_category.h> #include <__compare/compare_three_way_result.h> #include <__compare/three_way_comparable.h> @@ -221,6 +222,7 @@ namespace std { #include <__functional/operations.h> #include <__functional/unary_function.h> #include <__memory/addressof.h> +#include <__memory/construct_at.h> #include <__tuple/find_index.h> #include <__tuple/sfinae_helpers.h> #include <__type_traits/add_const.h> @@ -239,6 +241,7 @@ namespace std { #include <__type_traits/is_trivially_assignable.h> #include <__type_traits/is_trivially_constructible.h> #include <__type_traits/is_trivially_destructible.h> +#include <__type_traits/is_trivially_relocatable.h> #include <__type_traits/is_void.h> #include <__type_traits/remove_const.h> #include <__type_traits/remove_cvref.h> @@ -657,9 +660,14 @@ private: } // namespace __visitation +// Adding semi-colons in macro expansions helps clang-format to do a better job. +// This macro is used to avoid compilation errors due to "stray" semi-colons. +# define _LIBCPP_EAT_SEMICOLON static_assert(true, "") + template <size_t _Index, class _Tp> struct _LIBCPP_TEMPLATE_VIS __alt { - using __value_type = _Tp; + using __value_type = _Tp; + static constexpr size_t __index = _Index; template <class... _Args> _LIBCPP_HIDE_FROM_ABI explicit constexpr __alt(in_place_t, _Args&&... __args) @@ -674,7 +682,7 @@ union _LIBCPP_TEMPLATE_VIS __union; template <_Trait _DestructibleTrait, size_t _Index> union _LIBCPP_TEMPLATE_VIS __union<_DestructibleTrait, _Index> {}; -# define _LIBCPP_VARIANT_UNION(destructible_trait, destructor) \ +# define _LIBCPP_VARIANT_UNION(destructible_trait, destructor_definition) \ template <size_t _Index, class _Tp, class... _Types> \ union _LIBCPP_TEMPLATE_VIS __union<destructible_trait, _Index, _Tp, _Types...> { \ public: \ @@ -688,14 +696,11 @@ union _LIBCPP_TEMPLATE_VIS __union<_DestructibleTrait, _Index> {}; _LIBCPP_HIDE_FROM_ABI explicit constexpr __union(in_place_index_t<_Ip>, _Args&&... __args) \ : __tail(in_place_index<_Ip - 1>, std::forward<_Args>(__args)...) {} \ \ - __union(const __union&) = default; \ - __union(__union&&) = default; \ - \ - destructor \ - \ - __union& \ - operator=(const __union&) = default; \ - __union& operator=(__union&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __union(const __union&) = default; \ + _LIBCPP_HIDE_FROM_ABI __union(__union&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __union& operator=(const __union&) = default; \ + _LIBCPP_HIDE_FROM_ABI __union& operator=(__union&&) = default; \ + destructor_definition; \ \ private: \ char __dummy; \ @@ -705,9 +710,11 @@ union _LIBCPP_TEMPLATE_VIS __union<_DestructibleTrait, _Index> {}; friend struct __access::__union; \ } -_LIBCPP_VARIANT_UNION(_Trait::_TriviallyAvailable, ~__union() = default;); -_LIBCPP_VARIANT_UNION(_Trait::_Available, ~__union(){}); -_LIBCPP_VARIANT_UNION(_Trait::_Unavailable, ~__union() = delete;); +_LIBCPP_VARIANT_UNION(_Trait::_TriviallyAvailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__union() = default); +_LIBCPP_VARIANT_UNION( + _Trait::_Available, _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__union() {} _LIBCPP_EAT_SEMICOLON); +_LIBCPP_VARIANT_UNION(_Trait::_Unavailable, _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__union() = delete); # undef _LIBCPP_VARIANT_UNION @@ -750,7 +757,7 @@ protected: template <class _Traits, _Trait = _Traits::__destructible_trait> class _LIBCPP_TEMPLATE_VIS __dtor; -# define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \ +# define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor_definition, destroy) \ template <class... _Types> \ class _LIBCPP_TEMPLATE_VIS __dtor<__traits<_Types...>, destructible_trait> \ : public __base<destructible_trait, _Types...> { \ @@ -760,24 +767,27 @@ class _LIBCPP_TEMPLATE_VIS __dtor; public: \ using __base_type::__base_type; \ using __base_type::operator=; \ - \ - __dtor(const __dtor&) = default; \ - __dtor(__dtor&&) = default; \ - destructor __dtor& operator=(const __dtor&) = default; \ - __dtor& operator=(__dtor&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __dtor(const __dtor&) = default; \ + _LIBCPP_HIDE_FROM_ABI __dtor(__dtor&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __dtor& operator=(const __dtor&) = default; \ + _LIBCPP_HIDE_FROM_ABI __dtor& operator=(__dtor&&) = default; \ + destructor_definition; \ \ protected: \ - inline _LIBCPP_HIDE_FROM_ABI destroy \ + destroy; \ } _LIBCPP_VARIANT_DESTRUCTOR( - _Trait::_TriviallyAvailable, ~__dtor() = default; - , void __destroy() noexcept { this->__index = __variant_npos<__index_t>; }); + _Trait::_TriviallyAvailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__dtor() = default, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy() noexcept { + this->__index = __variant_npos<__index_t>; + } _LIBCPP_EAT_SEMICOLON); _LIBCPP_VARIANT_DESTRUCTOR( _Trait::_Available, - ~__dtor() { __destroy(); }, - void __destroy() noexcept { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__dtor() { __destroy(); } _LIBCPP_EAT_SEMICOLON, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy() noexcept { if (!this->valueless_by_exception()) { __visitation::__base::__visit_alt( [](auto& __alt) noexcept { @@ -787,9 +797,11 @@ _LIBCPP_VARIANT_DESTRUCTOR( *this); } this->__index = __variant_npos<__index_t>; - }); + } _LIBCPP_EAT_SEMICOLON); -_LIBCPP_VARIANT_DESTRUCTOR(_Trait::_Unavailable, ~__dtor() = delete;, void __destroy() noexcept = delete;); +_LIBCPP_VARIANT_DESTRUCTOR(_Trait::_Unavailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__dtor() = delete, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy() noexcept = delete); # undef _LIBCPP_VARIANT_DESTRUCTOR @@ -802,23 +814,18 @@ public: using __base_type::operator=; protected: - template <size_t _Ip, class _Tp, class... _Args> - _LIBCPP_HIDE_FROM_ABI static _Tp& __construct_alt(__alt<_Ip, _Tp>& __a, _Args&&... __args) { - ::new ((void*)std::addressof(__a)) __alt<_Ip, _Tp>(in_place, std::forward<_Args>(__args)...); - return __a.__value; - } - template <class _Rhs> - _LIBCPP_HIDE_FROM_ABI static void __generic_construct(__ctor& __lhs, _Rhs&& __rhs) { + _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 void __generic_construct(__ctor& __lhs, _Rhs&& __rhs) { __lhs.__destroy(); if (!__rhs.valueless_by_exception()) { auto __rhs_index = __rhs.index(); __visitation::__base::__visit_alt_at( __rhs_index, - [](auto& __lhs_alt, auto&& __rhs_alt) { - __construct_alt(__lhs_alt, std::forward<decltype(__rhs_alt)>(__rhs_alt).__value); + [&__lhs](auto&& __rhs_alt) { + std::__construct_at(std::addressof(__lhs.__data), + in_place_index<__decay_t<decltype(__rhs_alt)>::__index>, + std::forward<decltype(__rhs_alt)>(__rhs_alt).__value); }, - __lhs, std::forward<_Rhs>(__rhs)); __lhs.__index = __rhs_index; } @@ -828,7 +835,7 @@ protected: template <class _Traits, _Trait = _Traits::__move_constructible_trait> class _LIBCPP_TEMPLATE_VIS __move_constructor; -# define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, move_constructor) \ +# define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, move_constructor_definition) \ template <class... _Types> \ class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, move_constructible_trait> \ : public __ctor<__traits<_Types...>> { \ @@ -838,28 +845,35 @@ class _LIBCPP_TEMPLATE_VIS __move_constructor; using __base_type::__base_type; \ using __base_type::operator=; \ \ - __move_constructor(const __move_constructor&) = default; \ - move_constructor ~__move_constructor() = default; \ - __move_constructor& operator=(const __move_constructor&) = default; \ - __move_constructor& operator=(__move_constructor&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __move_constructor(const __move_constructor&) = default; \ + _LIBCPP_HIDE_FROM_ABI ~__move_constructor() = default; \ + _LIBCPP_HIDE_FROM_ABI __move_constructor& operator=(const __move_constructor&) = default; \ + _LIBCPP_HIDE_FROM_ABI __move_constructor& operator=(__move_constructor&&) = default; \ + move_constructor_definition; \ } -_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(_Trait::_TriviallyAvailable, - __move_constructor(__move_constructor&& __that) = default;); +_LIBCPP_VARIANT_MOVE_CONSTRUCTOR( + _Trait::_TriviallyAvailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_constructor(__move_constructor&& __that) = default); _LIBCPP_VARIANT_MOVE_CONSTRUCTOR( _Trait::_Available, - __move_constructor(__move_constructor&& __that) noexcept(__all<is_nothrow_move_constructible_v<_Types>...>::value) - : __move_constructor(__valueless_t{}) { this->__generic_construct(*this, std::move(__that)); }); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_constructor(__move_constructor&& __that) noexcept( + __all<is_nothrow_move_constructible_v<_Types>...>::value) + : __move_constructor(__valueless_t{}) { + this->__generic_construct(*this, std::move(__that)); + } _LIBCPP_EAT_SEMICOLON); -_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(_Trait::_Unavailable, __move_constructor(__move_constructor&&) = delete;); +_LIBCPP_VARIANT_MOVE_CONSTRUCTOR( + _Trait::_Unavailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_constructor(__move_constructor&&) = delete); # undef _LIBCPP_VARIANT_MOVE_CONSTRUCTOR template <class _Traits, _Trait = _Traits::__copy_constructible_trait> class _LIBCPP_TEMPLATE_VIS __copy_constructor; -# define _LIBCPP_VARIANT_COPY_CONSTRUCTOR(copy_constructible_trait, copy_constructor) \ +# define _LIBCPP_VARIANT_COPY_CONSTRUCTOR(copy_constructible_trait, copy_constructor_definition) \ template <class... _Types> \ class _LIBCPP_TEMPLATE_VIS __copy_constructor<__traits<_Types...>, copy_constructible_trait> \ : public __move_constructor<__traits<_Types...>> { \ @@ -869,20 +883,25 @@ class _LIBCPP_TEMPLATE_VIS __copy_constructor; using __base_type::__base_type; \ using __base_type::operator=; \ \ - copy_constructor __copy_constructor(__copy_constructor&&) = default; \ - ~__copy_constructor() = default; \ - __copy_constructor& operator=(const __copy_constructor&) = default; \ - __copy_constructor& operator=(__copy_constructor&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_constructor(__copy_constructor&&) = default; \ + _LIBCPP_HIDE_FROM_ABI ~__copy_constructor() = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_constructor& operator=(const __copy_constructor&) = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_constructor& operator=(__copy_constructor&&) = default; \ + copy_constructor_definition; \ } -_LIBCPP_VARIANT_COPY_CONSTRUCTOR(_Trait::_TriviallyAvailable, - __copy_constructor(const __copy_constructor& __that) = default;); +_LIBCPP_VARIANT_COPY_CONSTRUCTOR( + _Trait::_TriviallyAvailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_constructor(const __copy_constructor& __that) = default); _LIBCPP_VARIANT_COPY_CONSTRUCTOR( - _Trait::_Available, __copy_constructor(const __copy_constructor& __that) - : __copy_constructor(__valueless_t{}) { this->__generic_construct(*this, __that); }); + _Trait::_Available, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_constructor(const __copy_constructor& __that) + : __copy_constructor(__valueless_t{}) { this->__generic_construct(*this, __that); } _LIBCPP_EAT_SEMICOLON); -_LIBCPP_VARIANT_COPY_CONSTRUCTOR(_Trait::_Unavailable, __copy_constructor(const __copy_constructor&) = delete;); +_LIBCPP_VARIANT_COPY_CONSTRUCTOR( + _Trait::_Unavailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_constructor(const __copy_constructor&) = delete); # undef _LIBCPP_VARIANT_COPY_CONSTRUCTOR @@ -895,22 +914,24 @@ public: using __base_type::operator=; template <size_t _Ip, class... _Args> - _LIBCPP_HIDE_FROM_ABI auto& __emplace(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto& __emplace(_Args&&... __args) { this->__destroy(); - auto& __res = this->__construct_alt(__access::__base::__get_alt<_Ip>(*this), std::forward<_Args>(__args)...); + std::__construct_at(std::addressof(this->__data), in_place_index<_Ip>, std::forward<_Args>(__args)...); this->__index = _Ip; - return __res; + return __access::__base::__get_alt<_Ip>(*this).__value; } protected: template <size_t _Ip, class _Tp, class _Arg> - _LIBCPP_HIDE_FROM_ABI void __assign_alt(__alt<_Ip, _Tp>& __a, _Arg&& __arg) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __assign_alt(__alt<_Ip, _Tp>& __a, _Arg&& __arg) { if (this->index() == _Ip) { __a.__value = std::forward<_Arg>(__arg); } else { struct { - _LIBCPP_HIDE_FROM_ABI void operator()(true_type) const { __this->__emplace<_Ip>(std::forward<_Arg>(__arg)); } - _LIBCPP_HIDE_FROM_ABI void operator()(false_type) const { + _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()(true_type) const { + __this->__emplace<_Ip>(std::forward<_Arg>(__arg)); + } + _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()(false_type) const { __this->__emplace<_Ip>(_Tp(std::forward<_Arg>(__arg))); } __assignment* __this; @@ -921,7 +942,7 @@ protected: } template <class _That> - _LIBCPP_HIDE_FROM_ABI void __generic_assign(_That&& __that) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __generic_assign(_That&& __that) { if (this->valueless_by_exception() && __that.valueless_by_exception()) { // do nothing. } else if (__that.valueless_by_exception()) { @@ -941,7 +962,7 @@ protected: template <class _Traits, _Trait = _Traits::__move_assignable_trait> class _LIBCPP_TEMPLATE_VIS __move_assignment; -# define _LIBCPP_VARIANT_MOVE_ASSIGNMENT(move_assignable_trait, move_assignment) \ +# define _LIBCPP_VARIANT_MOVE_ASSIGNMENT(move_assignable_trait, move_assignment_definition) \ template <class... _Types> \ class _LIBCPP_TEMPLATE_VIS __move_assignment<__traits<_Types...>, move_assignable_trait> \ : public __assignment<__traits<_Types...>> { \ @@ -951,33 +972,36 @@ class _LIBCPP_TEMPLATE_VIS __move_assignment; using __base_type::__base_type; \ using __base_type::operator=; \ \ - __move_assignment(const __move_assignment&) = default; \ - __move_assignment(__move_assignment&&) = default; \ - ~__move_assignment() = default; \ - __move_assignment& operator=(const __move_assignment&) = default; \ - move_assignment \ + _LIBCPP_HIDE_FROM_ABI __move_assignment(const __move_assignment&) = default; \ + _LIBCPP_HIDE_FROM_ABI __move_assignment(__move_assignment&&) = default; \ + _LIBCPP_HIDE_FROM_ABI ~__move_assignment() = default; \ + _LIBCPP_HIDE_FROM_ABI __move_assignment& operator=(const __move_assignment&) = default; \ + move_assignment_definition; \ } _LIBCPP_VARIANT_MOVE_ASSIGNMENT(_Trait::_TriviallyAvailable, - __move_assignment& operator=(__move_assignment&& __that) = default;); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_assignment& operator=( + __move_assignment&& __that) = default); _LIBCPP_VARIANT_MOVE_ASSIGNMENT( _Trait::_Available, - __move_assignment& + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_assignment& operator=(__move_assignment&& __that) noexcept( __all<(is_nothrow_move_constructible_v<_Types> && is_nothrow_move_assignable_v<_Types>)...>::value) { this->__generic_assign(std::move(__that)); return *this; - }); + } _LIBCPP_EAT_SEMICOLON); -_LIBCPP_VARIANT_MOVE_ASSIGNMENT(_Trait::_Unavailable, __move_assignment& operator=(__move_assignment&&) = delete;); +_LIBCPP_VARIANT_MOVE_ASSIGNMENT( + _Trait::_Unavailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __move_assignment& operator=(__move_assignment&&) = delete); # undef _LIBCPP_VARIANT_MOVE_ASSIGNMENT template <class _Traits, _Trait = _Traits::__copy_assignable_trait> class _LIBCPP_TEMPLATE_VIS __copy_assignment; -# define _LIBCPP_VARIANT_COPY_ASSIGNMENT(copy_assignable_trait, copy_assignment) \ +# define _LIBCPP_VARIANT_COPY_ASSIGNMENT(copy_assignable_trait, copy_assignment_definition) \ template <class... _Types> \ class _LIBCPP_TEMPLATE_VIS __copy_assignment<__traits<_Types...>, copy_assignable_trait> \ : public __move_assignment<__traits<_Types...>> { \ @@ -987,22 +1011,28 @@ class _LIBCPP_TEMPLATE_VIS __copy_assignment; using __base_type::__base_type; \ using __base_type::operator=; \ \ - __copy_assignment(const __copy_assignment&) = default; \ - __copy_assignment(__copy_assignment&&) = default; \ - ~__copy_assignment() = default; \ - copy_assignment __copy_assignment& operator=(__copy_assignment&&) = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_assignment(const __copy_assignment&) = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_assignment(__copy_assignment&&) = default; \ + _LIBCPP_HIDE_FROM_ABI ~__copy_assignment() = default; \ + _LIBCPP_HIDE_FROM_ABI __copy_assignment& operator=(__copy_assignment&&) = default; \ + copy_assignment_definition; \ } _LIBCPP_VARIANT_COPY_ASSIGNMENT(_Trait::_TriviallyAvailable, - __copy_assignment& operator=(const __copy_assignment& __that) = default;); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_assignment& operator=( + const __copy_assignment& __that) = default); _LIBCPP_VARIANT_COPY_ASSIGNMENT( - _Trait::_Available, __copy_assignment& operator=(const __copy_assignment& __that) { + _Trait::_Available, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_assignment& + operator=(const __copy_assignment& __that) { this->__generic_assign(__that); return *this; - }); + } _LIBCPP_EAT_SEMICOLON); -_LIBCPP_VARIANT_COPY_ASSIGNMENT(_Trait::_Unavailable, __copy_assignment& operator=(const __copy_assignment&) = delete;); +_LIBCPP_VARIANT_COPY_ASSIGNMENT(_Trait::_Unavailable, + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __copy_assignment& operator=( + const __copy_assignment&) = delete); # undef _LIBCPP_VARIANT_COPY_ASSIGNMENT @@ -1018,11 +1048,11 @@ public: _LIBCPP_HIDE_FROM_ABI __impl& operator=(__impl&&) = default; template <size_t _Ip, class _Arg> - _LIBCPP_HIDE_FROM_ABI void __assign(_Arg&& __arg) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __assign(_Arg&& __arg) { this->__assign_alt(__access::__base::__get_alt<_Ip>(*this), std::forward<_Arg>(__arg)); } - inline _LIBCPP_HIDE_FROM_ABI void __swap(__impl& __that) { + inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __swap(__impl& __that) { if (this->valueless_by_exception() && __that.valueless_by_exception()) { // do nothing. } else if (this->index() == __that.index()) { @@ -1067,7 +1097,7 @@ public: } private: - inline _LIBCPP_HIDE_FROM_ABI bool __move_nothrow() const { + constexpr inline _LIBCPP_HIDE_FROM_ABI bool __move_nothrow() const { constexpr bool __results[] = {is_nothrow_move_constructible_v<_Types>...}; return this->valueless_by_exception() || __results[this->index()]; } @@ -1151,6 +1181,9 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_DECLSPEC_EMPTY_BASES variant using __first_type = variant_alternative_t<0, variant>; public: + using __trivially_relocatable = + conditional_t<_And<__libcpp_is_trivially_relocatable<_Types>...>::value, variant, void>; + template <bool _Dummy = true, enable_if_t<__dependent_type<is_default_constructible<__first_type>, _Dummy>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>) @@ -1209,7 +1242,7 @@ public: _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>) : __impl_(in_place_index<_Ip>, __il, std::forward<_Args>(__args)...) {} - _LIBCPP_HIDE_FROM_ABI ~variant() = default; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~variant() = default; _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(const variant&) = default; _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(variant&&) = default; @@ -1219,7 +1252,7 @@ public: class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>, size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value, enable_if_t<is_assignable_v<_Tp&, _Arg> && is_constructible_v<_Tp, _Arg>, int> = 0> - _LIBCPP_HIDE_FROM_ABI variant& + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 variant& operator=(_Arg&& __arg) noexcept(is_nothrow_assignable_v<_Tp&, _Arg> && is_nothrow_constructible_v<_Tp, _Arg>) { __impl_.template __assign<_Ip>(std::forward<_Arg>(__arg)); return *this; @@ -1230,7 +1263,7 @@ public: enable_if_t<(_Ip < sizeof...(_Types)), int> = 0, class _Tp = variant_alternative_t<_Ip, variant<_Types...>>, enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0> - _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) { return __impl_.template __emplace<_Ip>(std::forward<_Args>(__args)...); } @@ -1240,7 +1273,7 @@ public: enable_if_t<(_Ip < sizeof...(_Types)), int> = 0, class _Tp = variant_alternative_t<_Ip, variant<_Types...>>, enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0> - _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...); } @@ -1248,7 +1281,7 @@ public: class... _Args, size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value, enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0> - _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) { return __impl_.template __emplace<_Ip>(std::forward<_Args>(__args)...); } @@ -1257,7 +1290,7 @@ public: class... _Args, size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value, enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0> - _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...); } @@ -1271,7 +1304,7 @@ public: enable_if_t< __all<(__dependent_type<is_move_constructible<_Types>, _Dummy>::value && __dependent_type<is_swappable<_Types>, _Dummy>::value)...>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI void swap(variant& __that) noexcept( + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(variant& __that) noexcept( __all<(is_nothrow_move_constructible_v<_Types> && is_nothrow_swappable_v<_Types>)...>::value) { __impl_.__swap(__that.__impl_); } @@ -1325,8 +1358,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr au template <size_t _Ip, class... _Types> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>& - get(variant<_Types...>& __v) { +_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>& +get(variant<_Types...>& __v) { static_assert(_Ip < sizeof...(_Types)); static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>); return std::__generic_get<_Ip>(__v); @@ -1334,8 +1367,8 @@ _LIBCPP_HIDE_FROM_ABI template <size_t _Ip, class... _Types> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&& - get(variant<_Types...>&& __v) { +_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&& +get(variant<_Types...>&& __v) { static_assert(_Ip < sizeof...(_Types)); static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>); return std::__generic_get<_Ip>(std::move(__v)); @@ -1343,8 +1376,8 @@ _LIBCPP_HIDE_FROM_ABI template <size_t _Ip, class... _Types> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>& - get(const variant<_Types...>& __v) { +_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>& +get(const variant<_Types...>& __v) { static_assert(_Ip < sizeof...(_Types)); static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>); return std::__generic_get<_Ip>(__v); @@ -1352,8 +1385,8 @@ _LIBCPP_HIDE_FROM_ABI template <size_t _Ip, class... _Types> _LIBCPP_HIDE_FROM_ABI - _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&& - get(const variant<_Types...>&& __v) { +_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&& +get(const variant<_Types...>&& __v) { static_assert(_Ip < sizeof...(_Types)); static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>); return std::__generic_get<_Ip>(std::move(__v)); @@ -1554,9 +1587,9 @@ visit(_Visitor&& __visitor, _Vs&&... __vs) { # endif template <class... _Types> -_LIBCPP_HIDE_FROM_ABI auto -swap(variant<_Types...>& __lhs, variant<_Types...>& __rhs) noexcept(noexcept(__lhs.swap(__rhs))) - -> decltype(__lhs.swap(__rhs)) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto +swap(variant<_Types...>& __lhs, + variant<_Types...>& __rhs) noexcept(noexcept(__lhs.swap(__rhs))) -> decltype(__lhs.swap(__rhs)) { return __lhs.swap(__rhs); } diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector index 61e3263344..2f714f1ec8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/vector +++ b/contrib/libs/cxxsupp/libcxx/include/vector @@ -316,10 +316,10 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++ #include <__algorithm/rotate.h> #include <__algorithm/unwrap_iter.h> #include <__assert> -#include <__availability> #include <__bit_reference> #include <__concepts/same_as.h> #include <__config> +#include <__debug_utils/sanitizers.h> #include <__format/enable_insertable.h> #include <__format/formatter.h> #include <__format/formatter_bool.h> @@ -412,13 +412,19 @@ public: typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + // A vector containers the following members which may be trivially relocatable: + // - pointer: may be trivially relocatable, so it's checked + // - allocator_type: may be trivially relocatable, so it's checked + // vector doesn't contain any self-references, so it's trivially relocatable if its members are. + using __trivially_relocatable = __conditional_t< + __libcpp_is_trivially_relocatable<pointer>::value && __libcpp_is_trivially_relocatable<allocator_type>::value, + vector, + void>; + + static_assert(__check_valid_allocator<allocator_type>::value, ""); + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value) {} _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(const allocator_type& __a) @@ -429,11 +435,36 @@ public: #endif : __end_cap_(nullptr, __a) { } - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n); + + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n) { + auto __guard = std::__make_exception_guard(__destroy_vector(*this)); + if (__n > 0) { + __vallocate(__n); + __construct_at_end(__n); + } + __guard.__complete(); + } + #if _LIBCPP_STD_VER >= 14 - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a); + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a) + : __end_cap_(nullptr, __a) { + auto __guard = std::__make_exception_guard(__destroy_vector(*this)); + if (__n > 0) { + __vallocate(__n); + __construct_at_end(__n); + } + __guard.__complete(); + } #endif - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x); + + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x) { + auto __guard = std::__make_exception_guard(__destroy_vector(*this)); + if (__n > 0) { + __vallocate(__n); + __construct_at_end(__n, __x); + } + __guard.__complete(); + } template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI @@ -604,7 +635,7 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT { return static_cast<size_type>(__end_cap() - this->__begin_); } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { + _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return this->__begin_ == this->__end_; } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT; @@ -648,11 +679,11 @@ public: template <class... _Args> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI #if _LIBCPP_STD_VER >= 17 - reference - emplace_back(_Args&&... __args); + reference + emplace_back(_Args&&... __args); #else - void - emplace_back(_Args&&... __args); + void + emplace_back(_Args&&... __args); #endif #if _LIBCPP_STD_VER >= 23 @@ -734,7 +765,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const; @@ -846,15 +877,7 @@ private: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const { - (void)__old_mid; - (void)__new_mid; -#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - const void* __beg = data(); - const void* __end = data() + capacity(); - if (!__libcpp_is_constant_evaluated() && __beg != nullptr && - __asan_annotate_container_with_allocator<_Allocator>::value) - __sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid); -#endif + std::__annotate_contiguous_container<_Allocator>(data(), data() + capacity(), __old_mid, __new_mid); } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT { @@ -891,6 +914,7 @@ private: __v_.__annotate_increase(__n); #endif } + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { __v_.__end_ = __pos_; #ifndef _LIBCPP_HAS_NO_ASAN @@ -904,7 +928,6 @@ private: pointer __pos_; const_pointer const __new_end_; - private: _ConstructTransaction(_ConstructTransaction const&) = delete; _ConstructTransaction& operator=(_ConstructTransaction const&) = delete; }; @@ -1158,39 +1181,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__append(size_type _ } template <class _Tp, class _Allocator> -_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n) { - auto __guard = std::__make_exception_guard(__destroy_vector(*this)); - if (__n > 0) { - __vallocate(__n); - __construct_at_end(__n); - } - __guard.__complete(); -} - -#if _LIBCPP_STD_VER >= 14 -template <class _Tp, class _Allocator> -_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a) - : __end_cap_(nullptr, __a) { - auto __guard = std::__make_exception_guard(__destroy_vector(*this)); - if (__n > 0) { - __vallocate(__n); - __construct_at_end(__n); - } - __guard.__complete(); -} -#endif - -template <class _Tp, class _Allocator> -_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x) { - auto __guard = std::__make_exception_guard(__destroy_vector(*this)); - if (__n > 0) { - __vallocate(__n); - __construct_at_end(__n, __x); - } - __guard.__complete(); -} - -template <class _Tp, class _Allocator> template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value && is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value, @@ -1849,7 +1839,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::swap(vector& __x) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) #endif { _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR( @@ -2073,7 +2063,7 @@ public: return __internal_cap_to_external(__cap()); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT { return __size_; } - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT { return __size_ == 0; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __n); @@ -2193,7 +2183,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void swap(reference __x, reference __y) _NOEXCEPT { std::swap(__x, __y); @@ -2855,7 +2845,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::swap(vector& __x) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>) #endif { std::swap(this->__begin_, __x.__begin_); @@ -3006,7 +2996,7 @@ template <class _Tp, class _Allocator> _LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp> operator<=>(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) { return std::lexicographical_compare_three_way( - __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); + __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } #endif // _LIBCPP_STD_VER <= 17 @@ -3083,7 +3073,9 @@ _LIBCPP_POP_MACROS # include <concepts> # include <cstdlib> # include <iosfwd> -# include <locale> +# if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include <locale> +# endif # include <tuple> # include <type_traits> # include <typeinfo> diff --git a/contrib/libs/cxxsupp/libcxx/include/version b/contrib/libs/cxxsupp/libcxx/include/version index 3bd296e34a..460af8b6d3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/version +++ b/contrib/libs/cxxsupp/libcxx/include/version @@ -35,13 +35,13 @@ __cpp_lib_atomic_flag_test 201907L <atomic> __cpp_lib_atomic_float 201711L <atomic> __cpp_lib_atomic_is_always_lock_free 201603L <atomic> __cpp_lib_atomic_lock_free_type_aliases 201907L <atomic> +__cpp_lib_atomic_min_max 202403L <atomic> __cpp_lib_atomic_ref 201806L <atomic> __cpp_lib_atomic_shared_ptr 201711L <atomic> __cpp_lib_atomic_value_initialization 201911L <atomic> <memory> __cpp_lib_atomic_wait 201907L <atomic> __cpp_lib_barrier 201907L <barrier> -__cpp_lib_bind_back 202306L <functional> - 202202L // C++23 +__cpp_lib_bind_back 202202L <functional> __cpp_lib_bind_front 202306L <functional> 201907L // C++20 __cpp_lib_bit_cast 201806L <bit> @@ -70,6 +70,7 @@ __cpp_lib_constexpr_functional 201907L <functional> __cpp_lib_constexpr_iterator 201811L <iterator> __cpp_lib_constexpr_memory 202202L <memory> 201811L // C++20 +__cpp_lib_constexpr_new 202406L <new> __cpp_lib_constexpr_numeric 201911L <numeric> __cpp_lib_constexpr_string 201907L <string> __cpp_lib_constexpr_string_view 201811L <string_view> @@ -77,9 +78,18 @@ __cpp_lib_constexpr_tuple 201811L <tuple> __cpp_lib_constexpr_typeinfo 202106L <typeinfo> __cpp_lib_constexpr_utility 201811L <utility> __cpp_lib_constexpr_vector 201907L <vector> +__cpp_lib_constrained_equality 202403L <optional> <tuple> <utility> + <variant> +__cpp_lib_containers_ranges 202202L <deque> <forward_list> <list> + <map> <queue> <set> + <stack> <string> <unordered_map> + <unordered_set> <vector> __cpp_lib_copyable_function 202306L <functional> __cpp_lib_coroutine 201902L <coroutine> __cpp_lib_debugging 202311L <debugging> +__cpp_lib_default_template_type_for_algorithm_values 202403L <algorithm> <deque> <forward_list> + <list> <ranges> <string> + <vector> __cpp_lib_destroying_delete 201806L <new> __cpp_lib_enable_shared_from_this 201603L <memory> __cpp_lib_endian 201907L <bit> @@ -92,6 +102,7 @@ __cpp_lib_execution 201902L <execution> __cpp_lib_expected 202211L <expected> __cpp_lib_filesystem 201703L <filesystem> __cpp_lib_format 202106L <format> +__cpp_lib_format_path 202403L <filesystem> __cpp_lib_format_ranges 202207L <format> __cpp_lib_format_uchar 202311L <format> __cpp_lib_formatters 202302L <stacktrace> <thread> @@ -107,6 +118,7 @@ __cpp_lib_freestanding_variant 202311L <variant> __cpp_lib_fstream_native_handle 202306L <fstream> __cpp_lib_function_ref 202306L <functional> __cpp_lib_gcd_lcm 201606L <numeric> +__cpp_lib_generate_random 202403L <random> __cpp_lib_generic_associative_lookup 201304L <map> <set> __cpp_lib_generic_unordered_lookup 201811L <unordered_map> <unordered_set> __cpp_lib_hardware_interference_size 201703L <new> @@ -114,6 +126,7 @@ __cpp_lib_has_unique_object_representations 201606L <type_traits> __cpp_lib_hazard_pointer 202306L <hazard_pointer> __cpp_lib_hypot 201603L <cmath> __cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector> +__cpp_lib_inplace_vector 202406L <inplace_vector> __cpp_lib_int_pow2 202002L <bit> __cpp_lib_integer_comparison_functions 202002L <utility> __cpp_lib_integer_sequence 201304L <utility> @@ -132,6 +145,8 @@ __cpp_lib_is_null_pointer 201309L <type_traits> __cpp_lib_is_pointer_interconvertible 201907L <type_traits> __cpp_lib_is_scoped_enum 202011L <type_traits> __cpp_lib_is_swappable 201603L <type_traits> +__cpp_lib_is_virtual_base_of 202406L <type_traits> +__cpp_lib_is_within_lifetime 202306L <type_traits> __cpp_lib_jthread 201911L <stop_token> <thread> __cpp_lib_latch 201907L <latch> __cpp_lib_launder 201606L <new> @@ -158,9 +173,11 @@ __cpp_lib_not_fn 201603L <functional> __cpp_lib_null_iterators 201304L <iterator> __cpp_lib_optional 202110L <optional> 201606L // C++17 +__cpp_lib_optional_range_support 202406L <optional> __cpp_lib_out_ptr 202311L <memory> 202106L // C++23 __cpp_lib_parallel_algorithm 201603L <algorithm> <numeric> +__cpp_lib_philox_engine 202406L <random> __cpp_lib_polymorphic_allocator 201902L <memory_resource> __cpp_lib_print 202207L <ostream> <print> __cpp_lib_quoted_string_io 201304L <iomanip> @@ -170,21 +187,20 @@ __cpp_lib_ranges_as_const 202207L <ranges> __cpp_lib_ranges_as_rvalue 202207L <ranges> __cpp_lib_ranges_chunk 202202L <ranges> __cpp_lib_ranges_chunk_by 202202L <ranges> +__cpp_lib_ranges_concat 202403L <ranges> __cpp_lib_ranges_contains 202207L <algorithm> __cpp_lib_ranges_iota 202202L <numeric> __cpp_lib_ranges_join_with 202202L <ranges> __cpp_lib_ranges_repeat 202207L <ranges> __cpp_lib_ranges_slide 202202L <ranges> __cpp_lib_ranges_starts_ends_with 202106L <algorithm> -__cpp_lib_ranges_to_container 202202L <deque> <forward_list> <list> - <map> <queue> <ranges> - <set> <stack> <string> - <unordered_map> <unordered_set> <vector> +__cpp_lib_ranges_to_container 202202L <ranges> __cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility> __cpp_lib_ratio 202306L <ratio> __cpp_lib_raw_memory_algorithms 201606L <memory> __cpp_lib_rcu 202306L <rcu> __cpp_lib_reference_from_temporary 202202L <type_traits> +__cpp_lib_reference_wrapper 202403L <functional> __cpp_lib_remove_cvref 201711L <type_traits> __cpp_lib_result_of_sfinae 201210L <functional> <type_traits> __cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm> @@ -192,6 +208,7 @@ __cpp_lib_sample 201603L <algorithm> __cpp_lib_saturation_arithmetic 202311L <numeric> __cpp_lib_scoped_lock 201703L <mutex> __cpp_lib_semaphore 201907L <semaphore> +__cpp_lib_senders 202406L <execution> __cpp_lib_shared_mutex 201505L <shared_mutex> __cpp_lib_shared_ptr_arrays 201707L <memory> 201611L // C++17 @@ -218,7 +235,7 @@ __cpp_lib_string_view 201803L <string> <string __cpp_lib_submdspan 202306L <mdspan> __cpp_lib_syncbuf 201803L <syncstream> __cpp_lib_text_encoding 202306L <text_encoding> -__cpp_lib_three_way_comparison 201907L <compare> +__cpp_lib_three_way_comparison 201711L <compare> __cpp_lib_to_address 201711L <memory> __cpp_lib_to_array 201907L <array> __cpp_lib_to_chars 202306L <charconv> @@ -241,11 +258,9 @@ __cpp_lib_unreachable 202202L <utility> __cpp_lib_unwrap_ref 201811L <functional> __cpp_lib_variant 202102L <variant> __cpp_lib_void_t 201411L <type_traits> -__cpp_lib_within_lifetime 202306L <type_traits> */ -#include <__availability> #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -428,7 +443,7 @@ __cpp_lib_within_lifetime 202306L <type_traits> # if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM) # define __cpp_lib_syncbuf 201803L # endif -// # define __cpp_lib_three_way_comparison 201907L +# define __cpp_lib_three_way_comparison 201711L # define __cpp_lib_to_address 201711L # define __cpp_lib_to_array 201907L # define __cpp_lib_type_identity 201806L @@ -439,7 +454,7 @@ __cpp_lib_within_lifetime 202306L <type_traits> # define __cpp_lib_adaptor_iterator_pair_constructor 202106L # define __cpp_lib_allocate_at_least 202302L // # define __cpp_lib_associative_heterogeneous_erasure 202110L -// # define __cpp_lib_bind_back 202202L +# define __cpp_lib_bind_back 202202L # define __cpp_lib_byteswap 202110L # define __cpp_lib_constexpr_bitset 202207L # define __cpp_lib_constexpr_charconv 202207L @@ -447,6 +462,7 @@ __cpp_lib_within_lifetime 202306L <type_traits> # undef __cpp_lib_constexpr_memory # define __cpp_lib_constexpr_memory 202202L # define __cpp_lib_constexpr_typeinfo 202106L +# define __cpp_lib_containers_ranges 202202L # define __cpp_lib_expected 202211L # define __cpp_lib_format_ranges 202207L // # define __cpp_lib_formatters 202302L @@ -455,6 +471,7 @@ __cpp_lib_within_lifetime 202306L <type_traits> # define __cpp_lib_ios_noreplace 202207L # define __cpp_lib_is_scoped_enum 202011L # define __cpp_lib_mdspan 202207L +# define __cpp_lib_modules 202207L // # define __cpp_lib_move_only_function 202110L # undef __cpp_lib_optional # define __cpp_lib_optional 202110L @@ -478,7 +495,6 @@ __cpp_lib_within_lifetime 202306L <type_traits> # define __cpp_lib_stdatomic_h 202011L # define __cpp_lib_string_contains 202011L # define __cpp_lib_string_resize_and_overwrite 202110L -// # define __cpp_lib_to_string 202306L # define __cpp_lib_to_underlying 202102L // # define __cpp_lib_tuple_like 202207L # define __cpp_lib_unreachable 202202L @@ -486,13 +502,16 @@ __cpp_lib_within_lifetime 202306L <type_traits> #if _LIBCPP_STD_VER >= 26 // # define __cpp_lib_associative_heterogeneous_insertion 202306L -# undef __cpp_lib_bind_back -// # define __cpp_lib_bind_back 202306L +// # define __cpp_lib_atomic_min_max 202403L # undef __cpp_lib_bind_front # define __cpp_lib_bind_front 202306L # define __cpp_lib_bitset 202306L +// # define __cpp_lib_constexpr_new 202406L +// # define __cpp_lib_constrained_equality 202403L // # define __cpp_lib_copyable_function 202306L // # define __cpp_lib_debugging 202311L +// # define __cpp_lib_default_template_type_for_algorithm_values 202403L +// # define __cpp_lib_format_path 202403L // # define __cpp_lib_freestanding_algorithm 202311L // # define __cpp_lib_freestanding_array 202311L // # define __cpp_lib_freestanding_cstring 202306L @@ -505,13 +524,22 @@ __cpp_lib_within_lifetime 202306L <type_traits> # define __cpp_lib_fstream_native_handle 202306L # endif // # define __cpp_lib_function_ref 202306L +// # define __cpp_lib_generate_random 202403L // # define __cpp_lib_hazard_pointer 202306L +// # define __cpp_lib_inplace_vector 202406L +// # define __cpp_lib_is_virtual_base_of 202406L +// # define __cpp_lib_is_within_lifetime 202306L // # define __cpp_lib_linalg 202311L +// # define __cpp_lib_optional_range_support 202406L # undef __cpp_lib_out_ptr // # define __cpp_lib_out_ptr 202311L +// # define __cpp_lib_philox_engine 202406L +// # define __cpp_lib_ranges_concat 202403L # define __cpp_lib_ratio 202306L // # define __cpp_lib_rcu 202306L +# define __cpp_lib_reference_wrapper 202403L # define __cpp_lib_saturation_arithmetic 202311L +// # define __cpp_lib_senders 202406L // # define __cpp_lib_smart_ptr_owner_equality 202306L # define __cpp_lib_span_at 202311L # define __cpp_lib_span_initializer_list 202311L @@ -520,9 +548,9 @@ __cpp_lib_within_lifetime 202306L <type_traits> // # define __cpp_lib_text_encoding 202306L # undef __cpp_lib_to_chars // # define __cpp_lib_to_chars 202306L +// # define __cpp_lib_to_string 202306L # undef __cpp_lib_tuple_like // # define __cpp_lib_tuple_like 202311L -// # define __cpp_lib_within_lifetime 202306L #endif // clang-format on diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-04-11-gnu-include-next.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-04-11-gnu-include-next.patch deleted file mode 100644 index 356fc032ea..0000000000 --- a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-04-11-gnu-include-next.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/include/stddef.h b/include/stddef.h -index 470b540..1583e78 100644 ---- a/include/stddef.h -+++ b/include/stddef.h -@@ -26,6 +26,10 @@ Types: - - #include <__config> - -+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -+# pragma GCC system_header -+#endif -+ - // Note: This include is outside of header guards because we sometimes get included multiple times - // with different defines and the underlying <stddef.h> will know how to deal with that. - #include_next <stddef.h> -@@ -33,10 +37,6 @@ Types: - #ifndef _LIBCPP_STDDEF_H - # define _LIBCPP_STDDEF_H - --# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) --# pragma GCC system_header --# endif -- - # ifdef __cplusplus - typedef decltype(nullptr) nullptr_t; - # endif diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-12-undeprecate-macro.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-12-undeprecate-macro.patch deleted file mode 100644 index a0cc732c20..0000000000 --- a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-12-undeprecate-macro.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/include/cerrno b/include/cerrno -index 6171ae3..f129568 100644 ---- a/include/cerrno -+++ b/include/cerrno -@@ -38,17 +38,11 @@ Macros: - # pragma GCC system_header - #endif - --#ifdef ENODATA --# pragma clang deprecated(ENODATA, "ENODATA is deprecated in ISO C++") --#endif --#ifdef ENOSR --# pragma clang deprecated(ENOSR, "ENOSR is deprecated in ISO C++") --#endif --#ifdef ENOSTR --# pragma clang deprecated(ENOSTR, "ENOSTR is deprecated in ISO C++") --#endif --#ifdef ETIME --# pragma clang deprecated(ETIME, "ETIME is deprecated in ISO C++") --#endif -+// LWG3869 Deprecate std::errc constants related to UNIX STREAMS -+// -+// This LWG issue deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were -+// deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542. -+// Based on the post commit feedback the macro are no longer deprecated. -+// Instead libc++ leaves the deprecation to the provider of errno.h. - - #endif // _LIBCPP_CERRNO diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-22-wasm-eptr.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-22-wasm-eptr.patch deleted file mode 100644 index 8d584e0997..0000000000 --- a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-05-22-wasm-eptr.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/include/__exception/exception_ptr.h b/include/__exception/exception_ptr.h -index c9027de..868fd7c 100644 ---- a/include/__exception/exception_ptr.h -+++ b/include/__exception/exception_ptr.h -@@ -38,11 +38,14 @@ struct __cxa_exception; - _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception( - void*, - std::type_info*, -- void( - # if defined(_WIN32) -- __thiscall -+ void(__thiscall*)(void*)) throw(); -+# elif defined(__wasm__) -+ // In Wasm, a destructor returns its argument -+ void* (*)(void*)) throw(); -+# else -+ void (*)(void*)) throw(); - # endif -- *)(void*)) throw(); - } - - } // namespace __cxxabiv1 -@@ -92,8 +95,16 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { - using _Ep2 = __decay_t<_Ep>; - - void* __ex = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ep)); -+# ifdef __wasm__ -+ // In Wasm, a destructor returns its argument -+ (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* { -+# else - (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) { -+# endif - std::__destroy_at(static_cast<_Ep2*>(__p)); -+# ifdef __wasm__ -+ return __p; -+# endif - }); - - try { -diff --git a/include/__locale b/include/__locale -index fab87f0..0c6fe3c 100644 ---- a/include/__locale -+++ b/include/__locale -@@ -343,12 +343,12 @@ public: - static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used - # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT - # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA --#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) -+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - # ifdef __APPLE__ - typedef __uint32_t mask; - # elif defined(__FreeBSD__) - typedef unsigned long mask; --# elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) -+# elif defined(__NetBSD__) - typedef unsigned short mask; - # endif - static const mask space = _CTYPE_S; diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-07-26-atomic_ref.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-07-26-atomic_ref.patch new file mode 100644 index 0000000000..a08f8be83e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-07-26-atomic_ref.patch @@ -0,0 +1,33 @@ +diff --git a/include/__atomic/atomic_ref.h b/include/__atomic/atomic_ref.h +index 156f196..2849b82 100644 +--- a/include/__atomic/atomic_ref.h ++++ b/include/__atomic/atomic_ref.h +@@ -42,6 +42,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD + + #if _LIBCPP_STD_VER >= 20 + ++// These types are required to make __atomic_is_always_lock_free work across GCC and Clang. ++// The purpose of this trick is to make sure that we provide an object with the correct alignment ++// to __atomic_is_always_lock_free, since that answer depends on the alignment. ++template <size_t _Alignment> ++struct __alignment_checker_type { ++ alignas(_Alignment) char __data; ++}; ++ ++template <size_t _Alignment> ++struct __get_aligner_instance { ++ static constexpr __alignment_checker_type<_Alignment> __instance{}; ++}; ++ + template <class _Tp> + struct __atomic_ref_base { + protected: +@@ -105,7 +118,7 @@ public: + // that the pointer is going to be aligned properly at runtime because that is a (checked) precondition + // of atomic_ref's constructor. + static constexpr bool is_always_lock_free = +- __atomic_always_lock_free(sizeof(_Tp), reinterpret_cast<void*>(-required_alignment)); ++ __atomic_always_lock_free(sizeof(_Tp), &__get_aligner_instance<required_alignment>::__instance); + + _LIBCPP_HIDE_FROM_ABI bool is_lock_free() const noexcept { return __atomic_is_lock_free(sizeof(_Tp), __ptr_); } + diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-03-datasizeof.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-03-datasizeof.patch new file mode 100644 index 0000000000..ba6d2a9e17 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-03-datasizeof.patch @@ -0,0 +1,43 @@ +diff --git a/include/__type_traits/datasizeof.h b/include/__type_traits/datasizeof.h +index 35c1292..b4cbd1d 100644 +--- a/include/__type_traits/datasizeof.h ++++ b/include/__type_traits/datasizeof.h +@@ -26,34 +26,22 @@ + + _LIBCPP_BEGIN_NAMESPACE_STD + +-#if __has_keyword(__datasizeof) || __has_extension(datasizeof) ++// TODO: Enable this again once #94816 is fixed. ++#if (__has_keyword(__datasizeof) || __has_extension(datasizeof)) && 0 + template <class _Tp> + inline const size_t __datasizeof_v = __datasizeof(_Tp); + #else +-// NOLINTNEXTLINE(readability-redundant-preprocessor) This is https://llvm.org/PR64825 +-# if __has_cpp_attribute(__no_unique_address__) + template <class _Tp> + struct _FirstPaddingByte { +- [[__no_unique_address__]] _Tp __v_; ++ _LIBCPP_NO_UNIQUE_ADDRESS _Tp __v_; + char __first_padding_byte_; + }; +-# else +-template <class _Tp, bool = __libcpp_is_final<_Tp>::value || !is_class<_Tp>::value> +-struct _FirstPaddingByte : _Tp { +- char __first_padding_byte_; +-}; +- +-template <class _Tp> +-struct _FirstPaddingByte<_Tp, true> { +- _Tp __v_; +- char __first_padding_byte_; +-}; +-# endif // __has_cpp_attribute(__no_unique_address__) + + // _FirstPaddingByte<> is sometimes non-standard layout. Using `offsetof` is UB in that case, but GCC and Clang allow + // the use as an extension. + _LIBCPP_DIAGNOSTIC_PUSH + _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-offsetof") ++_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Winvalid-offsetof") + template <class _Tp> + inline const size_t __datasizeof_v = offsetof(_FirstPaddingByte<_Tp>, __first_padding_byte_); + _LIBCPP_DIAGNOSTIC_POP diff --git a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch index 825a61722e..e5da115d7a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch @@ -1,8 +1,8 @@ diff --git a/include/__filesystem/directory_entry.h b/include/__filesystem/directory_entry.h -index 016ad94..90e44f5 100644 +index 96d88dc..c40b5d7 100644 --- a/include/__filesystem/directory_entry.h +++ b/include/__filesystem/directory_entry.h -@@ -202,7 +202,9 @@ private: +@@ -201,7 +201,9 @@ private: _IterNonSymlink, _RefreshSymlink, _RefreshSymlinkUnresolved, @@ -13,7 +13,7 @@ index 016ad94..90e44f5 100644 }; struct __cached_data { -@@ -241,6 +243,29 @@ private: +@@ -240,6 +242,29 @@ private: return __data; } @@ -43,7 +43,7 @@ index 016ad94..90e44f5 100644 _LIBCPP_HIDE_FROM_ABI void __assign_iter_entry(_Path&& __p, __cached_data __dt) { __p_ = std::move(__p); __data_ = __dt; -@@ -282,13 +307,15 @@ private: +@@ -281,13 +306,15 @@ private: case _Empty: return __symlink_status(__p_, __ec).type(); case _IterSymlink: @@ -60,7 +60,7 @@ index 016ad94..90e44f5 100644 file_status __st(__data_.__type_); if (__ec && !filesystem::exists(__st)) *__ec = make_error_code(errc::no_such_file_or_directory); -@@ -296,6 +323,7 @@ private: +@@ -295,6 +322,7 @@ private: __ec->clear(); return __data_.__type_; } @@ -68,7 +68,7 @@ index 016ad94..90e44f5 100644 __libcpp_unreachable(); } -@@ -303,8 +331,10 @@ private: +@@ -302,8 +330,10 @@ private: switch (__data_.__cache_type_) { case _Empty: case _IterSymlink: @@ -79,7 +79,7 @@ index 016ad94..90e44f5 100644 case _IterNonSymlink: case _RefreshNonSymlink: case _RefreshSymlink: { -@@ -324,8 +354,10 @@ private: +@@ -323,8 +353,10 @@ private: case _Empty: case _IterNonSymlink: case _IterSymlink: @@ -90,7 +90,7 @@ index 016ad94..90e44f5 100644 case _RefreshNonSymlink: case _RefreshSymlink: return file_status(__get_ft(__ec), __data_.__non_sym_perms_); -@@ -339,8 +371,10 @@ private: +@@ -338,8 +370,10 @@ private: case _IterNonSymlink: case _IterSymlink: return __symlink_status(__p_, __ec); @@ -101,7 +101,7 @@ index 016ad94..90e44f5 100644 case _RefreshSymlink: case _RefreshSymlinkUnresolved: return file_status(__get_sym_ft(__ec), __data_.__sym_perms_); -@@ -353,8 +387,10 @@ private: +@@ -352,8 +386,10 @@ private: case _Empty: case _IterNonSymlink: case _IterSymlink: @@ -112,7 +112,7 @@ index 016ad94..90e44f5 100644 case _RefreshSymlink: case _RefreshNonSymlink: { error_code __m_ec; -@@ -375,6 +411,8 @@ private: +@@ -374,6 +410,8 @@ private: case _Empty: case _IterNonSymlink: case _IterSymlink: @@ -121,7 +121,7 @@ index 016ad94..90e44f5 100644 case _RefreshSymlinkUnresolved: return filesystem::__hard_link_count(__p_, __ec); case _RefreshSymlink: -@@ -393,8 +431,10 @@ private: +@@ -392,8 +430,10 @@ private: case _Empty: case _IterNonSymlink: case _IterSymlink: diff --git a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch index e8e885f238..2de61b54c8 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch @@ -1,23 +1,23 @@ -diff --git a/include/__config b/include/__config -index 8550b1d..d32ad24 100644 ---- a/include/__config -+++ b/include/__config -@@ -138,7 +138,12 @@ +diff --git a/include/__configuration/abi.h b/include/__configuration/abi.h +index 513da6e..c31fbba 100644 +--- a/include/__configuration/abi.h ++++ b/include/__configuration/abi.h +@@ -47,7 +47,12 @@ // Previously libc++ used "unsigned int" exclusively. - # define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION + # define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION // Unstable attempt to provide a more optimized std::function --# define _LIBCPP_ABI_OPTIMIZED_FUNCTION -+# ifdef __EMSCRIPTEN__ +-# define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# ifdef __EMSCRIPTEN__ +// XXX EMSCRIPTEN https://github.com/emscripten-core/emscripten/issues/11022 -+// # define _LIBCPP_ABI_OPTIMIZED_FUNCTION -+# else -+# define _LIBCPP_ABI_OPTIMIZED_FUNCTION -+# endif ++// # define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# else ++# define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# endif // All the regex constants must be distinct and nonzero. - # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO + # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO // Re-worked external template instantiations for std::string with a focus on diff --git a/include/typeinfo b/include/typeinfo -index 1ae075e..3a1981a 100644 +index d1c0de3..8b75ced 100644 --- a/include/typeinfo +++ b/include/typeinfo @@ -96,7 +96,13 @@ public: @@ -36,7 +36,7 @@ index 1ae075e..3a1981a 100644 // from different translation units, so it is sufficient to compare their addresses. if (__libcpp_is_constant_evaluated()) { diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp -index 62bb248..fa31f05 100644 +index a83c1ae..fd770e1 100644 --- a/src/filesystem/operations.cpp +++ b/src/filesystem/operations.cpp @@ -37,7 +37,7 @@ diff --git a/contrib/libs/cxxsupp/libcxx/patches/05-compiler-msvc.patch b/contrib/libs/cxxsupp/libcxx/patches/05-compiler-msvc.patch index ac64152687..7fd238b6e0 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/05-compiler-msvc.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/05-compiler-msvc.patch @@ -1,5 +1,5 @@ diff --git a/include/__functional/bind.h b/include/__functional/bind.h -index 8a0e3b7..1fded44 100644 +index b4f4644..3996460 100644 --- a/include/__functional/bind.h +++ b/include/__functional/bind.h @@ -231,6 +231,10 @@ public: diff --git a/contrib/libs/cxxsupp/libcxx/patches/09-clang-cl-abi.patch b/contrib/libs/cxxsupp/libcxx/patches/09-clang-cl-abi.patch index c5e9c5b42c..bc70dbad33 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/09-clang-cl-abi.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/09-clang-cl-abi.patch @@ -1,8 +1,8 @@ diff --git a/include/locale b/include/locale -index e3c63e3..13b911c 100644 +index 19e81e1..0b2ac48 100644 --- a/include/locale +++ b/include/locale -@@ -2168,7 +2168,11 @@ public: +@@ -2189,7 +2189,11 @@ public: : time_put<_CharT, _OutputIterator>(__nm, __refs) {} protected: diff --git a/contrib/libs/cxxsupp/libcxx/patches/14-has-no-threads.patch b/contrib/libs/cxxsupp/libcxx/patches/14-has-no-threads.patch index dc62fc1f4b..a3a9532a12 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/14-has-no-threads.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/14-has-no-threads.patch @@ -1,5 +1,5 @@ diff --git a/include/__memory/shared_ptr.h b/include/__memory/shared_ptr.h -index a8ff189..fa25116 100644 +index d487e4f..146b205 100644 --- a/include/__memory/shared_ptr.h +++ b/include/__memory/shared_ptr.h @@ -53,7 +53,7 @@ diff --git a/contrib/libs/cxxsupp/libcxx/patches/15-unique-ptr.patch b/contrib/libs/cxxsupp/libcxx/patches/15-unique-ptr.patch index 796974ba24..c7ef8f3514 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/15-unique-ptr.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/15-unique-ptr.patch @@ -1,5 +1,5 @@ diff --git a/include/__memory/unique_ptr.h b/include/__memory/unique_ptr.h -index 46d9405..ff747e3 100644 +index 9519e42..8dd000b 100644 --- a/include/__memory/unique_ptr.h +++ b/include/__memory/unique_ptr.h @@ -40,6 +40,7 @@ diff --git a/contrib/libs/cxxsupp/libcxx/patches/22__config.patch b/contrib/libs/cxxsupp/libcxx/patches/22__config.patch index ce7c96782e..ba17919a98 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/22__config.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/22__config.patch @@ -1,44 +1,8 @@ diff --git a/include/__config b/include/__config -index d32ad24..1bb99ee 100644 +index dfb14fd..56705ec 100644 --- a/include/__config +++ b/include/__config -@@ -39,13 +39,25 @@ - # define _LIBCPP_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__) - #endif - -+// Move outside #ifdef __cplusplus because this needs to work in both C and C++ headers. -+#if defined(__apple_build_version__) -+# define _LIBCPP_COMPILER_CLANG_BASED -+# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000) -+#elif defined(__clang__) -+# define _LIBCPP_COMPILER_CLANG -+# define _LIBCPP_COMPILER_CLANG_BASED -+# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) -+#elif defined(__GNUC__) -+# define _LIBCPP_COMPILER_GCC -+#endif -+ - #ifdef __cplusplus - - // Warn if a compiler version is used that is not supported anymore - // LLVM RELEASE Update the minimum compiler versions - # if defined(_LIBCPP_CLANG_VER) - # if _LIBCPP_CLANG_VER < 1600 --# warning "Libc++ only supports Clang 16 and later" -+// we temporary allow old clang-s # warning "Libc++ only supports Clang 16 and later" - # endif - # elif defined(_LIBCPP_APPLE_CLANG_VER) - # if _LIBCPP_APPLE_CLANG_VER < 1500 -@@ -94,7 +106,7 @@ - # define _LIBCPP_OBJECT_FORMAT_ELF 1 - # elif defined(__MACH__) - # define _LIBCPP_OBJECT_FORMAT_MACHO 1 --# elif defined(_WIN32) -+# elif defined(_WIN32) || defined(__CYGWIN__) - # define _LIBCPP_OBJECT_FORMAT_COFF 1 - # elif defined(__wasm__) - # define _LIBCPP_OBJECT_FORMAT_WASM 1 -@@ -819,7 +831,7 @@ typedef __char32_t char32_t; +@@ -563,7 +563,7 @@ typedef __char32_t char32_t; // TODO: We provide a escape hatch with _LIBCPP_NO_ABI_TAG for folks who want to avoid increasing // the length of symbols with an ABI tag. In practice, we should remove the escape hatch and // use compression mangling instead, see https://github.com/itanium-cxx-abi/cxx-abi/issues/70. @@ -46,8 +10,8 @@ index d32ad24..1bb99ee 100644 +# if !defined(_LIBCPP_NO_ABI_TAG) && !defined(__CUDACC__) # define _LIBCPP_HIDE_FROM_ABI \ _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \ - __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))) -@@ -1101,7 +1113,8 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c + __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))) +@@ -841,7 +841,8 @@ typedef __char32_t char32_t; defined(__APPLE__) || \ defined(__MVS__) || \ defined(_AIX) || \ @@ -57,39 +21,30 @@ index d32ad24..1bb99ee 100644 // clang-format on # define _LIBCPP_HAS_THREAD_API_PTHREAD # elif defined(__Fuchsia__) -@@ -1267,6 +1280,10 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c - # define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS - # endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES - -+// Yandex-specific: We build our own libc++, so it has everything available -+# define _LIBCPP_DISABLE_AVAILABILITY -+// End of Yandex-specific -+ - // clang-format off - # define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh\")") _Pragma("push_macro(\"move\")") _Pragma("push_macro(\"erase\")") - # define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh\")") _Pragma("pop_macro(\"move\")") _Pragma("pop_macro(\"erase\")") -@@ -1452,6 +1469,11 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c - # define _LIBCPP_NO_DESTROY - # endif - -+# if !__has_builtin(__builtin_is_constant_evaluated) || (defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER < 900) || \ -+ __CUDACC_VER_MAJOR__ == 10 -+# define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED -+# endif -+ - # if __has_attribute(__diagnose_if__) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS) - # define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((__diagnose_if__(__VA_ARGS__, "warning"))) - # else -@@ -1473,6 +1495,12 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c - # define _LIBCPP_LIFETIMEBOUND - # endif - -+# if defined(_LIBCPP_COMPILER_CLANG_BASED) -+# define _LIBCPP_REINITIALIZES_OBJECT [[clang::reinitializes]] -+# else -+# define _LIBCPP_REINITIALIZES_OBJECT -+# endif -+ - # if __has_attribute(__nodebug__) - # define _LIBCPP_NODEBUG __attribute__((__nodebug__)) - # else +diff --git a/include/__configuration/compiler.h b/include/__configuration/compiler.h +index 80ece22..d34361b 100644 +--- a/include/__configuration/compiler.h ++++ b/include/__configuration/compiler.h +@@ -34,7 +34,8 @@ + // LLVM RELEASE Update the minimum compiler versions + # if defined(_LIBCPP_CLANG_VER) + # if _LIBCPP_CLANG_VER < 1700 +-# warning "Libc++ only supports Clang 17 and later" ++// We allow clang 14 and newer ++// # warning "Libc++ only supports Clang 17 and later" + # endif + # elif defined(_LIBCPP_APPLE_CLANG_VER) + # if _LIBCPP_APPLE_CLANG_VER < 1500 +diff --git a/include/__configuration/platform.h b/include/__configuration/platform.h +index 27f68d0..6d5b951 100644 +--- a/include/__configuration/platform.h ++++ b/include/__configuration/platform.h +@@ -20,7 +20,7 @@ + # define _LIBCPP_OBJECT_FORMAT_ELF 1 + #elif defined(__MACH__) + # define _LIBCPP_OBJECT_FORMAT_MACHO 1 +-#elif defined(_WIN32) ++#elif defined(_WIN32) || defined(__CYGWIN__) + # define _LIBCPP_OBJECT_FORMAT_COFF 1 + #elif defined(__wasm__) + # define _LIBCPP_OBJECT_FORMAT_WASM 1 diff --git a/contrib/libs/cxxsupp/libcxx/patches/23__locale.patch b/contrib/libs/cxxsupp/libcxx/patches/23__locale.patch index 3ecb6b53ec..59b8e0cdf8 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/23__locale.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/23__locale.patch @@ -1,16 +1,16 @@ diff --git a/include/__locale b/include/__locale -index 0c6fe3c..6692046 100644 +index 4b38276..8784b24 100644 --- a/include/__locale +++ b/include/__locale -@@ -16,6 +16,7 @@ - #include <__mutex/once_flag.h> +@@ -17,6 +17,7 @@ #include <__type_traits/make_unsigned.h> #include <__utility/no_destroy.h> + #include <__utility/private_constructor_tag.h> +#include <atomic> #include <cctype> #include <clocale> #include <cstdint> -@@ -125,8 +126,7 @@ private: +@@ -128,8 +129,7 @@ private: }; class _LIBCPP_EXPORTED_FROM_ABI locale::id { diff --git a/contrib/libs/cxxsupp/libcxx/patches/25__tuple.patch b/contrib/libs/cxxsupp/libcxx/patches/25__tuple.patch index acf8cc0ba9..627c70c2c5 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/25__tuple.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/25__tuple.patch @@ -1,5 +1,5 @@ diff --git a/include/__tuple/sfinae_helpers.h b/include/__tuple/sfinae_helpers.h -index 35a57ff..dfd00f5 100644 +index c7145e0..7db5eeb 100644 --- a/include/__tuple/sfinae_helpers.h +++ b/include/__tuple/sfinae_helpers.h @@ -41,7 +41,7 @@ struct __tuple_sfinae_base { diff --git a/contrib/libs/cxxsupp/libcxx/patches/28-cudacc.patch b/contrib/libs/cxxsupp/libcxx/patches/28-cudacc.patch index 2ffbb5ec8e..e67b8cac5a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/28-cudacc.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/28-cudacc.patch @@ -1,18 +1,18 @@ diff --git a/include/__algorithm/simd_utils.h b/include/__algorithm/simd_utils.h -index 989a195..c2fc02e 100644 +index 549197b..c0d04c4 100644 --- a/include/__algorithm/simd_utils.h +++ b/include/__algorithm/simd_utils.h -@@ -27,7 +27,7 @@ _LIBCPP_PUSH_MACROS +@@ -28,7 +28,7 @@ _LIBCPP_PUSH_MACROS #include <__undef_macros> // TODO: Find out how altivec changes things and allow vectorizations there too. --#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) -+#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) && !defined(__CUDACC__) +-#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__) ++#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__) && !defined(__CUDACC__) # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1 #else # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0 diff --git a/include/__iterator/reverse_iterator.h b/include/__iterator/reverse_iterator.h -index 2ae1461..3fb2a42 100644 +index 50c0f21..a2e3528 100644 --- a/include/__iterator/reverse_iterator.h +++ b/include/__iterator/reverse_iterator.h @@ -132,7 +132,7 @@ public: @@ -40,32 +40,32 @@ index f3cd1e5..c0a77ef 100644 template <class _Iterator> using __is_segmented_iterator = __has_specialization<__segmented_iterator_traits<_Iterator> >; diff --git a/include/__math/traits.h b/include/__math/traits.h -index da585af..b271b8f 100644 +index a448266..9fdf409 100644 --- a/include/__math/traits.h +++ b/include/__math/traits.h -@@ -67,7 +67,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i +@@ -67,7 +67,7 @@ _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf return false; } -#ifdef _LIBCPP_PREFERRED_OVERLOAD +#ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) - _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { + _LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { return __builtin_isinf(__x); } -@@ -94,7 +94,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i +@@ -94,7 +94,7 @@ _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan return false; } -#ifdef _LIBCPP_PREFERRED_OVERLOAD +#ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) - _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { + _LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { return __builtin_isnan(__x); } diff --git a/include/complex b/include/complex -index a81f968..1e4d99d 100644 +index 22271ac..bfe61c5 100644 --- a/include/complex +++ b/include/complex -@@ -1513,6 +1513,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex<double> operator""i(unsigned long +@@ -1453,6 +1453,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex<double> operator""i(unsigned long return {0.0, static_cast<double>(__im)}; } @@ -73,7 +73,7 @@ index a81f968..1e4d99d 100644 _LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(long double __im) { return {0.0f, static_cast<float>(__im)}; } -@@ -1520,6 +1521,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(long double _ +@@ -1460,6 +1461,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(long double _ _LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(unsigned long long __im) { return {0.0f, static_cast<float>(__im)}; } @@ -82,10 +82,10 @@ index a81f968..1e4d99d 100644 } // namespace literals #endif diff --git a/include/tuple b/include/tuple -index c7fc550..ed7d912 100644 +index 26652ff..9caeaaf 100644 --- a/include/tuple +++ b/include/tuple -@@ -297,7 +297,7 @@ class __tuple_leaf { +@@ -296,7 +296,7 @@ class __tuple_leaf { template <class _Tp> static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { @@ -94,7 +94,7 @@ index c7fc550..ed7d912 100644 return !__reference_binds_to_temporary(_Hp, _Tp); # else return true; -@@ -599,8 +599,16 @@ public: +@@ -603,8 +603,16 @@ public: is_constructible<_Tp, _Up>... > {}; template <class... _Up, @@ -111,5 +111,5 @@ index c7fc550..ed7d912 100644 + >::value, + int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value) - tuple(_Up&&... __u) _NOEXCEPT_(_And<is_nothrow_constructible<_Tp, _Up>...>::value) + tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value) : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(), diff --git a/contrib/libs/cxxsupp/libcxx/patches/33__split_buffer.patch b/contrib/libs/cxxsupp/libcxx/patches/33__split_buffer.patch index c5c6389e2c..e0c097402e 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/33__split_buffer.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/33__split_buffer.patch @@ -1,8 +1,8 @@ diff --git a/include/__split_buffer b/include/__split_buffer -index c68349e..b638cb0 100644 +index bab724d..2725b7d 100644 --- a/include/__split_buffer +++ b/include/__split_buffer -@@ -153,7 +153,7 @@ public: +@@ -164,7 +164,7 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(__begin_ + 1); } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(__end_ - 1); } @@ -11,7 +11,7 @@ index c68349e..b638cb0 100644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x); -@@ -236,6 +236,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __split_buffer<_Tp, _Allocator>::__invariants +@@ -247,6 +247,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __split_buffer<_Tp, _Allocator>::__invariants return true; } diff --git a/contrib/libs/cxxsupp/libcxx/patches/35-set-map.patch b/contrib/libs/cxxsupp/libcxx/patches/35-set-map.patch index 102f470314..1373447a0a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/35-set-map.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/35-set-map.patch @@ -1,8 +1,8 @@ diff --git a/include/map b/include/map -index 5b6ec9d..3025557 100644 +index 02bd17c..3fabcef 100644 --- a/include/map +++ b/include/map -@@ -1315,6 +1315,7 @@ public: +@@ -1310,6 +1310,7 @@ public: _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f.__i_, __l.__i_); } @@ -10,19 +10,19 @@ index 5b6ec9d..3025557 100644 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); } #if _LIBCPP_STD_VER >= 17 -@@ -1950,6 +1951,7 @@ public: +@@ -1936,6 +1937,7 @@ public: } #endif + _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); } - _LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { diff --git a/include/set b/include/set -index e2e87e4..90a22c6 100644 +index 9453358..f2d2b05 100644 --- a/include/set +++ b/include/set -@@ -768,6 +768,7 @@ public: +@@ -765,6 +765,7 @@ public: _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); } _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); } _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); } @@ -30,7 +30,7 @@ index e2e87e4..90a22c6 100644 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); } #if _LIBCPP_STD_VER >= 17 -@@ -1226,6 +1227,7 @@ public: +@@ -1220,6 +1221,7 @@ public: _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); } _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); } _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); } diff --git a/contrib/libs/cxxsupp/libcxx/patches/36-math.patch b/contrib/libs/cxxsupp/libcxx/patches/36-math.patch index 5226a507e1..1cc6ad277b 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/36-math.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/36-math.patch @@ -1,27 +1,5 @@ -diff --git a/include/__math/rounding_functions.h b/include/__math/rounding_functions.h -index 29e42fd..7943b6f 100644 ---- a/include/__math/rounding_functions.h -+++ b/include/__math/rounding_functions.h -@@ -204,7 +204,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEP - - // round - --_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); } -+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); } - - template <class = int> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { -@@ -222,7 +222,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCE - - // trunc - --_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_trunc(__x); } -+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); } - - template <class = int> - _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { diff --git a/include/math.h b/include/math.h -index 0598973..376bbf7 100644 +index 4e6304a..4d245d4 100644 --- a/include/math.h +++ b/include/math.h @@ -290,6 +290,9 @@ float truncf(float x); diff --git a/contrib/libs/cxxsupp/libcxx/patches/38-complex.patch b/contrib/libs/cxxsupp/libcxx/patches/38-complex.patch index c3cfdf28cc..6856a5f4b2 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/38-complex.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/38-complex.patch @@ -1,8 +1,8 @@ diff --git a/include/complex b/include/complex -index 1e4d99d..5f09e3e 100644 +index bfe61c5..91cf3f4 100644 --- a/include/complex +++ b/include/complex -@@ -1342,7 +1342,8 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) { +@@ -1282,7 +1282,8 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) { } if (std::__constexpr_isinf(__x.imag())) return complex<_Tp>(__pi / _Tp(2), -__x.imag()); diff --git a/contrib/libs/cxxsupp/libcxx/patches/39-optional.patch b/contrib/libs/cxxsupp/libcxx/patches/39-optional.patch index 63be005780..9428edf28d 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/39-optional.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/39-optional.patch @@ -1,5 +1,5 @@ diff --git a/include/optional b/include/optional -index a16e485..e6ff853 100644 +index e550745..992189b 100644 --- a/include/optional +++ b/include/optional @@ -288,7 +288,7 @@ struct __optional_destruct_base<_Tp, false> { diff --git a/contrib/libs/cxxsupp/libcxx/patches/40-deque.patch b/contrib/libs/cxxsupp/libcxx/patches/40-deque.patch index 7bb15cde2f..a4c0fd5d53 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/40-deque.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/40-deque.patch @@ -1,8 +1,8 @@ diff --git a/include/deque b/include/deque -index a6472e4..154926d 100644 +index 4fc994a..fc0e1ad 100644 --- a/include/deque +++ b/include/deque -@@ -247,7 +247,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD +@@ -248,7 +248,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _ValueType, class _DiffType> struct __deque_block_size { @@ -13,16 +13,16 @@ index a6472e4..154926d 100644 }; template <class _ValueType, -@@ -796,7 +798,7 @@ public: +@@ -804,7 +806,7 @@ public: #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); + _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>); #endif - _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; + _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI bool __invariants() const { if (!__map_.__invariants()) -@@ -2492,7 +2494,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c) +@@ -2471,7 +2473,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c) } template <class _Tp, class _Allocator> diff --git a/contrib/libs/cxxsupp/libcxx/patches/41-exception.patch b/contrib/libs/cxxsupp/libcxx/patches/41-exception.patch index 253914de18..22a1fb8a4c 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/41-exception.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/41-exception.patch @@ -1,8 +1,8 @@ diff --git a/include/__exception/exception_ptr.h b/include/__exception/exception_ptr.h -index 868fd7c..bcc8768 100644 +index beadd92..d23450f 100644 --- a/include/__exception/exception_ptr.h +++ b/include/__exception/exception_ptr.h -@@ -56,8 +56,6 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception( +@@ -55,8 +55,6 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception( namespace std { // purposefully not using versioning namespace @@ -11,7 +11,7 @@ index 868fd7c..bcc8768 100644 class _LIBCPP_EXPORTED_FROM_ABI exception_ptr { void* __ptr_; -@@ -84,10 +82,18 @@ public: +@@ -86,10 +84,18 @@ public: return !(__x == __y); } @@ -30,7 +30,7 @@ index 868fd7c..bcc8768 100644 template <class _Ep> _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { # ifndef _LIBCPP_HAS_NO_EXCEPTIONS -@@ -129,34 +135,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { +@@ -132,34 +138,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { #else // _LIBCPP_ABI_MICROSOFT @@ -66,7 +66,7 @@ index 868fd7c..bcc8768 100644 // This is a built-in template function which automagically extracts the required // information. -@@ -164,7 +143,7 @@ template <class _E> +@@ -167,7 +146,7 @@ template <class _E> void* __GetExceptionInfo(_E); template <class _Ep> diff --git a/contrib/libs/cxxsupp/libcxx/patches/43-string.patch b/contrib/libs/cxxsupp/libcxx/patches/43-string.patch index d07cab1c86..7302481ce6 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/43-string.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/43-string.patch @@ -1,5 +1,5 @@ diff --git a/include/string b/include/string -index a456f8c..804373b 100644 +index 9a52ab6..da86723 100644 --- a/include/string +++ b/include/string @@ -83,6 +83,7 @@ template <> struct char_traits<char32_t>; @@ -10,7 +10,7 @@ index a456f8c..804373b 100644 public: // types: typedef traits traits_type; -@@ -981,9 +982,10 @@ public: +@@ -997,9 +998,10 @@ public: __init(__s, traits_type::length(__s)); } @@ -22,7 +22,7 @@ index a456f8c..804373b 100644 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) : __r_(__default_init_tag(), __default_init_tag()) { -@@ -991,6 +993,8 @@ public: +@@ -1007,6 +1009,8 @@ public: __init(__s, __n); } @@ -31,7 +31,7 @@ index a456f8c..804373b 100644 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n, const _Allocator& __a) : __r_(__default_init_tag(), __a) { -@@ -1155,7 +1159,7 @@ public: +@@ -1171,7 +1175,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const value_type* __s) { return assign(__s); } @@ -40,7 +40,7 @@ index a456f8c..804373b 100644 basic_string& operator=(nullptr_t) = delete; #endif _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c); -@@ -1212,6 +1216,10 @@ public: +@@ -1228,6 +1232,10 @@ public: return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1; } @@ -51,7 +51,7 @@ index a456f8c..804373b 100644 _LIBCPP_CONSTEXPR_SINCE_CXX20 void resize(size_type __n, value_type __c); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void resize(size_type __n) { resize(__n, value_type()); } -@@ -1759,7 +1767,7 @@ public: +@@ -1775,7 +1783,7 @@ public: } #endif diff --git a/contrib/libs/cxxsupp/libcxx/patches/45-type-traits.patch b/contrib/libs/cxxsupp/libcxx/patches/45-type-traits.patch index 72fc90a682..3a28d36a24 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/45-type-traits.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/45-type-traits.patch @@ -130,10 +130,19 @@ index 9561b7b..5013724 100644 _LIBCPP_END_NAMESPACE_STD diff --git a/include/__type_traits/remove_cv.h b/include/__type_traits/remove_cv.h -index 8e1c043..639a9c4 100644 +index 2c4e9e4..639a9c4 100644 --- a/include/__type_traits/remove_cv.h +++ b/include/__type_traits/remove_cv.h -@@ -21,10 +21,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD +@@ -10,6 +10,8 @@ + #define _LIBCPP___TYPE_TRAITS_REMOVE_CV_H + + #include <__config> ++#include <__type_traits/remove_const.h> ++#include <__type_traits/remove_volatile.h> + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + # pragma GCC system_header +@@ -19,10 +21,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> struct remove_cv { diff --git a/contrib/libs/cxxsupp/libcxx/patches/46-typeinfo-variant-valarray.patch b/contrib/libs/cxxsupp/libcxx/patches/46-typeinfo-variant-valarray.patch index 3e1e4bb7f5..319af1ea80 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/46-typeinfo-variant-valarray.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/46-typeinfo-variant-valarray.patch @@ -1,8 +1,8 @@ diff --git a/include/typeinfo b/include/typeinfo -index 3a1981a..bc8969a 100644 +index 8b75ced..266ae95 100644 --- a/include/typeinfo +++ b/include/typeinfo -@@ -320,24 +320,40 @@ public: +@@ -332,24 +332,40 @@ public: class _LIBCPP_EXPORTED_FROM_ABI bad_cast : public exception { public: diff --git a/contrib/libs/cxxsupp/libcxx/patches/47-vector.patch b/contrib/libs/cxxsupp/libcxx/patches/47-vector.patch index 2ad873fe04..e64f2e555e 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/47-vector.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/47-vector.patch @@ -1,5 +1,5 @@ diff --git a/include/vector b/include/vector -index 1defc43..8d5b846 100644 +index aaf51d1..0125901 100644 --- a/include/vector +++ b/include/vector @@ -348,6 +348,7 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++ @@ -10,7 +10,7 @@ index 1defc43..8d5b846 100644 #include <__type_traits/noexcept_move_assign_container.h> #include <__type_traits/type_identity.h> #include <__utility/exception_guard.h> -@@ -705,12 +706,22 @@ public: +@@ -736,12 +737,22 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last); @@ -34,7 +34,7 @@ index 1defc43..8d5b846 100644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void resize(size_type __sz); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void resize(size_type __sz, const_reference __x); -@@ -793,7 +804,7 @@ private: +@@ -824,7 +835,7 @@ private: template <class _InputIterator, class _Sentinel> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n); @@ -43,7 +43,7 @@ index 1defc43..8d5b846 100644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const_reference __x); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator __make_iter(pointer __p) _NOEXCEPT { -@@ -1100,6 +1111,19 @@ vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __ +@@ -1123,6 +1134,19 @@ vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __ __tx.__pos_ = std::__uninitialized_allocator_copy(__alloc(), __first, __last, __tx.__pos_); } @@ -63,7 +63,7 @@ index 1defc43..8d5b846 100644 // Default constructs __n objects starting at __end_ // throws if construction throws // Postcondition: size() == size() + __n -@@ -1778,6 +1802,25 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __s +@@ -1768,6 +1792,25 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __s this->__destruct_at_end(this->__begin_ + __sz); } @@ -89,7 +89,7 @@ index 1defc43..8d5b846 100644 template <class _Tp, class _Allocator> _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::swap(vector& __x) #if _LIBCPP_STD_VER >= 14 -@@ -1813,6 +1856,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool vector<_Tp, _Allocator>::__invariants() const +@@ -1803,6 +1846,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool vector<_Tp, _Allocator>::__invariants() const return true; } @@ -97,7 +97,7 @@ index 1defc43..8d5b846 100644 // vector<bool> template <class _Allocator> -@@ -2118,7 +2162,9 @@ public: +@@ -2108,7 +2152,9 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __position); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last); @@ -108,7 +108,7 @@ index 1defc43..8d5b846 100644 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&) #if _LIBCPP_STD_VER >= 14 -@@ -2872,6 +2918,30 @@ struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> > +@@ -2862,6 +2908,30 @@ struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> > return __vec.__hash_code(); } }; diff --git a/contrib/libs/cxxsupp/libcxx/patches/49-string-view.patch b/contrib/libs/cxxsupp/libcxx/patches/49-string-view.patch index ebb4fbabbc..65709d261a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/49-string-view.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/49-string-view.patch @@ -1,5 +1,5 @@ diff --git a/include/string_view b/include/string_view -index e8584a6..4df4f02 100644 +index b2a4db4..058ca72 100644 --- a/include/string_view +++ b/include/string_view @@ -306,6 +306,8 @@ public: @@ -20,7 +20,7 @@ index e8584a6..4df4f02 100644 basic_string_view(nullptr_t) = delete; #endif -@@ -666,7 +668,7 @@ public: +@@ -664,7 +666,7 @@ public: } #endif diff --git a/contrib/libs/cxxsupp/libcxx/patches/56-iostream.patch b/contrib/libs/cxxsupp/libcxx/patches/56-iostream.patch index 30b9a04852..3b13198871 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/56-iostream.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/56-iostream.patch @@ -1,13 +1,13 @@ -diff --git a/include/ostream b/include/ostream -index 42819ce..51778a2 100644 ---- a/include/ostream -+++ b/include/ostream -@@ -964,7 +964,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) { +diff --git a/include/__ostream/basic_ostream.h b/include/__ostream/basic_ostream.h +index 178359d..4f7e9cf 100644 +--- a/include/__ostream/basic_ostream.h ++++ b/include/__ostream/basic_ostream.h +@@ -797,7 +797,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) { std::use_facet<ctype<_CharT> >(__os.getloc()).widen('1')); } -#if _LIBCPP_STD_VER >= 20 -+#if 0 ++#if 0 && _LIBCPP_STD_VER >= 20 # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class _Traits> diff --git a/contrib/libs/cxxsupp/libcxx/patches/57-locale.patch b/contrib/libs/cxxsupp/libcxx/patches/57-locale.patch index 4b3a2e4827..e2858978c1 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/57-locale.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/57-locale.patch @@ -1,5 +1,5 @@ diff --git a/src/locale.cpp b/src/locale.cpp -index 7fdd5be..1b937dc 100644 +index 4efdc63..219575b 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -38,8 +38,8 @@ diff --git a/contrib/libs/cxxsupp/libcxx/patches/60-chrono.patch b/contrib/libs/cxxsupp/libcxx/patches/60-chrono.patch deleted file mode 100644 index b959cf3b31..0000000000 --- a/contrib/libs/cxxsupp/libcxx/patches/60-chrono.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/chrono b/include/chrono -index 5bab3f8..956badd 100644 ---- a/include/chrono -+++ b/include/chrono -@@ -853,7 +853,7 @@ constexpr chrono::year operator ""y(unsigned lo - // [time.syn] - #include <compare> - --#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && _LIBCPP_STD_VER >= 20 -+#if 0 - # include <__chrono/formatter.h> - # include <__chrono/ostream.h> - # include <__chrono/parser_std_format_spec.h> diff --git a/contrib/libs/cxxsupp/libcxx/patches/61-remove-includes.sh b/contrib/libs/cxxsupp/libcxx/patches/61-remove-includes.sh index 3c9bbc3d6e..e14a07c627 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/61-remove-includes.sh +++ b/contrib/libs/cxxsupp/libcxx/patches/61-remove-includes.sh @@ -1,6 +1,5 @@ -sed -i 's/#\( *\)include <__pstl_algorithm>/#error #\1include <__pstl_algorithm>/' include/algorithm -sed -i 's/#\( *\)include <__pstl_execution>/#error #\1include <__pstl_execution>/' include/execution sed -i 's/#\( *\)include <__external_threading>/#error #\1#include <__external_threading>/' include/__thread/support/external.h -sed -i 's/#\( *\)include <__pstl_memory>/#error #\1include <__pstl_memory>/' include/memory -sed -i 's/#\( *\)include <__pstl_numeric>/#error #\1include <__pstl_numeric>/' include/numeric sed -i 's|#\( *\)include <__locale_dir/locale_base_api/solaris.h>|#error #\1include <__locale_dir/locale_base_api/solaris.h>|' include/__locale_dir/locale_base_api.h + +sed -i 's|#\( *\)include <ptrauth.h>|#error #\1include <ptrauth.h>|' src/include/overridable_function.h +sed -i 's|#\( *\)include <sys/futex.h>|#error #\1include <sys/futex.h>|' src/atomic.cpp diff --git a/contrib/libs/cxxsupp/libcxx/patches/65-string-iterator-pointer.patch b/contrib/libs/cxxsupp/libcxx/patches/65-string-iterator-pointer.patch index c132c52847..45b424726c 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/65-string-iterator-pointer.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/65-string-iterator-pointer.patch @@ -1,10 +1,10 @@ diff --git a/include/string b/include/string -index 804373b..6465702 100644 +index da86723..74c0690 100644 --- a/include/string +++ b/include/string -@@ -753,9 +753,14 @@ public: - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); +@@ -783,9 +783,14 @@ public: + "Allocator::value_type must be same type as value_type"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); +#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 + typedef pointer iterator; @@ -17,7 +17,7 @@ index 804373b..6465702 100644 typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; -@@ -1164,6 +1169,7 @@ public: +@@ -1180,6 +1185,7 @@ public: #endif _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c); @@ -25,7 +25,7 @@ index 804373b..6465702 100644 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT { return __make_iterator(__get_pointer()); } -@@ -1176,6 +1182,20 @@ public: +@@ -1192,6 +1198,20 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT { return __make_const_iterator(__get_pointer() + size()); } diff --git a/contrib/libs/cxxsupp/libcxx/patches/66-vector-iterator-pointer.patch b/contrib/libs/cxxsupp/libcxx/patches/66-vector-iterator-pointer.patch index bbd2b71e10..603dfd0050 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/66-vector-iterator-pointer.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/66-vector-iterator-pointer.patch @@ -1,5 +1,5 @@ diff --git a/include/vector b/include/vector -index 8d5b846..b989a3c 100644 +index 0125901..2f714f1 100644 --- a/include/vector +++ b/include/vector @@ -401,9 +401,14 @@ public: @@ -17,7 +17,7 @@ index 8d5b846..b989a3c 100644 typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; -@@ -807,12 +812,8 @@ private: +@@ -838,12 +843,8 @@ private: void __append_uninitialized(size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const_reference __x); @@ -32,7 +32,7 @@ index 8d5b846..b989a3c 100644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer -@@ -1389,6 +1390,28 @@ vector<_Tp, _Allocator>::__assign_with_size(_ForwardIterator __first, _Sentinel +@@ -1379,6 +1380,28 @@ vector<_Tp, _Allocator>::__assign_with_size(_ForwardIterator __first, _Sentinel } } diff --git a/contrib/libs/cxxsupp/libcxx/patches/68-asan-contiguous-container.patch b/contrib/libs/cxxsupp/libcxx/patches/68-asan-contiguous-container.patch index 35cfcb9053..85a55bde0d 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/68-asan-contiguous-container.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/68-asan-contiguous-container.patch @@ -1,52 +1,22 @@ -diff --git a/include/__config b/include/__config -index 1bb99ee..465d784 100644 ---- a/include/__config -+++ b/include/__config -@@ -1081,10 +1081,12 @@ typedef __char32_t char32_t; - # ifndef _LIBCPP_HAS_NO_ASAN - extern "C" _LIBCPP_EXPORTED_FROM_ABI void - __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*); -+# if !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container( - const void*, const void*, const void*, const void*, const void*, const void*); - extern "C" _LIBCPP_EXPORTED_FROM_ABI int - __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*); -+# endif - # endif - - // Try to find out if RTTI is disabled. -diff --git a/include/deque b/include/deque -index 154926d..9559235 100644 ---- a/include/deque -+++ b/include/deque -@@ -886,7 +886,7 @@ private: - (void)__old_con_end; - (void)__new_con_beg; - (void)__new_con_end; --#ifndef _LIBCPP_HAS_NO_ASAN -+#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value) - __sanitizer_annotate_double_ended_contiguous_container( - __beg, __end, __old_con_beg, __old_con_end, __new_con_beg, __new_con_end); -@@ -1077,7 +1077,7 @@ private: - } - #endif - } --#if !defined(_LIBCPP_HAS_NO_ASAN) -+#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - - public: - _LIBCPP_HIDE_FROM_ABI bool __verify_asan_annotations() const _NOEXCEPT { -diff --git a/include/vector b/include/vector -index b989a3c..61e3263 100644 ---- a/include/vector -+++ b/include/vector -@@ -848,7 +848,7 @@ private: - __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const { - (void)__old_mid; - (void)__new_mid; --#ifndef _LIBCPP_HAS_NO_ASAN -+#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) - const void* __beg = data(); - const void* __end = data() + capacity(); - if (!__libcpp_is_constant_evaluated() && __beg != nullptr && +diff --git a/include/__debug_utils/sanitizers.h b/include/__debug_utils/sanitizers.h +index d8547e3..f72b399 100644 +--- a/include/__debug_utils/sanitizers.h ++++ b/include/__debug_utils/sanitizers.h +@@ -57,7 +57,7 @@ _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container( + const void* __last_old_contained, + const void* __first_new_contained, + const void* __last_new_contained) { +-#ifdef _LIBCPP_HAS_NO_ASAN ++#if !defined(_LIBCPP_HAS_NO_ASAN) || defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) + (void)__first_storage; + (void)__last_storage; + (void)__first_old_contained; +@@ -86,7 +86,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __annotate_contiguous_c + const void* __last_storage, + const void* __old_last_contained, + const void* __new_last_contained) { +-#ifdef _LIBCPP_HAS_NO_ASAN ++#if !defined(_LIBCPP_HAS_NO_ASAN) || defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES) + (void)__first_storage; + (void)__last_storage; + (void)__old_last_contained; diff --git a/contrib/libs/cxxsupp/libcxx/patches/71-char-traits-deprecated.patch b/contrib/libs/cxxsupp/libcxx/patches/71-char-traits-deprecated.patch index 294adcf5a9..15e330f8cd 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/71-char-traits-deprecated.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/71-char-traits-deprecated.patch @@ -1,8 +1,8 @@ diff --git a/include/__string/char_traits.h b/include/__string/char_traits.h -index 47ed105..249057c 100644 +index 2660ac2..44b46eb 100644 --- a/include/__string/char_traits.h +++ b/include/__string/char_traits.h -@@ -72,6 +72,106 @@ exposition-only to document what members a char_traits specialization should pro +@@ -74,6 +74,106 @@ exposition-only to document what members a char_traits specialization should pro }; */ diff --git a/contrib/libs/cxxsupp/libcxx/patches/72-abi-has-no-init_primary_exception.patch b/contrib/libs/cxxsupp/libcxx/patches/72-abi-has-no-init_primary_exception.patch index 8a1d6c9f8b..62b77eb50a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/72-abi-has-no-init_primary_exception.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/72-abi-has-no-init_primary_exception.patch @@ -1,8 +1,8 @@ diff --git a/include/__exception/exception_ptr.h b/include/__exception/exception_ptr.h -index bcc8768..f0f2f12 100644 +index d23450f..e9316f3 100644 --- a/include/__exception/exception_ptr.h +++ b/include/__exception/exception_ptr.h -@@ -97,7 +97,7 @@ public: +@@ -99,7 +99,7 @@ public: template <class _Ep> _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT { # ifndef _LIBCPP_HAS_NO_EXCEPTIONS diff --git a/contrib/libs/cxxsupp/libcxx/patches/75-allocator-removed-members.patch b/contrib/libs/cxxsupp/libcxx/patches/75-allocator-removed-members.patch index abfa0cc987..a99ecd0fb7 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/75-allocator-removed-members.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/75-allocator-removed-members.patch @@ -1,8 +1,8 @@ diff --git a/include/__memory/allocator.h b/include/__memory/allocator.h -index 26e5d49..b63a809 100644 +index 2d8624e..c276b45 100644 --- a/include/__memory/allocator.h +++ b/include/__memory/allocator.h -@@ -31,12 +31,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD +@@ -32,7 +32,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> class allocator; @@ -11,22 +11,7 @@ index 26e5d49..b63a809 100644 // These specializations shouldn't be marked _LIBCPP_DEPRECATED_IN_CXX17. // Specializing allocator<void> is deprecated, but not using it. template <> - class _LIBCPP_TEMPLATE_VIS allocator<void> { --# if _LIBCPP_STD_VER <= 17 -+# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) - - public: - _LIBCPP_DEPRECATED_IN_CXX17 typedef void* pointer; -@@ -52,7 +52,7 @@ public: - - template <> - class _LIBCPP_TEMPLATE_VIS allocator<const void> { --# if _LIBCPP_STD_VER <= 17 -+# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) - - public: - _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* pointer; -@@ -135,7 +135,7 @@ public: +@@ -134,7 +134,7 @@ public: } // C++20 Removed members @@ -39,8 +24,8 @@ index 26e5d49..b63a809 100644 } // C++20 Removed members --#if _LIBCPP_STD_VER <= 17 -+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) +-# if _LIBCPP_STD_VER <= 17 ++# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer; _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference; diff --git a/contrib/libs/cxxsupp/libcxx/patches/77-__builtin_convertvector-win-clang18.patch b/contrib/libs/cxxsupp/libcxx/patches/77-__builtin_convertvector-win-clang18.patch deleted file mode 100644 index f18d439fd2..0000000000 --- a/contrib/libs/cxxsupp/libcxx/patches/77-__builtin_convertvector-win-clang18.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/__algorithm/simd_utils.h b/include/__algorithm/simd_utils.h -index c2fc02e..3548c00 100644 ---- a/include/__algorithm/simd_utils.h -+++ b/include/__algorithm/simd_utils.h -@@ -27,7 +27,7 @@ _LIBCPP_PUSH_MACROS - #include <__undef_macros> - - // TODO: Find out how altivec changes things and allow vectorizations there too. --#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) && !defined(__CUDACC__) -+#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) && !defined(__CUDACC__) && !(defined(_MSC_VER) && _LIBCPP_CLANG_VER <= 1801) - # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1 - #else - # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0 diff --git a/contrib/libs/cxxsupp/libcxx/patches/77-simd_utils-clang14-win-clang18.patch b/contrib/libs/cxxsupp/libcxx/patches/77-simd_utils-clang14-win-clang18.patch new file mode 100644 index 0000000000..9695de260e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/patches/77-simd_utils-clang14-win-clang18.patch @@ -0,0 +1,13 @@ +diff --git a/include/__algorithm/simd_utils.h b/include/__algorithm/simd_utils.h +index c0d04c4..8404007 100644 +--- a/include/__algorithm/simd_utils.h ++++ b/include/__algorithm/simd_utils.h +@@ -28,7 +28,7 @@ _LIBCPP_PUSH_MACROS + #include <__undef_macros> + + // TODO: Find out how altivec changes things and allow vectorizations there too. +-#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__) && !defined(__CUDACC__) ++#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__) && !defined(__CUDACC__) && !(defined(_MSC_VER) && _LIBCPP_CLANG_VER <= 1801) && _LIBCPP_CLANG_VER >= 1600 + # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1 + #else + # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0 diff --git a/contrib/libs/cxxsupp/libcxx/patches/78-atomic_ref-clang14.patch b/contrib/libs/cxxsupp/libcxx/patches/78-atomic_ref-clang14.patch new file mode 100644 index 0000000000..337e864866 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/patches/78-atomic_ref-clang14.patch @@ -0,0 +1,22 @@ +diff --git a/include/__atomic/atomic_ref.h b/include/__atomic/atomic_ref.h +index 2849b82..a63a95c 100644 +--- a/include/__atomic/atomic_ref.h ++++ b/include/__atomic/atomic_ref.h +@@ -254,7 +254,7 @@ template <class _Tp> + struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> { + using __base = __atomic_ref_base<_Tp>; + +- using difference_type = __base::value_type; ++ using difference_type = typename __base::value_type; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( +@@ -300,7 +300,7 @@ template <class _Tp> + struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> { + using __base = __atomic_ref_base<_Tp>; + +- using difference_type = __base::value_type; ++ using difference_type = typename __base::value_type; + + _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( diff --git a/contrib/libs/cxxsupp/libcxx/patches/xxx-config-epilogue.patch b/contrib/libs/cxxsupp/libcxx/patches/xxx-config-epilogue.patch index c9244a9f6b..4a19f1f583 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/xxx-config-epilogue.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/xxx-config-epilogue.patch @@ -1,8 +1,8 @@ diff --git a/include/__config b/include/__config -index 465d784..b5c2fb4 100644 +index 56705ec..8ce18c1 100644 --- a/include/__config +++ b/include/__config -@@ -1568,4 +1568,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c +@@ -1250,4 +1250,6 @@ typedef __char32_t char32_t; #endif // __cplusplus diff --git a/contrib/libs/cxxsupp/libcxx/patches/yyy-enable-std-expected.patch b/contrib/libs/cxxsupp/libcxx/patches/yyy-enable-std-expected.patch index 7f59d1e737..d3d4b8d528 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/yyy-enable-std-expected.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/yyy-enable-std-expected.patch @@ -1,5 +1,5 @@ diff --git a/include/__expected/bad_expected_access.h b/include/__expected/bad_expected_access.h -index 27f01d9..174f97f 100644 +index 1b73438..d954545 100644 --- a/include/__expected/bad_expected_access.h +++ b/include/__expected/bad_expected_access.h @@ -20,7 +20,7 @@ @@ -12,10 +12,10 @@ index 27f01d9..174f97f 100644 _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__expected/expected.h b/include/__expected/expected.h -index d7adaac..21b610b 100644 +index f618b20..d08222f 100644 --- a/include/__expected/expected.h +++ b/include/__expected/expected.h -@@ -52,7 +52,7 @@ +@@ -53,7 +53,7 @@ _LIBCPP_PUSH_MACROS #include <__undef_macros> diff --git a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp index 2b67685c8a..1babc953ef 100644 --- a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp @@ -25,16 +25,28 @@ # if !defined(SYS_futex) && defined(SYS_futex_time64) # define SYS_futex SYS_futex_time64 # endif +# define _LIBCPP_FUTEX(...) syscall(SYS_futex, __VA_ARGS__) #elif defined(__FreeBSD__) # include <sys/types.h> # include <sys/umtx.h> +# define _LIBCPP_FUTEX(...) syscall(SYS_futex, __VA_ARGS__) + +#elif defined(__OpenBSD__) + +#error # include <sys/futex.h> + +// OpenBSD has no indirect syscalls +# define _LIBCPP_FUTEX(...) futex(__VA_ARGS__) + #else // <- Add other operating systems here // Baseline needs no new headers +# define _LIBCPP_FUTEX(...) syscall(SYS_futex, __VA_ARGS__) + #endif _LIBCPP_BEGIN_NAMESPACE_STD @@ -44,11 +56,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) { static constexpr timespec __timeout = {2, 0}; - syscall(SYS_futex, __ptr, FUTEX_WAIT_PRIVATE, __val, &__timeout, 0, 0); + _LIBCPP_FUTEX(__ptr, FUTEX_WAIT_PRIVATE, __val, &__timeout, 0, 0); } static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) { - syscall(SYS_futex, __ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0); + _LIBCPP_FUTEX(__ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0); } #elif defined(__APPLE__) && defined(_LIBCPP_USE_ULOCK) @@ -57,17 +69,20 @@ extern "C" int __ulock_wait( uint32_t operation, void* addr, uint64_t value, uint32_t timeout); /* timeout is specified in microseconds */ extern "C" int __ulock_wake(uint32_t operation, void* addr, uint64_t wake_value); -# define UL_COMPARE_AND_WAIT 1 +// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L82 +# define UL_COMPARE_AND_WAIT64 5 # define ULF_WAKE_ALL 0x00000100 static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) { - __ulock_wait(UL_COMPARE_AND_WAIT, const_cast<__cxx_atomic_contention_t*>(__ptr), __val, 0); + static_assert(sizeof(__cxx_atomic_contention_t) == 8, "Waiting on 8 bytes value"); + __ulock_wait(UL_COMPARE_AND_WAIT64, const_cast<__cxx_atomic_contention_t*>(__ptr), __val, 0); } static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) { + static_assert(sizeof(__cxx_atomic_contention_t) == 8, "Waking up on 8 bytes value"); __ulock_wake( - UL_COMPARE_AND_WAIT | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<__cxx_atomic_contention_t*>(__ptr), 0); + UL_COMPARE_AND_WAIT64 | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<__cxx_atomic_contention_t*>(__ptr), 0); } #elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8 @@ -154,17 +169,18 @@ static void __libcpp_atomic_notify(void const volatile* __location) { &__entry->__platform_state, false /* when laundering, we can't handle notify_one */); } -_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile* __location) { +_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile* __location) noexcept { __libcpp_atomic_notify(__location); } -_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __location) { +_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __location) noexcept { __libcpp_atomic_notify(__location); } -_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) { +_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) noexcept { auto const __entry = __libcpp_contention_state(__location); return __libcpp_contention_monitor_for_wait(&__entry->__contention_state, &__entry->__platform_state); } -_LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) { +_LIBCPP_EXPORTED_FROM_ABI void +__libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) noexcept { auto const __entry = __libcpp_contention_state(__location); __libcpp_contention_wait(&__entry->__contention_state, &__entry->__platform_state, __old_value); } @@ -172,19 +188,19 @@ _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile* __locat /* When the incoming atomic happens to be the platform wait size, we still need to use the table for the contention detection, but we can use the atomic directly for the wait. */ -_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) { +_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) noexcept { __libcpp_contention_notify(&__libcpp_contention_state(__location)->__contention_state, __location, true); } -_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) { +_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) noexcept { __libcpp_contention_notify(&__libcpp_contention_state(__location)->__contention_state, __location, false); } // This function is never used, but still exported for ABI compatibility. _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t -__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) { +__libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) noexcept { return __libcpp_contention_monitor_for_wait(&__libcpp_contention_state(__location)->__contention_state, __location); } _LIBCPP_EXPORTED_FROM_ABI void -__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) { +__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) noexcept { __libcpp_contention_wait(&__libcpp_contention_state(__location)->__contention_state, __location, __old_value); } diff --git a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp index baa26101cd..69601bfeec 100644 --- a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp @@ -21,17 +21,17 @@ public: } __tickets[64]; }; - ptrdiff_t& __expected; - unique_ptr<__state_t[]> __state; + ptrdiff_t& __expected_; + unique_ptr<__state_t[]> __state_; - _LIBCPP_HIDDEN __barrier_algorithm_base(ptrdiff_t& __expected) : __expected(__expected) { + _LIBCPP_HIDDEN __barrier_algorithm_base(ptrdiff_t& __expected) : __expected_(__expected) { size_t const __count = (__expected + 1) >> 1; - __state = unique_ptr<__state_t[]>(new __state_t[__count]); + __state_ = unique_ptr<__state_t[]>(new __state_t[__count]); } _LIBCPP_HIDDEN bool __arrive(__barrier_phase_t __old_phase) { __barrier_phase_t const __half_step = __old_phase + 1, __full_step = __old_phase + 2; - size_t __current_expected = __expected, - __current = hash<thread::id>()(this_thread::get_id()) % ((__expected + 1) >> 1); + size_t __current_expected = __expected_, + __current = hash<thread::id>()(this_thread::get_id()) % ((__expected_ + 1) >> 1); for (int __round = 0;; ++__round) { if (__current_expected <= 1) return true; @@ -41,14 +41,14 @@ public: __current = 0; __barrier_phase_t expect = __old_phase; if (__current == __last_node && (__current_expected & 1)) { - if (__state[__current].__tickets[__round].__phase.compare_exchange_strong( + if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong( expect, __full_step, memory_order_acq_rel)) break; // I'm 1 in 1, go to next __round - } else if (__state[__current].__tickets[__round].__phase.compare_exchange_strong( + } else if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong( expect, __half_step, memory_order_acq_rel)) { return false; // I'm 1 in 2, done with arrival } else if (expect == __half_step) { - if (__state[__current].__tickets[__round].__phase.compare_exchange_strong( + if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong( expect, __full_step, memory_order_acq_rel)) break; // I'm 2 in 2, go to next __round } @@ -63,10 +63,10 @@ _LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorith return new __barrier_algorithm_base(__expected); } _LIBCPP_EXPORTED_FROM_ABI bool -__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) { +__arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_phase_t __old_phase) noexcept { return __barrier->__arrive(__old_phase); } -_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) { +_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) noexcept { delete __barrier; } diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp index c5e827c0cb..83e8a64504 100644 --- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp @@ -31,7 +31,9 @@ # include <sys/time.h> // for gettimeofday and timeval #endif -#if defined(__APPLE__) || defined(__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) +// OpenBSD does not have a fully conformant suite of POSIX timers, but +// it does have clock_gettime and CLOCK_MONOTONIC which is all we need. +#if defined(__APPLE__) || defined(__gnu_hurd__) || defined(__OpenBSD__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) # define _LIBCPP_HAS_CLOCK_GETTIME #endif @@ -75,8 +77,8 @@ typedef void(WINAPI* GetSystemTimeAsFileTimePtr)(LPFILETIME); class GetSystemTimeInit { public: GetSystemTimeInit() { - fp = - (GetSystemTimeAsFileTimePtr)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "GetSystemTimePreciseAsFileTime"); + fp = (GetSystemTimeAsFileTimePtr)(void*)GetProcAddress( + GetModuleHandleW(L"kernel32.dll"), "GetSystemTimePreciseAsFileTime"); if (fp == nullptr) fp = GetSystemTimeAsFileTime; } diff --git a/contrib/libs/cxxsupp/libcxx/src/expected.cpp b/contrib/libs/cxxsupp/libcxx/src/expected.cpp new file mode 100644 index 0000000000..f30efb5164 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/src/expected.cpp @@ -0,0 +1,13 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#include <expected> + +_LIBCPP_BEGIN_NAMESPACE_STD +const char* bad_expected_access<void>::what() const noexcept { return "bad access to std::expected"; } +_LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/time_zone_link_private.h b/contrib/libs/cxxsupp/libcxx/src/experimental/chrono_exception.cpp index 1392376252..bea2ad1103 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/time_zone_link_private.h +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/chrono_exception.cpp @@ -1,4 +1,3 @@ -// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -7,21 +6,17 @@ // //===----------------------------------------------------------------------===// -// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html - -#ifndef _LIBCPP_SRC_INCLUDE_TZDB_TIME_ZONE_LINK_PRIVATE_H -#define _LIBCPP_SRC_INCLUDE_TZDB_TIME_ZONE_LINK_PRIVATE_H - #include <chrono> _LIBCPP_BEGIN_NAMESPACE_STD namespace chrono { -struct time_zone_link::__constructor_tag {}; +_LIBCPP_AVAILABILITY_TZDB +_LIBCPP_EXPORTED_FROM_ABI nonexistent_local_time::~nonexistent_local_time() = default; // key function +_LIBCPP_AVAILABILITY_TZDB +_LIBCPP_EXPORTED_FROM_ABI ambiguous_local_time::~ambiguous_local_time() = default; // key function } // namespace chrono _LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_SRC_INCLUDE_TZDB_TIME_ZONE_LINK_PRIVATE_H diff --git a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/time_zone_private.h b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/time_zone_private.h index 039a3b0ffe..2c47e9fdb1 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/time_zone_private.h +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/time_zone_private.h @@ -24,7 +24,8 @@ namespace chrono { class time_zone::__impl { public: - explicit _LIBCPP_HIDE_FROM_ABI __impl(string&& __name) : __name_(std::move(__name)) {} + explicit _LIBCPP_HIDE_FROM_ABI __impl(string&& __name, const __tz::__rules_storage_type& __rules_db) + : __name_(std::move(__name)), __rules_db_(__rules_db) {} [[nodiscard]] _LIBCPP_HIDE_FROM_ABI string_view __name() const noexcept { return __name_; } @@ -33,12 +34,20 @@ public: return __continuations_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const __tz::__rules_storage_type& __rules_db() const { return __rules_db_; } + private: string __name_; // Note the first line has a name + __continuation, the other lines // are just __continuations. So there is always at least one item in // the vector. vector<__tz::__continuation> __continuations_; + + // Continuations often depend on a set of rules. The rules are stored in + // parallel data structurs in tzdb_list. From the time_zone it's not possible + // to find its associated tzdb entry and thus not possible to find its + // associated rules. Therefore a link to the rules in stored in this class. + const __tz::__rules_storage_type& __rules_db_; }; } // namespace chrono diff --git a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/types_private.h b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/types_private.h index 4604b9fc88..c86982948b 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/types_private.h +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/types_private.h @@ -33,7 +33,17 @@ namespace chrono::__tz { // Sun>=8 first Sunday on or after the eighth // Sun<=25 last Sunday on or before the 25th struct __constrained_weekday { - /* year_month_day operator()(year __year, month __month);*/ // needed but not implemented + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI year_month_day operator()(year __year, month __month) const { + auto __result = static_cast<sys_days>(year_month_day{__year, __month, __day}); + weekday __wd{static_cast<sys_days>(__result)}; + + if (__comparison == __le) + __result -= __wd - __weekday; + else + __result += __weekday - __wd; + + return __result; + } weekday __weekday; enum __comparison_t { __le, __ge } __comparison; @@ -85,7 +95,8 @@ struct __continuation { // used. // If this field contains - then standard time always // applies. This is indicated by the monostate. - using __rules_t = variant<monostate, __tz::__save, string, size_t>; + // TODO TZDB Investigate implantation the size_t based caching. + using __rules_t = variant<monostate, __tz::__save, string /*, size_t*/>; __rules_t __rules; diff --git a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/tzdb_list_private.h b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/tzdb_list_private.h index 969b2b9f8a..0be7b8e5a1 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/tzdb_list_private.h +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/tzdb_list_private.h @@ -15,8 +15,11 @@ #include <forward_list> // When threads are not available the locking is not required. +// When threads are available, we use std::mutex over std::shared_mutex +// due to the increased overhead of std::shared_mutex. +// See shared_mutex_vs_mutex.bench.cpp #ifndef _LIBCPP_HAS_NO_THREADS -# include <shared_mutex> +# include <mutex> #endif #include "types_private.h" @@ -56,7 +59,7 @@ public: const tzdb& __front() const noexcept { #ifndef _LIBCPP_HAS_NO_THREADS - shared_lock __lock{__mutex_}; + unique_lock __lock{__mutex_}; #endif return __tzdb_.front(); } @@ -72,7 +75,7 @@ public: const_iterator __begin() const noexcept { #ifndef _LIBCPP_HAS_NO_THREADS - shared_lock __lock{__mutex_}; + unique_lock __lock{__mutex_}; #endif return __tzdb_.begin(); } @@ -87,7 +90,7 @@ private: void __load_no_lock() { chrono::__init_tzdb(__tzdb_.emplace_front(), __rules_.emplace_front()); } #ifndef _LIBCPP_HAS_NO_THREADS - mutable shared_mutex __mutex_; + mutable mutex __mutex_; #endif forward_list<tzdb> __tzdb_; diff --git a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/tzdb_private.h b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/tzdb_private.h index 8ec3f890ef..8ec3f890ef 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/tzdb/tzdb_private.h +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/include/tzdb/tzdb_private.h diff --git a/contrib/libs/cxxsupp/libcxx/src/experimental/time_zone.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/time_zone.cpp new file mode 100644 index 0000000000..764a89ab51 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/time_zone.cpp @@ -0,0 +1,1055 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html + +// TODO TZDB look at optimizations +// +// The current algorithm is correct but not efficient. For example, in a named +// rule based continuation finding the next rule does quite a bit of work, +// returns the next rule and "forgets" its state. This could be better. +// +// It would be possible to cache lookups. If a time for a zone is calculated its +// sys_info could be kept and the next lookup could test whether the time is in +// a "known" sys_info. The wording in the Standard hints at this slowness by +// "suggesting" this could be implemented on the user's side. + +// TODO TZDB look at removing quirks +// +// The code has some special rules to adjust the timing at the continuation +// switches. This works correctly, but some of the places feel odd. It would be +// good to investigate this further and see whether all quirks are needed or +// that there are better fixes. +// +// These quirks often use a 12h interval; this is the scan interval of zdump, +// which implies there are no sys_info objects with a duration of less than 12h. + +#include <algorithm> +#include <cctype> +#include <chrono> +#include <expected> +#include <map> +#include <numeric> +#include <ranges> + +#include "include/tzdb/time_zone_private.h" +#include "include/tzdb/tzdb_list_private.h" + +// TODO TZDB remove debug printing +#ifdef PRINT +# include <print> +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifdef PRINT +template <> +struct formatter<chrono::sys_info, char> { + template <class ParseContext> + constexpr typename ParseContext::iterator parse(ParseContext& ctx) { + return ctx.begin(); + } + + template <class FormatContext> + typename FormatContext::iterator format(const chrono::sys_info& info, FormatContext& ctx) const { + return std::format_to( + ctx.out(), "[{}, {}) {:%Q%q} {:%Q%q} {}", info.begin, info.end, info.offset, info.save, info.abbrev); + } +}; +#endif + +namespace chrono { + +//===----------------------------------------------------------------------===// +// Details +//===----------------------------------------------------------------------===// + +struct __sys_info { + sys_info __info; + bool __can_merge; // Can the returned sys_info object be merged with +}; + +// Return type for helper function to get a sys_info. +// - The expected result returns the "best" sys_info object. This object can be +// before the requested time. Sometimes sys_info objects from different +// continuations share their offset, save, and abbrev and these objects are +// merged to one sys_info object. The __can_merge flag determines whether the +// current result can be merged with the next result. +// - The unexpected result means no sys_info object was found and the time is +// the time to be used for the next search iteration. +using __sys_info_result = expected<__sys_info, sys_seconds>; + +template <ranges::forward_range _Range, + class _Type, + class _Proj = identity, + indirect_strict_weak_order<const _Type*, projected<ranges::iterator_t<_Range>, _Proj>> _Comp = ranges::less> +[[nodiscard]] static ranges::borrowed_iterator_t<_Range> +__binary_find(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) { + auto __end = ranges::end(__r); + auto __ret = ranges::lower_bound(ranges::begin(__r), __end, __value, __comp, __proj); + if (__ret == __end) + return __end; + + // When the value does not match the predicate it's equal and a valid result + // was found. + return !std::invoke(__comp, __value, std::invoke(__proj, *__ret)) ? __ret : __end; +} + +// Format based on https://data.iana.org/time-zones/tz-how-to.html +// +// 1 a time zone abbreviation that is a string of three or more characters that +// are either ASCII alphanumerics, "+", or "-" +// 2 the string "%z", in which case the "%z" will be replaced by a numeric time +// zone abbreviation +// 3 a pair of time zone abbreviations separated by a slash ('/'), in which +// case the first string is the abbreviation for the standard time name and +// the second string is the abbreviation for the daylight saving time name +// 4 a string containing "%s", in which case the "%s" will be replaced by the +// text in the appropriate Rule's LETTER column, and the resulting string +// should be a time zone abbreviation +// +// Rule 1 is not strictly validated since America/Barbados uses a two letter +// abbreviation AT. +[[nodiscard]] static string +__format(const __tz::__continuation& __continuation, const string& __letters, seconds __save) { + bool __shift = false; + string __result; + for (char __c : __continuation.__format) { + if (__shift) { + switch (__c) { + case 's': + std::ranges::copy(__letters, std::back_inserter(__result)); + break; + + case 'z': { + if (__continuation.__format.size() != 2) + std::__throw_runtime_error( + std::format("corrupt tzdb FORMAT field: %z should be the entire contents, instead contains '{}'", + __continuation.__format) + .c_str()); + chrono::hh_mm_ss __offset{__continuation.__stdoff + __save}; + if (__offset.is_negative()) { + __result += '-'; + __offset = chrono::hh_mm_ss{-(__continuation.__stdoff + __save)}; + } else + __result += '+'; + + if (__offset.minutes() != 0min) + std::format_to(std::back_inserter(__result), "{:%H%M}", __offset); + else + std::format_to(std::back_inserter(__result), "{:%H}", __offset); + } break; + + default: + std::__throw_runtime_error( + std::format("corrupt tzdb FORMAT field: invalid sequence '%{}' found, expected %s or %z", __c).c_str()); + } + __shift = false; + + } else if (__c == '/') { + if (__save != 0s) + __result.clear(); + else + break; + + } else if (__c == '%') { + __shift = true; + } else if (__c == '+' || __c == '-' || std::isalnum(__c)) { + __result.push_back(__c); + } else { + std::__throw_runtime_error( + std::format( + "corrupt tzdb FORMAT field: invalid character '{}' found, expected +, -, or an alphanumeric value", __c) + .c_str()); + } + } + + if (__shift) + std::__throw_runtime_error("corrupt tzdb FORMAT field: input ended with the start of the escape sequence '%'"); + + if (__result.empty()) + std::__throw_runtime_error("corrupt tzdb FORMAT field: result is empty"); + + return __result; +} + +[[nodiscard]] static sys_seconds __to_sys_seconds(year_month_day __ymd, seconds __seconds) { + seconds __result = static_cast<sys_days>(__ymd).time_since_epoch() + __seconds; + return sys_seconds{__result}; +} + +[[nodiscard]] static seconds __at_to_sys_seconds(const __tz::__continuation& __continuation) { + switch (__continuation.__at.__clock) { + case __tz::__clock::__local: + return __continuation.__at.__time - __continuation.__stdoff - + std::visit( + [](const auto& __value) { + using _Tp = decay_t<decltype(__value)>; + if constexpr (same_as<_Tp, monostate>) + return chrono::seconds{0}; + else if constexpr (same_as<_Tp, __tz::__save>) + return chrono::duration_cast<seconds>(__value.__time); + else if constexpr (same_as<_Tp, std::string>) + // For a named rule based continuation the SAVE depends on the RULE + // active at the end. This should be determined separately. + return chrono::seconds{0}; + else + static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support + + std::__libcpp_unreachable(); + }, + __continuation.__rules); + + case __tz::__clock::__universal: + return __continuation.__at.__time; + + case __tz::__clock::__standard: + return __continuation.__at.__time - __continuation.__stdoff; + } + std::__libcpp_unreachable(); +} + +[[nodiscard]] static year_month_day __to_year_month_day(year __year, month __month, __tz::__on __on) { + return std::visit( + [&](const auto& __value) { + using _Tp = decay_t<decltype(__value)>; + if constexpr (same_as<_Tp, chrono::day>) + return year_month_day{__year, __month, __value}; + else if constexpr (same_as<_Tp, weekday_last>) + return year_month_day{static_cast<sys_days>(year_month_weekday_last{__year, __month, __value})}; + else if constexpr (same_as<_Tp, __tz::__constrained_weekday>) + return __value(__year, __month); + else + static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support + + std::__libcpp_unreachable(); + }, + __on); +} + +[[nodiscard]] static sys_seconds __until_to_sys_seconds(const __tz::__continuation& __continuation) { + // Does UNTIL contain the magic value for the last continuation? + if (__continuation.__year == chrono::year::min()) + return sys_seconds::max(); + + year_month_day __ymd = chrono::__to_year_month_day(__continuation.__year, __continuation.__in, __continuation.__on); + return chrono::__to_sys_seconds(__ymd, chrono::__at_to_sys_seconds(__continuation)); +} + +// Holds the UNTIL time for a continuation with a named rule. +// +// Unlike continuations with an fixed SAVE named rules have a variable SAVE. +// This means when the UNTIL uses the local wall time the actual UNTIL value can +// only be determined when the SAVE is known. This class holds that abstraction. +class __named_rule_until { +public: + explicit __named_rule_until(const __tz::__continuation& __continuation) + : __until_{chrono::__until_to_sys_seconds(__continuation)}, + __needs_adjustment_{ + // The last continuation of a ZONE has no UNTIL which basically is + // until the end of _local_ time. This value is expressed by + // sys_seconds::max(). Subtracting the SAVE leaves large value. + // However SAVE can be negative, which would add a value to maximum + // leading to undefined behaviour. In practice this often results in + // an overflow to a very small value. + __until_ != sys_seconds::max() && __continuation.__at.__clock == __tz::__clock::__local} {} + + // Gives the unadjusted until value, this is useful when the SAVE is not known + // at all. + sys_seconds __until() const noexcept { return __until_; } + + bool __needs_adjustment() const noexcept { return __needs_adjustment_; } + + // Returns the UNTIL adjusted for SAVE. + sys_seconds operator()(seconds __save) const noexcept { return __until_ - __needs_adjustment_ * __save; } + +private: + sys_seconds __until_; + bool __needs_adjustment_; +}; + +[[nodiscard]] static seconds __at_to_seconds(seconds __stdoff, const __tz::__rule& __rule) { + switch (__rule.__at.__clock) { + case __tz::__clock::__local: + // Local time and standard time behave the same. This is not + // correct. Local time needs to adjust for the current saved time. + // To know the saved time the rules need to be known and sorted. + // This needs a time so to avoid the chicken and egg adjust the + // saving of the local time later. + return __rule.__at.__time - __stdoff; + + case __tz::__clock::__universal: + return __rule.__at.__time; + + case __tz::__clock::__standard: + return __rule.__at.__time - __stdoff; + } + std::__libcpp_unreachable(); +} + +[[nodiscard]] static sys_seconds __from_to_sys_seconds(seconds __stdoff, const __tz::__rule& __rule, year __year) { + year_month_day __ymd = chrono::__to_year_month_day(__year, __rule.__in, __rule.__on); + + seconds __at = chrono::__at_to_seconds(__stdoff, __rule); + return chrono::__to_sys_seconds(__ymd, __at); +} + +[[nodiscard]] static sys_seconds __from_to_sys_seconds(seconds __stdoff, const __tz::__rule& __rule) { + return chrono::__from_to_sys_seconds(__stdoff, __rule, __rule.__from); +} + +[[nodiscard]] static const vector<__tz::__rule>& +__get_rules(const __tz::__rules_storage_type& __rules_db, const string& __rule_name) { + auto __result = chrono::__binary_find(__rules_db, __rule_name, {}, [](const auto& __p) { return __p.first; }); + if (__result == std::end(__rules_db)) + std::__throw_runtime_error(("corrupt tzdb: rule '" + __rule_name + " 'does not exist").c_str()); + + return __result->second; +} + +// Returns the letters field for a time before the first rule. +// +// Per https://data.iana.org/time-zones/tz-how-to.html +// One wrinkle, not fully explained in zic.8.txt, is what happens when switching +// to a named rule. To what values should the SAVE and LETTER data be +// initialized? +// +// 1 If at least one transition has happened, use the SAVE and LETTER data from +// the most recent. +// 2 If switching to a named rule before any transition has happened, assume +// standard time (SAVE zero), and use the LETTER data from the earliest +// transition with a SAVE of zero. +// +// This function implements case 2. +[[nodiscard]] static string __letters_before_first_rule(const vector<__tz::__rule>& __rules) { + auto __letters = + __rules // + | views::filter([](const __tz::__rule& __rule) { return __rule.__save.__time == 0s; }) // + | views::transform([](const __tz::__rule& __rule) { return __rule.__letters; }) // + | views::take(1); + + if (__letters.empty()) + std::__throw_runtime_error("corrupt tzdb: rule has zero entries"); + + return __letters.front(); +} + +// Determines the information based on the continuation and the rules. +// +// There are several special cases to take into account +// +// === Entries before the first rule becomes active === +// Asia/Hong_Kong +// 9 - JST 1945 N 18 2 // (1) +// 8 HK HK%sT // (2) +// R HK 1946 o - Ap 21 0 1 S // (3) +// There (1) is active until Novemer 18th 1945 at 02:00, after this time +// (2) becomes active. The first rule entry for HK (3) becomes active +// from April 21st 1945 at 01:00. In the period between (2) is active. +// This entry has an offset. +// This entry has no save, letters, or dst flag. So in the period +// after (1) and until (3) no rule entry is associated with the time. + +[[nodiscard]] static sys_info __get_sys_info_before_first_rule( + sys_seconds __begin, + sys_seconds __end, + const __tz::__continuation& __continuation, + const vector<__tz::__rule>& __rules) { + return sys_info{ + __begin, + __end, + __continuation.__stdoff, + chrono::minutes(0), + chrono::__format(__continuation, __letters_before_first_rule(__rules), 0s)}; +} + +// Returns the sys_info object for a time before the first rule. +// When this first rule has a SAVE of 0s the sys_info for the time before the +// first rule and for the first rule are identical and will be merged. +[[nodiscard]] static sys_info __get_sys_info_before_first_rule( + sys_seconds __begin, + sys_seconds __rule_end, // The end used when SAVE != 0s + sys_seconds __next_end, // The end used when SAVE == 0s the times are merged + const __tz::__continuation& __continuation, + const vector<__tz::__rule>& __rules, + vector<__tz::__rule>::const_iterator __rule) { + if (__rule->__save.__time != 0s) + return __get_sys_info_before_first_rule(__begin, __rule_end, __continuation, __rules); + + return sys_info{ + __begin, __next_end, __continuation.__stdoff, 0min, chrono::__format(__continuation, __rule->__letters, 0s)}; +} + +[[nodiscard]] static seconds __at_to_seconds(seconds __stdoff, seconds __save, const __tz::__rule& __rule) { + switch (__rule.__at.__clock) { + case __tz::__clock::__local: + return __rule.__at.__time - __stdoff - __save; + + case __tz::__clock::__universal: + return __rule.__at.__time; + + case __tz::__clock::__standard: + return __rule.__at.__time - __stdoff; + } + std::__libcpp_unreachable(); +} + +[[nodiscard]] static sys_seconds +__rule_to_sys_seconds(seconds __stdoff, seconds __save, const __tz::__rule& __rule, year __year) { + year_month_day __ymd = chrono::__to_year_month_day(__year, __rule.__in, __rule.__on); + + seconds __at = chrono::__at_to_seconds(__stdoff, __save, __rule); + return chrono::__to_sys_seconds(__ymd, __at); +} + +// Returns the first rule after __time. +// Note that a rule can be "active" in multiple years, this may result in an +// infinite loop where the same rule is returned every time, use __current to +// guard against that. +// +// When no next rule exists the returned time will be sys_seconds::max(). This +// can happen in practice. For example, +// +// R So 1945 o - May 24 2 2 M +// R So 1945 o - S 24 3 1 S +// R So 1945 o - N 18 2s 0 - +// +// Has 3 rules that are all only active in 1945. +[[nodiscard]] static pair<sys_seconds, vector<__tz::__rule>::const_iterator> +__next_rule(sys_seconds __time, + seconds __stdoff, + seconds __save, + const vector<__tz::__rule>& __rules, + vector<__tz::__rule>::const_iterator __current) { + year __year = year_month_day{chrono::floor<days>(__time)}.year(); + + // Note it would probably be better to store the pairs in a vector and then + // use min() to get the smallest element + map<sys_seconds, vector<__tz::__rule>::const_iterator> __candidates; + // Note this evaluates all rules which is a waste of effort; when the entries + // are beyond the current year's "next year" (where "next year" is not always + // year + 1) the algorithm should end. + for (auto __it = __rules.begin(); __it != __rules.end(); ++__it) { + for (year __y = __it->__from; __y <= __it->__to; ++__y) { + // Adding the current entry for the current year may lead to infinite + // loops due to the SAVE adjustment. Skip these entries. + if (__y == __year && __it == __current) + continue; + + sys_seconds __t = chrono::__rule_to_sys_seconds(__stdoff, __save, *__it, __y); + if (__t <= __time) + continue; + + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(!__candidates.contains(__t), "duplicated rule"); + __candidates[__t] = __it; + break; + } + } + + if (!__candidates.empty()) [[likely]] { + auto __it = __candidates.begin(); + + // When no rule is selected the time before the first rule and the first rule + // should not be merged. + if (__time == sys_seconds::min()) + return *__it; + + // There can be two constitutive rules that are the same. For example, + // Hong Kong + // + // R HK 1973 o - D 30 3:30 1 S (R1) + // R HK 1965 1976 - Ap Su>=16 3:30 1 S (R2) + // + // 1973-12-29 19:30:00 R1 becomes active. + // 1974-04-20 18:30:00 R2 becomes active. + // Both rules have a SAVE of 1 hour and LETTERS are S for both of them. + while (__it != __candidates.end()) { + if (__current->__save.__time != __it->second->__save.__time || __current->__letters != __it->second->__letters) + return *__it; + + ++__it; + } + } + + return {sys_seconds::max(), __rules.end()}; +} + +// Returns the first rule of a set of rules. +// This is not always the first of the listed rules. For example +// R Sa 2008 2009 - Mar Su>=8 0 0 - +// R Sa 2007 2008 - O Su>=8 0 1 - +// The transition in October 2007 happens before the transition in March 2008. +[[nodiscard]] static vector<__tz::__rule>::const_iterator +__first_rule(seconds __stdoff, const vector<__tz::__rule>& __rules) { + return chrono::__next_rule(sys_seconds::min(), __stdoff, 0s, __rules, __rules.end()).second; +} + +[[nodiscard]] static __sys_info_result __get_sys_info_rule( + sys_seconds __time, + sys_seconds __continuation_begin, + const __tz::__continuation& __continuation, + const vector<__tz::__rule>& __rules) { + auto __rule = chrono::__first_rule(__continuation.__stdoff, __rules); + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__rule != __rules.end(), "the set of rules has no first rule"); + + // Avoid selecting a time before the start of the continuation + __time = std::max(__time, __continuation_begin); + + sys_seconds __rule_begin = chrono::__from_to_sys_seconds(__continuation.__stdoff, *__rule); + + // The time sought is very likely inside the current rule. + // When the continuation's UNTIL uses the local clock there are edge cases + // where this is not true. + // + // Start to walk the rules to find the proper one. + // + // For now we just walk all the rules TODO TZDB investigate whether a smarter + // algorithm would work. + auto __next = chrono::__next_rule(__rule_begin, __continuation.__stdoff, __rule->__save.__time, __rules, __rule); + + // Ignore small steps, this happens with America/Punta_Arenas for the + // transition + // -4:42:46 - SMT 1927 S + // -5 x -05/-04 1932 S + // ... + // + // R x 1927 1931 - S 1 0 1 - + // R x 1928 1932 - Ap 1 0 0 - + // + // America/Punta_Arenas Thu Sep 1 04:42:45 1927 UT = Thu Sep 1 00:42:45 1927 -04 isdst=1 gmtoff=-14400 + // America/Punta_Arenas Sun Apr 1 03:59:59 1928 UT = Sat Mar 31 23:59:59 1928 -04 isdst=1 gmtoff=-14400 + // America/Punta_Arenas Sun Apr 1 04:00:00 1928 UT = Sat Mar 31 23:00:00 1928 -05 isdst=0 gmtoff=-18000 + // + // Without this there will be a transition + // [1927-09-01 04:42:45, 1927-09-01 05:00:00) -05:00:00 0min -05 + + if (sys_seconds __begin = __rule->__save.__time != 0s ? __rule_begin : __next.first; __time < __begin) { + if (__continuation_begin == sys_seconds::min() || __begin - __continuation_begin > 12h) + return __sys_info{__get_sys_info_before_first_rule( + __continuation_begin, __rule_begin, __next.first, __continuation, __rules, __rule), + false}; + + // Europe/Berlin + // 1 c CE%sT 1945 May 24 2 (C1) + // 1 So CE%sT 1946 (C2) + // + // R c 1944 1945 - Ap M>=1 2s 1 S (R1) + // + // R So 1945 o - May 24 2 2 M (R2) + // + // When C2 becomes active the time would be before the first rule R2, + // giving a 1 hour sys_info. + seconds __save = __rule->__save.__time; + __named_rule_until __continuation_end{__continuation}; + sys_seconds __sys_info_end = std::min(__continuation_end(__save), __next.first); + + return __sys_info{ + sys_info{__continuation_begin, + __sys_info_end, + __continuation.__stdoff + __save, + chrono::duration_cast<minutes>(__save), + chrono::__format(__continuation, __rule->__letters, __save)}, + __sys_info_end == __continuation_end(__save)}; + } + + // See above for America/Asuncion + if (__rule->__save.__time == 0s && __time < __next.first) { + return __sys_info{ + sys_info{__continuation_begin, + __next.first, + __continuation.__stdoff, + 0min, + chrono::__format(__continuation, __rule->__letters, 0s)}, + false}; + } + + if (__rule->__save.__time != 0s) { + // another fix for America/Punta_Arenas when not at the start of the + // sys_info object. + seconds __save = __rule->__save.__time; + if (__continuation_begin >= __rule_begin - __save && __time < __next.first) { + return __sys_info{ + sys_info{__continuation_begin, + __next.first, + __continuation.__stdoff + __save, + chrono::duration_cast<minutes>(__save), + chrono::__format(__continuation, __rule->__letters, __save)}, + false}; + } + } + + __named_rule_until __continuation_end{__continuation}; + while (__next.second != __rules.end()) { +#ifdef PRINT + std::print( + stderr, + "Rule for {}: [{}, {}) off={} save={} duration={}\n", + __time, + __rule_begin, + __next.first, + __continuation.__stdoff, + __rule->__save.__time, + __next.first - __rule_begin); +#endif + + sys_seconds __end = __continuation_end(__rule->__save.__time); + + sys_seconds __sys_info_begin = std::max(__continuation_begin, __rule_begin); + sys_seconds __sys_info_end = std::min(__end, __next.first); + seconds __diff = chrono::abs(__sys_info_end - __sys_info_begin); + + if (__diff < 12h) { + // Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31 + // -4:16:48 - CMT 1920 May + // -4 - -04 1930 D + // -4 A -04/-03 1969 O 5 + // -3 A -03/-02 1999 O 3 + // -4 A -04/-03 2000 Mar 3 + // ... + // + // ... + // R A 1989 1992 - O Su>=15 0 1 - + // R A 1999 o - O Su>=1 0 1 - + // R A 2000 o - Mar 3 0 0 - + // R A 2007 o - D 30 0 1 - + // ... + + // The 1999 switch uses the same rule, but with a different stdoff. + // R A 1999 o - O Su>=1 0 1 - + // stdoff -3 -> 1999-10-03 03:00:00 + // stdoff -4 -> 1999-10-03 04:00:00 + // This generates an invalid entry and this is evaluated as a transition. + // Looking at the zdump like output in libc++ this generates jumps in + // the UTC time. + + __rule = __next.second; + __next = __next_rule(__next.first, __continuation.__stdoff, __rule->__save.__time, __rules, __rule); + __end = __continuation_end(__rule->__save.__time); + __sys_info_end = std::min(__end, __next.first); + } + + if ((__time >= __rule_begin && __time < __next.first) || __next.first >= __end) { + __sys_info_begin = std::max(__continuation_begin, __rule_begin); + __sys_info_end = std::min(__end, __next.first); + + return __sys_info{ + sys_info{__sys_info_begin, + __sys_info_end, + __continuation.__stdoff + __rule->__save.__time, + chrono::duration_cast<minutes>(__rule->__save.__time), + chrono::__format(__continuation, __rule->__letters, __rule->__save.__time)}, + __sys_info_end == __end}; + } + + __rule_begin = __next.first; + __rule = __next.second; + __next = __next_rule(__rule_begin, __continuation.__stdoff, __rule->__save.__time, __rules, __rule); + } + + return __sys_info{ + sys_info{std::max(__continuation_begin, __rule_begin), + __continuation_end(__rule->__save.__time), + __continuation.__stdoff + __rule->__save.__time, + chrono::duration_cast<minutes>(__rule->__save.__time), + chrono::__format(__continuation, __rule->__letters, __rule->__save.__time)}, + true}; +} + +[[nodiscard]] static __sys_info_result __get_sys_info_basic( + sys_seconds __time, sys_seconds __continuation_begin, const __tz::__continuation& __continuation, seconds __save) { + sys_seconds __continuation_end = chrono::__until_to_sys_seconds(__continuation); + return __sys_info{ + sys_info{__continuation_begin, + __continuation_end, + __continuation.__stdoff + __save, + chrono::duration_cast<minutes>(__save), + __continuation.__format}, + true}; +} + +[[nodiscard]] static __sys_info_result +__get_sys_info(sys_seconds __time, + sys_seconds __continuation_begin, + const __tz::__continuation& __continuation, + const __tz::__rules_storage_type& __rules_db) { + return std::visit( + [&](const auto& __value) { + using _Tp = decay_t<decltype(__value)>; + if constexpr (same_as<_Tp, std::string>) + return chrono::__get_sys_info_rule( + __time, __continuation_begin, __continuation, __get_rules(__rules_db, __value)); + else if constexpr (same_as<_Tp, monostate>) + return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, chrono::seconds(0)); + else if constexpr (same_as<_Tp, __tz::__save>) + return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, __value.__time); + else + static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support + + std::__libcpp_unreachable(); + }, + __continuation.__rules); +} + +// The transition from one continuation to the next continuation may result in +// two constitutive continuations with the same "offset" information. +// [time.zone.info.sys]/3 +// The begin and end data members indicate that, for the associated time_zone +// and time_point, the offset and abbrev are in effect in the range +// [begin, end). This information can be used to efficiently iterate the +// transitions of a time_zone. +// +// Note that this does considers a change in the SAVE field not to be a +// different sys_info, zdump does consider this different. +// LWG XXXX The sys_info range should be affected by save +// matches the behaviour of the Standard and zdump. +// +// Iff the "offsets" are the same '__current.__end' is replaced with +// '__next.__end', which effectively merges the two objects in one object. The +// function returns true if a merge occurred. +[[nodiscard]] bool __merge_continuation(sys_info& __current, const sys_info& __next) { + if (__current.end != __next.begin) + return false; + + if (__current.offset != __next.offset || __current.abbrev != __next.abbrev || __current.save != __next.save) + return false; + + __current.end = __next.end; + return true; +} + +//===----------------------------------------------------------------------===// +// Public API +//===----------------------------------------------------------------------===// + +[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI time_zone time_zone::__create(unique_ptr<time_zone::__impl>&& __p) { + _LIBCPP_ASSERT_NON_NULL(__p != nullptr, "initialized time_zone without a valid pimpl object"); + time_zone result; + result.__impl_ = std::move(__p); + return result; +} + +_LIBCPP_EXPORTED_FROM_ABI time_zone::~time_zone() = default; + +[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI string_view time_zone::__name() const noexcept { return __impl_->__name(); } + +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI sys_info +time_zone::__get_info(sys_seconds __time) const { + optional<sys_info> __result; + bool __valid_result = false; // true iff __result.has_value() is true and + // __result.begin <= __time < __result.end is true. + bool __can_merge = false; + sys_seconds __continuation_begin = sys_seconds::min(); + // Iterates over the Zone entry and its continuations. Internally the Zone + // entry is split in a Zone information and the first continuation. The last + // continuation has no UNTIL field. This means the loop should always find a + // continuation. + // + // For more information on background of zone information please consult the + // following information + // [zic manual](https://www.man7.org/linux/man-pages/man8/zic.8.html) + // [tz source info](https://data.iana.org/time-zones/tz-how-to.html) + // On POSIX systems the zdump tool can be useful: + // zdump -v Asia/Hong_Kong + // Gives all transitions in the Hong Kong time zone. + // + // During iteration the result for the current continuation is returned. If + // no continuation is applicable it will return the end time as "error". When + // two continuations are contiguous and contain the "same" information these + // ranges are merged as one range. + // The merging requires keeping any result that occurs before __time, + // likewise when a valid result is found the algorithm needs to test the next + // continuation to see whether it can be merged. For example, Africa/Ceuta + // Continuations + // 0 s WE%sT 1929 (C1) + // 0 - WET 1967 (C2) + // 0 Sp WE%sT 1984 Mar 16 (C3) + // + // Rules + // R s 1926 1929 - O Sa>=1 24s 0 - (R1) + // + // R Sp 1967 o - Jun 3 12 1 S (R2) + // + // The rule R1 is the last rule used in C1. The rule R2 is the first rule in + // C3. Since R2 is the first rule this means when a continuation uses this + // rule its value prior to R2 will be SAVE 0 LETTERS of the first entry with a + // SAVE of 0, in this case WET. + // This gives the following changes in the information. + // 1928-10-07 00:00:00 C1 R1 becomes active: offset 0 save 0 abbrev WET + // 1929-01-01 00:00:00 C2 becomes active: offset 0 save 0 abbrev WET + // 1967-01-01 00:00:00 C3 becomes active: offset 0 save 0 abbrev WET + // 1967-06-03 12:00:00 C3 R2 becomes active: offset 0 save 1 abbrev WEST + // + // The first 3 entries are contiguous and contain the same information, this + // means the period [1928-10-07 00:00:00, 1967-06-03 12:00:00) should be + // returned in one sys_info object. + + const auto& __continuations = __impl_->__continuations(); + const __tz::__rules_storage_type& __rules_db = __impl_->__rules_db(); + for (auto __it = __continuations.begin(); __it != __continuations.end(); ++__it) { + const auto& __continuation = *__it; + __sys_info_result __sys_info = chrono::__get_sys_info(__time, __continuation_begin, __continuation, __rules_db); + + if (__sys_info) { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __sys_info->__info.begin < __sys_info->__info.end, "invalid sys_info range"); + + // Filters out dummy entries + // Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31 + // ... + // -4 A -04/-03 2000 Mar 3 (C1) + // -3 A -03/-02 (C2) + // + // ... + // R A 2000 o - Mar 3 0 0 - + // R A 2007 o - D 30 0 1 - + // ... + // + // This results in an entry + // [2000-03-03 03:00:00, 2000-03-03 04:00:00) -10800s 60min -03 + // for [C1 & R1, C1, R2) which due to the end of the continuation is an + // one hour "sys_info". Instead the entry should be ignored and replaced + // by [C2 & R1, C2 & R2) which is the proper range + // "[2000-03-03 03:00:00, 2007-12-30 03:00:00) -02:00:00 60min -02 + + if (std::holds_alternative<string>(__continuation.__rules) && __sys_info->__can_merge && + __sys_info->__info.begin + 12h > __sys_info->__info.end) { + __continuation_begin = __sys_info->__info.begin; + continue; + } + + if (!__result) { + // First entry found, always keep it. + __result = __sys_info->__info; + + __valid_result = __time >= __result->begin && __time < __result->end; + __can_merge = __sys_info->__can_merge; + } else if (__can_merge && chrono::__merge_continuation(*__result, __sys_info->__info)) { + // The results are merged, update the result state. This may + // "overwrite" a valid sys_info object with another valid sys_info + // object. + __valid_result = __time >= __result->begin && __time < __result->end; + __can_merge = __sys_info->__can_merge; + } else { + // Here things get interesting: + // For example, America/Argentina/San_Luis + // + // -3 A -03/-02 2008 Ja 21 (C1) + // -4 Sa -04/-03 2009 O 11 (C2) + // + // R A 2007 o - D 30 0 1 - (R1) + // + // R Sa 2007 2008 - O Su>=8 0 1 - (R2) + // + // Based on C1 & R1 the end time of C1 is 2008-01-21 03:00:00 + // Based on C2 & R2 the end time of C1 is 2008-01-21 02:00:00 + // In this case the earlier time is the real time of the transition. + // However the algorithm used gives 2008-01-21 03:00:00. + // + // So we need to calculate the previous UNTIL in the current context and + // see whether it's earlier. + + // The results could not be merged. + // - When we have a valid result that result is the final result. + // - Otherwise the result we had is before __time and the result we got + // is at a later time (possibly valid). This result is always better + // than the previous result. + if (__valid_result) { + return *__result; + } else { + _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN( + __it != __continuations.begin(), "the first rule should always seed the result"); + const auto& __last = *(__it - 1); + if (std::holds_alternative<string>(__last.__rules)) { + // Europe/Berlin + // 1 c CE%sT 1945 May 24 2 (C1) + // 1 So CE%sT 1946 (C2) + // + // R c 1944 1945 - Ap M>=1 2s 1 S (R1) + // + // R So 1945 o - May 24 2 2 M (R2) + // + // When C2 becomes active the time would be before the first rule R2, + // giving a 1 hour sys_info. This is not valid and the results need + // merging. + + if (__result->end != __sys_info->__info.begin) { + // When the UTC gap between the rules is due to the change of + // offsets adjust the new time to remove the gap. + sys_seconds __end = __result->end - __result->offset; + sys_seconds __begin = __sys_info->__info.begin - __sys_info->__info.offset; + if (__end == __begin) { + __sys_info->__info.begin = __result->end; + } + } + } + + __result = __sys_info->__info; + __valid_result = __time >= __result->begin && __time < __result->end; + __can_merge = __sys_info->__can_merge; + } + } + __continuation_begin = __result->end; + } else { + __continuation_begin = __sys_info.error(); + } + } + if (__valid_result) + return *__result; + + std::__throw_runtime_error("tzdb: corrupt db"); +} + +// Is the "__local_time" present in "__first" and "__second". If so the +// local_info has an ambiguous result. +[[nodiscard]] static bool +__is_ambiguous(local_seconds __local_time, const sys_info& __first, const sys_info& __second) { + std::chrono::local_seconds __end_first{__first.end.time_since_epoch() + __first.offset}; + std::chrono::local_seconds __begin_second{__second.begin.time_since_epoch() + __second.offset}; + + return __local_time < __end_first && __local_time >= __begin_second; +} + +// Determines the result of the "__local_time". This expects the object +// "__first" to be earlier in time than "__second". +[[nodiscard]] static local_info +__get_info(local_seconds __local_time, const sys_info& __first, const sys_info& __second) { + std::chrono::local_seconds __end_first{__first.end.time_since_epoch() + __first.offset}; + std::chrono::local_seconds __begin_second{__second.begin.time_since_epoch() + __second.offset}; + + if (__local_time < __end_first) { + if (__local_time >= __begin_second) + // |--------| + // |------| + // ^ + return {local_info::ambiguous, __first, __second}; + + // |--------| + // |------| + // ^ + return {local_info::unique, __first, sys_info{}}; + } + + if (__local_time < __begin_second) + // |--------| + // |------| + // ^ + return {local_info::nonexistent, __first, __second}; + + // |--------| + // |------| + // ^ + return {local_info::unique, __second, sys_info{}}; +} + +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI local_info +time_zone::__get_info(local_seconds __local_time) const { + seconds __local_seconds = __local_time.time_since_epoch(); + + /* An example of a typical year with a DST switch displayed in local time. + * + * At the first of April the time goes forward one hour. This means the + * time marked with ~~ is not a valid local time. This is represented by the + * nonexistent value in local_info.result. + * + * At the first of November the time goes backward one hour. This means the + * time marked with ^^ happens twice. This is represented by the ambiguous + * value in local_info.result. + * + * 2020.11.01 2021.04.01 2021.11.01 + * offset +05 offset +05 offset +05 + * save 0s save 1h save 0s + * |------------//----------| + * |---------//--------------| + * |------------- + * ~~ ^^ + * + * These shifts can happen due to changes in the current time zone for a + * location. For example, Indian/Kerguelen switched only once. In 1950 from an + * offset of 0 hours to an offset of +05 hours. + * + * During all these shifts the UTC time will not have gaps. + */ + + // The code needs to determine the system time for the local time. There is no + // information available. Assume the offset between system time and local time + // is 0s. This gives an initial estimate. + sys_seconds __guess{__local_seconds}; + sys_info __info = __get_info(__guess); + + // At this point the offset can be used to determine an estimate for the local + // time. Before doing that, determine the offset and validate whether the + // local time is the range [chrono::local_seconds::min(), + // chrono::local_seconds::max()). + if (__local_seconds < 0s && __info.offset > 0s) + if (__local_seconds - chrono::local_seconds::min().time_since_epoch() < __info.offset) + return {-1, __info, {}}; + + if (__local_seconds > 0s && __info.offset < 0s) + if (chrono::local_seconds::max().time_since_epoch() - __local_seconds < -__info.offset) + return {-2, __info, {}}; + + // Based on the information found in the sys_info, the local time can be + // converted to a system time. This resulting time can be in the following + // locations of the sys_info: + // + // |---------//--------------| + // 1 2.1 2.2 2.3 3 + // + // 1. The estimate is before the returned sys_info object. + // The result is either non-existent or unique in the previous sys_info. + // 2. The estimate is in the sys_info object + // - If the sys_info begin is not sys_seconds::min(), then it might be at + // 2.1 and could be ambiguous with the previous or unique. + // - If sys_info end is not sys_seconds::max(), then it might be at 2.3 + // and could be ambiguous with the next or unique. + // - Else it is at 2.2 and always unique. This case happens when a + // time zone has no transitions. For example, UTC or GMT+1. + // 3. The estimate is after the returned sys_info object. + // The result is either non-existent or unique in the next sys_info. + // + // There is no specification where the "middle" starts. Similar issues can + // happen when sys_info objects are "short", then "unique in the next" could + // become "ambiguous in the next and the one following". Theoretically there + // is the option of the following time-line + // + // |------------| + // |----| + // |-----------------| + // + // However the local_info object only has 2 sys_info objects, so this option + // is not tested. + + sys_seconds __sys_time{__local_seconds - __info.offset}; + if (__sys_time < __info.begin) + // Case 1 before __info + return chrono::__get_info(__local_time, __get_info(__info.begin - 1s), __info); + + if (__sys_time >= __info.end) + // Case 3 after __info + return chrono::__get_info(__local_time, __info, __get_info(__info.end)); + + // Case 2 in __info + if (__info.begin != sys_seconds::min()) { + // Case 2.1 Not at the beginning, when not ambiguous the result should test + // case 2.3. + sys_info __prev = __get_info(__info.begin - 1s); + if (__is_ambiguous(__local_time, __prev, __info)) + return {local_info::ambiguous, __prev, __info}; + } + + if (__info.end == sys_seconds::max()) + // At the end so it's case 2.2 + return {local_info::unique, __info, sys_info{}}; + + // This tests case 2.2 or case 2.3. + return chrono::__get_info(__local_time, __info, __get_info(__info.end)); +} + +} // namespace chrono + +_LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/src/tzdb.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/tzdb.cpp index 0307f754ca..d22de21c99 100644 --- a/contrib/libs/cxxsupp/libcxx/src/tzdb.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/tzdb.cpp @@ -15,7 +15,6 @@ #include <stdexcept> #include <string> -#include "include/tzdb/time_zone_link_private.h" #include "include/tzdb/time_zone_private.h" #include "include/tzdb/types_private.h" #include "include/tzdb/tzdb_list_private.h" @@ -560,7 +559,7 @@ static void __parse_rule(tzdb& __tzdb, __tz::__rules_storage_type& __rules, istr static void __parse_zone(tzdb& __tzdb, __tz::__rules_storage_type& __rules, istream& __input) { chrono::__skip_mandatory_whitespace(__input); - auto __p = std::make_unique<time_zone::__impl>(chrono::__parse_string(__input)); + auto __p = std::make_unique<time_zone::__impl>(chrono::__parse_string(__input), __rules); vector<__tz::__continuation>& __continuations = __p->__continuations(); chrono::__skip_mandatory_whitespace(__input); @@ -581,7 +580,7 @@ static void __parse_link(tzdb& __tzdb, istream& __input) { string __name = chrono::__parse_string(__input); chrono::__skip_line(__input); - __tzdb.links.emplace_back(time_zone_link::__constructor_tag{}, std::move(__name), std::move(__target)); + __tzdb.links.emplace_back(std::__private_constructor_tag{}, std::move(__name), std::move(__target)); } static void __parse_tzdata(tzdb& __db, __tz::__rules_storage_type& __rules, istream& __input) { @@ -622,26 +621,146 @@ static void __parse_tzdata(tzdb& __db, __tz::__rules_storage_type& __rules, istr } } +static void __parse_leap_seconds(vector<leap_second>& __leap_seconds, istream&& __input) { + // The file stores dates since 1 January 1900, 00:00:00, we want + // seconds since 1 January 1970. + constexpr auto __offset = sys_days{1970y / January / 1} - sys_days{1900y / January / 1}; + + struct __entry { + sys_seconds __timestamp; + seconds __value; + }; + vector<__entry> __entries; + [&] { + while (true) { + switch (__input.peek()) { + case istream::traits_type::eof(): + return; + + case ' ': + case '\t': + case '\n': + __input.get(); + continue; + + case '#': + chrono::__skip_line(__input); + continue; + } + + sys_seconds __date = sys_seconds{seconds{chrono::__parse_integral(__input, false)}} - __offset; + chrono::__skip_mandatory_whitespace(__input); + seconds __value{chrono::__parse_integral(__input, false)}; + chrono::__skip_line(__input); + + __entries.emplace_back(__date, __value); + } + }(); + // The Standard requires the leap seconds to be sorted. The file + // leap-seconds.list usually provides them in sorted order, but that is not + // guaranteed so we ensure it here. + ranges::sort(__entries, {}, &__entry::__timestamp); + + // The database should contain the number of seconds inserted by a leap + // second (1 or -1). So the difference between the two elements is stored. + // std::ranges::views::adjacent has not been implemented yet. + (void)ranges::adjacent_find(__entries, [&](const __entry& __first, const __entry& __second) { + __leap_seconds.emplace_back( + std::__private_constructor_tag{}, __second.__timestamp, __second.__value - __first.__value); + return false; + }); +} + void __init_tzdb(tzdb& __tzdb, __tz::__rules_storage_type& __rules) { filesystem::path __root = chrono::__libcpp_tzdb_directory(); ifstream __tzdata{__root / "tzdata.zi"}; __tzdb.version = chrono::__parse_version(__tzdata); chrono::__parse_tzdata(__tzdb, __rules, __tzdata); - std::ranges::sort(__tzdb.zones); - std::ranges::sort(__tzdb.links); - std::ranges::sort(__rules, {}, [](const auto& p) { return p.first; }); + ranges::sort(__tzdb.zones); + ranges::sort(__tzdb.links); + ranges::sort(__rules, {}, [](const auto& p) { return p.first; }); + + // There are two files with the leap second information + // - leapseconds as specified by zic + // - leap-seconds.list the source data + // The latter is much easier to parse, it seems Howard shares that + // opinion. + chrono::__parse_leap_seconds(__tzdb.leap_seconds, ifstream{__root / "leap-seconds.list"}); +} + +#ifdef _WIN32 +[[nodiscard]] static const time_zone* __current_zone_windows(const tzdb& tzdb) { + // TODO TZDB Implement this on Windows. + std::__throw_runtime_error("unknown time zone"); +} +#else // ifdef _WIN32 +[[nodiscard]] static const time_zone* __current_zone_posix(const tzdb& tzdb) { + // On POSIX systems there are several ways to configure the time zone. + // In order of priority they are: + // - TZ environment variable + // https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08 + // The documentation is unclear whether or not it's allowed to + // change time zone information. For example the TZ string + // MST7MDT + // this is an entry in tzdata.zi. The value + // MST + // is also an entry. Is it allowed to use the following? + // MST-3 + // Even when this is valid there is no time_zone record in the + // database. Since the library would need to return a valid pointer, + // this means the library needs to allocate and leak a pointer. + // + // - The time zone name is the target of the symlink /etc/localtime + // relative to /usr/share/zoneinfo/ + + // The algorithm is like this: + // - If the environment variable TZ is set and points to a valid + // record use this value. + // - Else use the name based on the `/etc/localtime` symlink. + + if (const char* __tz = getenv("TZ")) + if (const time_zone* __result = tzdb.__locate_zone(__tz)) + return __result; + + filesystem::path __path = "/etc/localtime"; + if (!filesystem::exists(__path)) + std::__throw_runtime_error("tzdb: the symlink '/etc/localtime' does not exist"); + + if (!filesystem::is_symlink(__path)) + std::__throw_runtime_error("tzdb: the path '/etc/localtime' is not a symlink"); + + filesystem::path __tz = filesystem::read_symlink(__path); + // The path may be a relative path, in that case convert it to an absolute + // path based on the proper initial directory. + if (__tz.is_relative()) + __tz = filesystem::canonical("/etc" / __tz); + + string __name = filesystem::relative(__tz, "/usr/share/zoneinfo/"); + if (const time_zone* __result = tzdb.__locate_zone(__name)) + return __result; + + std::__throw_runtime_error(("tzdb: the time zone '" + __name + "' is not found in the database").c_str()); } +#endif // ifdef _WIN32 //===----------------------------------------------------------------------===// // Public API //===----------------------------------------------------------------------===// -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list() { +_LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list() { static tzdb_list __result{new tzdb_list::__impl()}; return __result; } +[[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const time_zone* tzdb::__current_zone() const { +#ifdef _WIN32 + return chrono::__current_zone_windows(*this); +#else + return chrono::__current_zone_posix(*this); +#endif +} + _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb() { if (chrono::remote_version() == chrono::get_tzdb().version) return chrono::get_tzdb(); @@ -649,7 +768,7 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb() { return chrono::get_tzdb_list().__implementation().__load(); } -_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version() { +_LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version() { filesystem::path __root = chrono::__libcpp_tzdb_directory(); ifstream __tzdata{__root / "tzdata.zi"}; return chrono::__parse_version(__tzdata); diff --git a/contrib/libs/cxxsupp/libcxx/src/tzdb_list.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/tzdb_list.cpp index b99c30a9b9..b99c30a9b9 100644 --- a/contrib/libs/cxxsupp/libcxx/src/tzdb_list.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/experimental/tzdb_list.cpp diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp index fa31f05b2d..fd770e1a4e 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp @@ -109,26 +109,23 @@ void __copy(const path& from, const path& to, copy_options options, error_code* const bool sym_status2 = bool(options & copy_options::copy_symlinks); error_code m_ec1; - StatT f_st = {}; + StatT f_st; const file_status f = sym_status || sym_status2 ? detail::posix_lstat(from, f_st, &m_ec1) : detail::posix_stat(from, f_st, &m_ec1); if (m_ec1) return err.report(m_ec1); - StatT t_st = {}; + StatT t_st; const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec1) : detail::posix_stat(to, t_st, &m_ec1); if (not status_known(t)) return err.report(m_ec1); if (!exists(f) || is_other(f) || is_other(t) || (is_directory(f) && is_regular_file(t)) || - detail::stat_equivalent(f_st, t_st)) { + (exists(t) && detail::stat_equivalent(f_st, t_st))) { return err.report(errc::function_not_supported); } - if (ec) - ec->clear(); - if (is_symlink(f)) { if (bool(copy_options::skip_symlinks & options)) { // do nothing @@ -166,15 +163,15 @@ void __copy(const path& from, const path& to, copy_options options, error_code* return; } error_code m_ec2; - for (; it != directory_iterator(); it.increment(m_ec2)) { - if (m_ec2) { - return err.report(m_ec2); - } + for (; !m_ec2 && it != directory_iterator(); it.increment(m_ec2)) { __copy(it->path(), to / it->path().filename(), options | copy_options::__in_recursive_copy, ec); if (ec && *ec) { return; } } + if (m_ec2) { + return err.report(m_ec2); + } } } @@ -936,23 +933,28 @@ path __weakly_canonical(const path& p, error_code* ec) { --PP; vector<string_view_t> DNEParts; - while (PP.State != PathParser::PS_BeforeBegin) { + error_code m_ec; + while (PP.State_ != PathParser::PS_BeforeBegin) { tmp.assign(createView(p.native().data(), &PP.RawEntry.back())); - error_code m_ec; file_status st = __status(tmp, &m_ec); if (!status_known(st)) { return err.report(m_ec); } else if (exists(st)) { - result = __canonical(tmp, ec); + result = __canonical(tmp, &m_ec); + if (m_ec) { + return err.report(m_ec); + } break; } DNEParts.push_back(*PP); --PP; } - if (PP.State == PathParser::PS_BeforeBegin) - result = __canonical("", ec); - if (ec) - ec->clear(); + if (PP.State_ == PathParser::PS_BeforeBegin) { + result = __canonical("", &m_ec); + if (m_ec) { + return err.report(m_ec); + } + } if (DNEParts.empty()) return result; for (auto It = DNEParts.rbegin(); It != DNEParts.rend(); ++It) diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp index c89346aa51..b201952137 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp @@ -45,23 +45,23 @@ path& path::replace_extension(path const& replacement) { string_view_t path::__root_name() const { auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) + if (PP.State_ == PathParser::PS_InRootName) return *PP; return {}; } string_view_t path::__root_directory() const { auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) + if (PP.State_ == PathParser::PS_InRootName) ++PP; - if (PP.State == PathParser::PS_InRootDir) + if (PP.State_ == PathParser::PS_InRootDir) return *PP; return {}; } string_view_t path::__root_path_raw() const { auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) { + if (PP.State_ == PathParser::PS_InRootName) { auto NextCh = PP.peek(); if (NextCh && isSeparator(*NextCh)) { ++PP; @@ -69,24 +69,24 @@ string_view_t path::__root_path_raw() const { } return PP.RawEntry; } - if (PP.State == PathParser::PS_InRootDir) + if (PP.State_ == PathParser::PS_InRootDir) return *PP; return {}; } static bool ConsumeRootName(PathParser* PP) { static_assert(PathParser::PS_BeforeBegin == 1 && PathParser::PS_InRootName == 2, "Values for enums are incorrect"); - while (PP->State <= PathParser::PS_InRootName) + while (PP->State_ <= PathParser::PS_InRootName) ++(*PP); - return PP->State == PathParser::PS_AtEnd; + return PP->State_ == PathParser::PS_AtEnd; } static bool ConsumeRootDir(PathParser* PP) { static_assert(PathParser::PS_BeforeBegin == 1 && PathParser::PS_InRootName == 2 && PathParser::PS_InRootDir == 3, "Values for enums are incorrect"); - while (PP->State <= PathParser::PS_InRootDir) + while (PP->State_ <= PathParser::PS_InRootDir) ++(*PP); - return PP->State == PathParser::PS_AtEnd; + return PP->State_ == PathParser::PS_AtEnd; } string_view_t path::__relative_path() const { @@ -248,7 +248,7 @@ path path::lexically_relative(const path& base) const { auto PP = PathParser::CreateBegin(__pn_); auto PPBase = PathParser::CreateBegin(base.__pn_); auto CheckIterMismatchAtBase = [&]() { - return PP.State != PPBase.State && (PP.inRootPath() || PPBase.inRootPath()); + return PP.State_ != PPBase.State_ && (PP.inRootPath() || PPBase.inRootPath()); }; if (PP.inRootName() && PPBase.inRootName()) { if (*PP != *PPBase) @@ -267,7 +267,7 @@ path path::lexically_relative(const path& base) const { // Find the first mismatching element auto PP = PathParser::CreateBegin(__pn_); auto PPBase = PathParser::CreateBegin(base.__pn_); - while (PP && PPBase && PP.State == PPBase.State && *PP == *PPBase) { + while (PP && PPBase && PP.State_ == PPBase.State_ && *PP == *PPBase) { ++PP; ++PPBase; } @@ -380,7 +380,7 @@ path::iterator path::begin() const { auto PP = PathParser::CreateBegin(__pn_); iterator it; it.__path_ptr_ = this; - it.__state_ = static_cast<path::iterator::_ParserState>(PP.State); + it.__state_ = static_cast<path::iterator::_ParserState>(PP.State_); it.__entry_ = PP.RawEntry; it.__stashed_elem_.__assign_view(*PP); return it; @@ -396,7 +396,7 @@ path::iterator path::end() const { path::iterator& path::iterator::__increment() { PathParser PP(__path_ptr_->native(), __entry_, __state_); ++PP; - __state_ = static_cast<_ParserState>(PP.State); + __state_ = static_cast<_ParserState>(PP.State_); __entry_ = PP.RawEntry; __stashed_elem_.__assign_view(*PP); return *this; @@ -405,7 +405,7 @@ path::iterator& path::iterator::__increment() { path::iterator& path::iterator::__decrement() { PathParser PP(__path_ptr_->native(), __entry_, __state_); --PP; - __state_ = static_cast<_ParserState>(PP.State); + __state_ = static_cast<_ParserState>(PP.State_); __entry_ = PP.RawEntry; __stashed_elem_.__assign_view(*PP); return *this; diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h index 28a8f240e3..0662369645 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h @@ -50,14 +50,14 @@ struct PathParser { const string_view_t Path; string_view_t RawEntry; - ParserState State; + ParserState State_; private: - PathParser(string_view_t P, ParserState State) noexcept : Path(P), State(State) {} + PathParser(string_view_t P, ParserState State) noexcept : Path(P), State_(State) {} public: PathParser(string_view_t P, string_view_t E, unsigned char S) - : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) { + : Path(P), RawEntry(E), State_(static_cast<ParserState>(S)) { // S cannot be '0' or PS_BeforeBegin. } @@ -84,7 +84,7 @@ public: if (Start == End) return makeState(PS_AtEnd); - switch (State) { + switch (State_) { case PS_BeforeBegin: { PosPtr TkEnd = consumeRootName(Start, End); if (TkEnd) @@ -125,7 +125,7 @@ public: if (RStart == REnd) // we're decrementing the begin return makeState(PS_BeforeBegin); - switch (State) { + switch (State_) { case PS_AtEnd: { // Try to consume a trailing separator or root directory first. if (PosPtr SepEnd = consumeAllSeparators(RStart, REnd)) { @@ -169,7 +169,7 @@ public: /// \brief Return a view with the "preferred representation" of the current /// element. For example trailing separators are represented as a '.' string_view_t operator*() const noexcept { - switch (State) { + switch (State_) { case PS_BeforeBegin: case PS_AtEnd: return PATHSTR(""); @@ -187,7 +187,7 @@ public: __libcpp_unreachable(); } - explicit operator bool() const noexcept { return State != PS_BeforeBegin && State != PS_AtEnd; } + explicit operator bool() const noexcept { return State_ != PS_BeforeBegin && State_ != PS_AtEnd; } PathParser& operator++() noexcept { increment(); @@ -199,21 +199,21 @@ public: return *this; } - bool atEnd() const noexcept { return State == PS_AtEnd; } + bool atEnd() const noexcept { return State_ == PS_AtEnd; } - bool inRootDir() const noexcept { return State == PS_InRootDir; } + bool inRootDir() const noexcept { return State_ == PS_InRootDir; } - bool inRootName() const noexcept { return State == PS_InRootName; } + bool inRootName() const noexcept { return State_ == PS_InRootName; } bool inRootPath() const noexcept { return inRootName() || inRootDir(); } private: void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept { - State = NewState; + State_ = NewState; RawEntry = string_view_t(Start, End - Start); } void makeState(ParserState NewState) noexcept { - State = NewState; + State_ = NewState; RawEntry = {}; } @@ -224,7 +224,7 @@ private: /// \brief Return a pointer to the first character after the currently /// lexed element. PosPtr getNextTokenStartPos() const noexcept { - switch (State) { + switch (State_) { case PS_BeforeBegin: return Path.data(); case PS_InRootName: @@ -241,7 +241,7 @@ private: /// \brief Return a pointer to the first character in the currently lexed /// element. PosPtr getCurrentTokenStartPos() const noexcept { - switch (State) { + switch (State_) { case PS_BeforeBegin: case PS_InRootName: return &Path.front(); diff --git a/contrib/libs/cxxsupp/libcxx/src/functional.cpp b/contrib/libs/cxxsupp/libcxx/src/functional.cpp index 570bb78e15..ef53e3e84d 100644 --- a/contrib/libs/cxxsupp/libcxx/src/functional.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/functional.cpp @@ -10,9 +10,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION bad_function_call::~bad_function_call() noexcept {} -#endif #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE const char* bad_function_call::what() const noexcept { return "std::bad_function_call"; } diff --git a/contrib/libs/cxxsupp/libcxx/src/include/overridable_function.h b/contrib/libs/cxxsupp/libcxx/src/include/overridable_function.h index 7b0fba10f4..10e7a856c3 100644 --- a/contrib/libs/cxxsupp/libcxx/src/include/overridable_function.h +++ b/contrib/libs/cxxsupp/libcxx/src/include/overridable_function.h @@ -13,6 +13,10 @@ #include <__config> #include <cstdint> +#if defined(__arm64e__) && __has_feature(ptrauth_calls) +#error # include <ptrauth.h> +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif @@ -81,6 +85,14 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no uintptr_t __end = reinterpret_cast<uintptr_t>(&__lcxx_override_end); uintptr_t __ptr = reinterpret_cast<uintptr_t>(__fptr); +#if defined(__arm64e__) && __has_feature(ptrauth_calls) + // We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular, + // we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt + // to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just + // stripped the function pointer. See rdar://122927845. + __ptr = reinterpret_cast<uintptr_t>(ptrauth_strip(reinterpret_cast<void*>(__ptr), ptrauth_key_function_pointer)); +#endif + // Finally, the function was overridden if it falls outside of the section's bounds. return __ptr < __start || __ptr > __end; } diff --git a/contrib/libs/cxxsupp/libcxx/src/locale.cpp b/contrib/libs/cxxsupp/libcxx/src/locale.cpp index 1b937dcf97..219575b204 100644 --- a/contrib/libs/cxxsupp/libcxx/src/locale.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/locale.cpp @@ -102,8 +102,6 @@ inline constexpr size_t countof(const T* const begin, const T* const end) { return static_cast<size_t>(end - begin); } -} // namespace - string build_name(const string& other, const string& one, locale::category c) { if (other == "*" || one == "*") return "*"; @@ -115,6 +113,8 @@ string build_name(const string& other, const string& one, locale::category c) { return "*"; } +} // namespace + const locale::category locale::none; const locale::category locale::collate; const locale::category locale::ctype; @@ -497,7 +497,7 @@ constinit __no_destroy<locale::__imp> locale::__imp::classic_locale_imp_(__uninitialized_tag{}); // initialized below in classic() const locale& locale::classic() { - static const __no_destroy<locale> classic_locale(__private_tag{}, [] { + static const __no_destroy<locale> classic_locale(__private_constructor_tag{}, [] { // executed exactly once on first initialization of `classic_locale` locale::__imp::classic_locale_imp_.__emplace(1u); return &locale::__imp::classic_locale_imp_.__get(); @@ -557,9 +557,9 @@ locale::locale(const locale& other, const locale& one, category c) string locale::name() const { return __locale_->name(); } -void locale::__install_ctor(const locale& other, facet* f, long id) { +void locale::__install_ctor(const locale& other, facet* f, long facet_id) { if (f) - __locale_ = new __imp(*other.__locale_, f, id); + __locale_ = new __imp(*other.__locale_, f, facet_id); else __locale_ = other.__locale_; __locale_->acquire(); diff --git a/contrib/libs/cxxsupp/libcxx/src/optional.cpp b/contrib/libs/cxxsupp/libcxx/src/optional.cpp index 6ba63f2d89..62b474a312 100644 --- a/contrib/libs/cxxsupp/libcxx/src/optional.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/optional.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include <__availability> #include <optional> #include <stdexcept> diff --git a/contrib/libs/cxxsupp/libcxx/src/ostream.cpp b/contrib/libs/cxxsupp/libcxx/src/ostream.cpp index 443dce9a39..e1a9a4bc1d 100644 --- a/contrib/libs/cxxsupp/libcxx/src/ostream.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/ostream.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include <__availability> #include <__config> #ifndef _LIBCPP_HAS_NO_FILESYSTEM # include <fstream> diff --git a/contrib/libs/cxxsupp/libcxx/src/pstl/libdispatch.cpp b/contrib/libs/cxxsupp/libcxx/src/pstl/libdispatch.cpp index 52d4afbcce..3dca702341 100644 --- a/contrib/libs/cxxsupp/libcxx/src/pstl/libdispatch.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/pstl/libdispatch.cpp @@ -7,13 +7,12 @@ //===----------------------------------------------------------------------===// #include <__algorithm/min.h> -#include <__algorithm/pstl_backends/cpu_backends/libdispatch.h> #include <__config> +#include <__pstl/backends/libdispatch.h> #include <dispatch/dispatch.h> _LIBCPP_BEGIN_NAMESPACE_STD - -namespace __par_backend::inline __libdispatch { +namespace __pstl::__libdispatch { void __dispatch_apply(size_t chunk_count, void* context, void (*func)(void* context, size_t chunk)) noexcept { ::dispatch_apply_f(chunk_count, DISPATCH_APPLY_AUTO, context, func); @@ -29,7 +28,5 @@ __chunk_partitions __partition_chunks(ptrdiff_t element_count) noexcept { return partitions; } -// NOLINTNEXTLINE(llvm-namespace-comment) // This is https://llvm.org/PR56804 -} // namespace __par_backend::inline __libdispatch - +} // namespace __pstl::__libdispatch _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/src/random.cpp b/contrib/libs/cxxsupp/libcxx/src/random.cpp index 93590af310..14c6f4473d 100644 --- a/contrib/libs/cxxsupp/libcxx/src/random.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/random.cpp @@ -79,10 +79,8 @@ unsigned random_device::operator()() { char* p = reinterpret_cast<char*>(&r); while (n > 0) { ssize_t s = read(__f_, p, n); - _LIBCPP_SUPPRESS_DEPRECATED_PUSH if (s == 0) - __throw_system_error(ENODATA, "random_device got EOF"); // TODO ENODATA -> ENOMSG - _LIBCPP_SUPPRESS_DEPRECATED_POP + __throw_system_error(ENOMSG, "random_device got EOF"); if (s == -1) { if (errno != EINTR) __throw_system_error(errno, "random_device got an unexpected error"); diff --git a/contrib/libs/cxxsupp/libcxx/src/support/win32/compiler_rt_shims.cpp b/contrib/libs/cxxsupp/libcxx/src/support/win32/compiler_rt_shims.cpp new file mode 100644 index 0000000000..ab26322490 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/src/support/win32/compiler_rt_shims.cpp @@ -0,0 +1,110 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// +// This file reimplements builtins that are normally provided by compiler-rt, which is +// not provided on Windows. This should go away once compiler-rt is shipped on Windows. +// + +#include <cmath> +#include <complex> + +template <class T> +static std::__complex_t<T> mul_impl(T a, T b, T c, T d) { + T __ac = a * c; + T __bd = b * d; + T __ad = a * d; + T __bc = b * c; + T __x = __ac - __bd; + T __y = __ad + __bc; + if (std::isnan(__x) && std::isnan(__y)) { + bool recalc = false; + if (std::isinf(a) || std::isinf(b)) { + a = std::copysign(std::isinf(a) ? T(1) : T(0), a); + b = std::copysign(std::isinf(b) ? T(1) : T(0), b); + if (std::isnan(c)) + c = std::copysign(T(0), c); + if (std::isnan(d)) + d = std::copysign(T(0), d); + recalc = true; + } + if (std::isinf(c) || std::isinf(d)) { + c = std::copysign(std::isinf(c) ? T(1) : T(0), c); + d = std::copysign(std::isinf(d) ? T(1) : T(0), d); + if (std::isnan(a)) + a = std::copysign(T(0), a); + if (std::isnan(b)) + b = std::copysign(T(0), b); + recalc = true; + } + if (!recalc && (std::isinf(__ac) || std::isinf(__bd) || std::isinf(__ad) || std::isinf(__bc))) { + if (std::isnan(a)) + a = std::copysign(T(0), a); + if (std::isnan(b)) + b = std::copysign(T(0), b); + if (std::isnan(c)) + c = std::copysign(T(0), c); + if (std::isnan(d)) + d = std::copysign(T(0), d); + recalc = true; + } + if (recalc) { + __x = T(INFINITY) * (a * c - b * d); + __y = T(INFINITY) * (a * d + b * c); + } + } + return {__x, __y}; +} + +extern "C" _LIBCPP_EXPORTED_FROM_ABI _Complex double __muldc3(double a, double b, double c, double d) { + return mul_impl(a, b, c, d); +} + +extern "C" _LIBCPP_EXPORTED_FROM_ABI _Complex float __mulsc3(float a, float b, float c, float d) { + return mul_impl(a, b, c, d); +} + +template <class T> +std::__complex_t<T> div_impl(T a, T b, T c, T d) { + int ilogbw = 0; + T __logbw = std::logb(std::fmax(std::fabs(c), std::fabs(d))); + if (std::isfinite(__logbw)) { + ilogbw = static_cast<int>(__logbw); + c = std::scalbn(c, -ilogbw); + d = std::scalbn(d, -ilogbw); + } + + T denom = c * c + d * d; + T x = std::scalbn((a * c + b * d) / denom, -ilogbw); + T y = std::scalbn((b * c - a * d) / denom, -ilogbw); + if (std::isnan(x) && std::isnan(y)) { + if ((denom == T(0)) && (!std::isnan(a) || !std::isnan(b))) { + x = std::copysign(T(INFINITY), c) * a; + y = std::copysign(T(INFINITY), c) * b; + } else if ((std::isinf(a) || std::isinf(b)) && std::isfinite(c) && std::isfinite(d)) { + a = std::copysign(std::isinf(a) ? T(1) : T(0), a); + b = std::copysign(std::isinf(b) ? T(1) : T(0), b); + x = T(INFINITY) * (a * c + b * d); + y = T(INFINITY) * (b * c - a * d); + } else if (std::isinf(__logbw) && __logbw > T(0) && std::isfinite(a) && std::isfinite(b)) { + c = std::copysign(std::isinf(c) ? T(1) : T(0), c); + d = std::copysign(std::isinf(d) ? T(1) : T(0), d); + x = T(0) * (a * c + b * d); + y = T(0) * (b * c - a * d); + } + } + return {x, y}; +} + +extern "C" _LIBCPP_EXPORTED_FROM_ABI _Complex double __divdc3(double a, double b, double c, double d) { + return div_impl(a, b, c, d); +} + +extern "C" _LIBCPP_EXPORTED_FROM_ABI _Complex float __divsc3(float a, float b, float c, float d) { + return div_impl(a, b, c, d); +} diff --git a/contrib/libs/cxxsupp/libcxx/src/time_zone.cpp b/contrib/libs/cxxsupp/libcxx/src/time_zone.cpp deleted file mode 100644 index b6bf06a116..0000000000 --- a/contrib/libs/cxxsupp/libcxx/src/time_zone.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html - -#include <chrono> - -#include "include/tzdb/time_zone_private.h" - -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace chrono { - -[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI time_zone time_zone::__create(unique_ptr<time_zone::__impl>&& __p) { - _LIBCPP_ASSERT_NON_NULL(__p != nullptr, "initialized time_zone without a valid pimpl object"); - time_zone result; - result.__impl_ = std::move(__p); - return result; -} - -_LIBCPP_EXPORTED_FROM_ABI time_zone::~time_zone() = default; - -[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI string_view time_zone::__name() const noexcept { return __impl_->__name(); } - -} // namespace chrono - -_LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/ya.make b/contrib/libs/cxxsupp/libcxx/ya.make index a3f6634764..122c16d4f7 100644 --- a/contrib/libs/cxxsupp/libcxx/ya.make +++ b/contrib/libs/cxxsupp/libcxx/ya.make @@ -14,9 +14,9 @@ LICENSE( LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(2024-04-02) +VERSION(2024-07-08) -ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/239236b8c2154aa49e98bc7ed774a7d2712edf50.tar.gz) +ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/8ab82a2dc308c27fbdd0a87b5be7dddc623f1b0e.tar.gz) ADDINCL( GLOBAL contrib/libs/cxxsupp/libcxx/include @@ -48,10 +48,11 @@ ELSEIF (OS_LINUX OR OS_DARWIN) ELSEIF (OS_WINDOWS) SET(CXX_RT "msvcrt") SRCS( - src/support/win32/locale_win32.cpp - src/support/win32/support.cpp src/support/win32/atomic_win32.cpp + src/support/win32/compiler_rt_shims.cpp + src/support/win32/locale_win32.cpp src/support/win32/new_win32.cpp + src/support/win32/support.cpp src/support/win32/thread_win32.cpp ) IF (CLANG_CL) @@ -173,6 +174,7 @@ SRCS( src/condition_variable_destructor.cpp src/error_category.cpp src/exception.cpp + src/expected.cpp src/filesystem/directory_entry.cpp src/filesystem/directory_iterator.cpp src/filesystem/filesystem_clock.cpp @@ -224,9 +226,10 @@ ENDIF() IF (OS_LINUX) SRCS( - src/time_zone.cpp - src/tzdb.cpp - src/tzdb_list.cpp + src/experimental/chrono_exception.cpp + src/experimental/time_zone.cpp + src/experimental/tzdb.cpp + src/experimental/tzdb_list.cpp ) ENDIF() diff --git a/contrib/libs/jinja2cpp/src/internal_value.cpp b/contrib/libs/jinja2cpp/src/internal_value.cpp index 7683bc2c97..7bcfc7fc56 100644 --- a/contrib/libs/jinja2cpp/src/internal_value.cpp +++ b/contrib/libs/jinja2cpp/src/internal_value.cpp @@ -8,6 +8,20 @@ namespace jinja2 { +void InternalValue::SetParentData(const InternalValue& val) { + m_parentData = val.GetData(); +} + +void InternalValue::SetParentData(InternalValue&& val) { + m_parentData = std::move(val.GetData()); +} + +void ListAdapter::Iterator::increment() { + m_isFinished = !m_iterator->MoveNext(); + ++ m_currentIndex; + m_currentVal = m_isFinished ? InternalValue() : m_iterator->GetCurrent(); +} + std::atomic_uint64_t UserCallable::m_gen{}; bool Value::IsEqual(const Value& rhs) const diff --git a/contrib/libs/jinja2cpp/src/internal_value.h b/contrib/libs/jinja2cpp/src/internal_value.h index 22a933f257..8283a35501 100644 --- a/contrib/libs/jinja2cpp/src/internal_value.h +++ b/contrib/libs/jinja2cpp/src/internal_value.h @@ -382,15 +382,9 @@ public: auto& GetParentData() {return m_parentData;} auto& GetParentData() const {return m_parentData;} - void SetParentData(const InternalValue& val) - { - m_parentData = val.GetData(); - } + void SetParentData(const InternalValue& val); - void SetParentData(InternalValue&& val) - { - m_parentData = std::move(val.GetData()); - } + void SetParentData(InternalValue&& val); bool ShouldExtendLifetime() const { @@ -444,12 +438,7 @@ public: private: friend class boost::iterator_core_access; - void increment() - { - m_isFinished = !m_iterator->MoveNext(); - ++ m_currentIndex; - m_currentVal = m_isFinished ? InternalValue() : m_iterator->GetCurrent(); - } + void increment(); bool equal(const Iterator& other) const { diff --git a/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h b/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h index 1e7ff50ba3..9e8a02f64f 100644 --- a/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h +++ b/contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h @@ -24,6 +24,14 @@ #include "detail/_containers_helpers.h" #include "cache_aligned_allocator.h" +#include <algorithm> +#include <atomic> +#include <cstddef> +#include <cstdint> +#include <initializer_list> +#include <type_traits> +#include <utility> + namespace tbb { namespace detail { namespace d2 { diff --git a/contrib/libs/tbb/patches/concurrent_queue_add_missing_includes.patch b/contrib/libs/tbb/patches/concurrent_queue_add_missing_includes.patch new file mode 100644 index 0000000000..f8f6b00144 --- /dev/null +++ b/contrib/libs/tbb/patches/concurrent_queue_add_missing_includes.patch @@ -0,0 +1,17 @@ +--- contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h (index) ++++ contrib/libs/tbb/include/oneapi/tbb/concurrent_queue.h (working tree) +@@ -24,6 +24,14 @@ + #include "detail/_containers_helpers.h" + #include "cache_aligned_allocator.h" + ++#include <algorithm> ++#include <atomic> ++#include <cstddef> ++#include <cstdint> ++#include <initializer_list> ++#include <type_traits> ++#include <utility> ++ + namespace tbb { + namespace detail { + namespace d2 { |