diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /contrib/libs/cxxsupp/libcxx | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx')
24 files changed, 8095 insertions, 8095 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report index 59ae986224..63da08aa18 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.copyrights.report @@ -30,7 +30,7 @@ # ======================= KEEP COPYRIGHT_SERVICE_LABEL 7e6a182a2f65f965d96f2755976c1829 -BELONGS ya.make +BELONGS ya.make License text: * FreeBSD libc. These are covered by the following copyright: * @@ -40,12 +40,12 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - src/support/solaris/mbsnrtowcs.inc [5:7] - src/support/solaris/wcsnrtombs.inc [2:2] + src/support/solaris/mbsnrtowcs.inc [5:7] + src/support/solaris/wcsnrtombs.inc [2:2] KEEP COPYRIGHT_SERVICE_LABEL ebc015cad7377d32e7b2fc0ae5293aa1 -BELONGS ya.make -FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 252 +BELONGS ya.make +FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 252 # libcxxabi/CREDITS.TXT included in libcxxabi License text: Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT @@ -54,11 +54,11 @@ FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 252 Score : 100.00 Match type : COPYRIGHT Files with this license: - LICENSE.TXT [252:252] + LICENSE.TXT [252:252] KEEP COPYRIGHT_SERVICE_LABEL f52c727d32a7eaf5a8de6bc96b82797c -BELONGS ya.make -FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 293 +BELONGS ya.make +FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 293 # libcxxabi/CREDITS.TXT included in libcxxabi License text: Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT @@ -67,4 +67,4 @@ FILE_INCLUDE CREDITS.TXT found in files: LICENSE.TXT at line 293 Score : 100.00 Match type : COPYRIGHT Files with this license: - LICENSE.TXT [293:293] + LICENSE.TXT [293:293] diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report index 179b442913..ef75e9385d 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/devtools.licenses.report @@ -30,7 +30,7 @@ # ======================= KEEP NCSA AND MIT 1f7e00acb6cda5de868d4d4c1ffe3c2b -BELONGS ya.make +BELONGS ya.make Note: matched license text is too long. Read it in the source files. Scancode info: Original SPDX id: NCSA @@ -38,17 +38,17 @@ BELONGS ya.make Match type : NOTICE Links : http://www.otm.illinois.edu/faculty/forms/opensource.asp, https://spdx.org/licenses/NCSA Files with this license: - LICENSE.TXT [240:245] + LICENSE.TXT [240:245] Scancode info: Original SPDX id: MIT Score : 100.00 Match type : NOTICE Links : http://opensource.org/licenses/mit-license.php, https://spdx.org/licenses/MIT Files with this license: - LICENSE.TXT [240:245] + LICENSE.TXT [240:245] KEEP NCSA 5a35b4c0d3b3923cac31a5a371332ca2 -BELONGS ya.make +BELONGS ya.make License text: Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): Scancode info: @@ -57,11 +57,11 @@ BELONGS ya.make Match type : REFERENCE Links : http://www.otm.illinois.edu/faculty/forms/opensource.asp, https://spdx.org/licenses/NCSA Files with this license: - LICENSE.TXT [237:237] + LICENSE.TXT [237:237] KEEP MIT 5debb370f50e1dfd24ff5144233a2ef6 -BELONGS ya.make -FILE_INCLUDE include/any found in files: LICENSE.TXT at line 295 +BELONGS ya.make +FILE_INCLUDE include/any found in files: LICENSE.TXT at line 295 # any - just word, not file reference Note: matched license text is too long. Read it in the source files. Scancode info: @@ -70,10 +70,10 @@ FILE_INCLUDE include/any found in files: LICENSE.TXT at line 295 Match type : TEXT Links : http://opensource.org/licenses/mit-license.php, https://spdx.org/licenses/MIT Files with this license: - LICENSE.TXT [295:311] + LICENSE.TXT [295:311] KEEP Apache-2.0 WITH LLVM-exception 705a75a25bce12b12334e8fc577d8a46 -BELONGS ya.make +BELONGS ya.make License text: * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. * See https://llvm.org/LICENSE.txt for license information. @@ -83,17 +83,17 @@ BELONGS ya.make Match type : NOTICE Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - src/filesystem/int128_builtins.cpp [3:4] + src/filesystem/int128_builtins.cpp [3:4] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : NOTICE Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - src/filesystem/int128_builtins.cpp [3:4] + src/filesystem/int128_builtins.cpp [3:4] KEEP Apache-2.0 WITH LLVM-exception 755ab7da3ff8c5d6ae90bdbebd177e49 -BELONGS ya.make +BELONGS ya.make License text: // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -103,1006 +103,1006 @@ BELONGS ya.make Match type : NOTICE Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - include/__algorithm/adjacent_find.h [4:5] - include/__algorithm/all_of.h [4:5] - include/__algorithm/any_of.h [4:5] - include/__algorithm/binary_search.h [3:4] - include/__algorithm/clamp.h [3:4] - include/__algorithm/comp.h [3:4] - include/__algorithm/comp_ref_type.h [3:4] - include/__algorithm/copy.h [3:4] - include/__algorithm/copy_backward.h [3:4] - include/__algorithm/copy_if.h [3:4] - include/__algorithm/copy_n.h [3:4] - include/__algorithm/count.h [4:5] - include/__algorithm/count_if.h [4:5] - include/__algorithm/equal.h [4:5] - include/__algorithm/equal_range.h [3:4] - include/__algorithm/fill.h [3:4] - include/__algorithm/fill_n.h [3:4] - include/__algorithm/find.h [4:5] - include/__algorithm/find_end.h [4:5] - include/__algorithm/find_first_of.h [4:5] - include/__algorithm/find_if.h [4:5] - include/__algorithm/find_if_not.h [4:5] - include/__algorithm/for_each.h [4:5] - include/__algorithm/for_each_n.h [4:5] - include/__algorithm/generate.h [3:4] - include/__algorithm/generate_n.h [3:4] - include/__algorithm/half_positive.h [3:4] - include/__algorithm/includes.h [3:4] - include/__algorithm/inplace_merge.h [3:4] - include/__algorithm/is_heap.h [3:4] - include/__algorithm/is_heap_until.h [3:4] - include/__algorithm/is_partitioned.h [3:4] - include/__algorithm/is_permutation.h [4:5] - include/__algorithm/is_sorted.h [3:4] - include/__algorithm/is_sorted_until.h [3:4] - include/__algorithm/iter_swap.h [3:4] - include/__algorithm/lexicographical_compare.h [3:4] - include/__algorithm/lower_bound.h [3:4] - include/__algorithm/make_heap.h [3:4] - include/__algorithm/max.h [3:4] - include/__algorithm/max_element.h [3:4] - include/__algorithm/merge.h [3:4] - include/__algorithm/min.h [3:4] - include/__algorithm/min_element.h [3:4] - include/__algorithm/minmax.h [3:4] - include/__algorithm/minmax_element.h [3:4] - include/__algorithm/mismatch.h [4:5] - include/__algorithm/move.h [3:4] - include/__algorithm/move_backward.h [3:4] - include/__algorithm/next_permutation.h [3:4] - include/__algorithm/none_of.h [4:5] - include/__algorithm/nth_element.h [3:4] - include/__algorithm/partial_sort.h [3:4] - include/__algorithm/partial_sort_copy.h [3:4] - include/__algorithm/partition.h [3:4] - include/__algorithm/partition_copy.h [3:4] - include/__algorithm/partition_point.h [3:4] - include/__algorithm/pop_heap.h [3:4] - include/__algorithm/prev_permutation.h [3:4] - include/__algorithm/push_heap.h [3:4] - include/__algorithm/remove.h [3:4] - include/__algorithm/remove_copy.h [3:4] - include/__algorithm/remove_copy_if.h [3:4] - include/__algorithm/remove_if.h [3:4] - include/__algorithm/replace.h [3:4] - include/__algorithm/replace_copy.h [3:4] - include/__algorithm/replace_copy_if.h [3:4] - include/__algorithm/replace_if.h [3:4] - include/__algorithm/reverse.h [3:4] - include/__algorithm/reverse_copy.h [3:4] - include/__algorithm/rotate.h [3:4] - include/__algorithm/rotate_copy.h [3:4] - include/__algorithm/sample.h [3:4] - include/__algorithm/search.h [4:5] - include/__algorithm/search_n.h [4:5] - include/__algorithm/set_difference.h [3:4] - include/__algorithm/set_intersection.h [3:4] - include/__algorithm/set_symmetric_difference.h [3:4] - include/__algorithm/set_union.h [3:4] - include/__algorithm/shift_left.h [3:4] - include/__algorithm/shift_right.h [3:4] - include/__algorithm/shuffle.h [3:4] - include/__algorithm/sift_down.h [3:4] - include/__algorithm/sort.h [3:4] - include/__algorithm/sort_heap.h [3:4] - include/__algorithm/stable_partition.h [3:4] - include/__algorithm/stable_sort.h [3:4] - include/__algorithm/swap_ranges.h [3:4] - include/__algorithm/transform.h [3:4] - include/__algorithm/unique.h [3:4] - include/__algorithm/unique_copy.h [3:4] - include/__algorithm/unwrap_iter.h [3:4] - include/__algorithm/upper_bound.h [3:4] - include/__availability [4:5] - include/__bit/bit_cast.h [4:5] - include/__bit_reference [4:5] - include/__bits [4:5] - include/__bsd_locale_defaults.h [4:5] - include/__bsd_locale_fallbacks.h [4:5] - include/__charconv/chars_format.h [4:5] - include/__charconv/from_chars_result.h [4:5] - include/__charconv/to_chars_result.h [4:5] - include/__compare/common_comparison_category.h [3:4] - include/__compare/compare_three_way_result.h [3:4] - include/__compare/ordering.h [3:4] - include/__compare/synth_three_way.h [3:4] - include/__compare/three_way_comparable.h [3:4] - include/__concepts/arithmetic.h [3:4] - include/__concepts/assignable.h [3:4] - include/__concepts/boolean_testable.h [3:4] - include/__concepts/class_or_enum.h [3:4] - include/__concepts/common_reference_with.h [3:4] - include/__concepts/common_with.h [3:4] - include/__concepts/constructible.h [3:4] - include/__concepts/convertible_to.h [3:4] - include/__concepts/copyable.h [3:4] - include/__concepts/derived_from.h [3:4] - include/__concepts/destructible.h [3:4] - include/__concepts/different_from.h [3:4] - include/__concepts/equality_comparable.h [3:4] - include/__concepts/invocable.h [3:4] - include/__concepts/movable.h [3:4] - include/__concepts/predicate.h [3:4] - include/__concepts/regular.h [3:4] - include/__concepts/relation.h [3:4] - include/__concepts/same_as.h [3:4] - include/__concepts/semiregular.h [3:4] - include/__concepts/swappable.h [3:4] - include/__concepts/totally_ordered.h [3:4] - include/__config [4:5] - include/__config_site.in [3:4] - include/__debug [4:5] - include/__errc [4:5] - include/__format/format_arg.h [4:5] - include/__format/format_args.h [4:5] - include/__format/format_context.h [4:5] - include/__format/format_error.h [4:5] - include/__format/format_fwd.h [4:5] - include/__format/format_parse_context.h [4:5] - include/__format/format_string.h [4:5] - include/__format/formatter.h [4:5] - include/__format/parser_std_format_spec.h [4:5] - include/__function_like.h [4:5] - include/__functional/binary_function.h [4:5] - include/__functional/binary_negate.h [4:5] - include/__functional/bind.h [4:5] - include/__functional/bind_back.h [4:5] - include/__functional/bind_front.h [4:5] - include/__functional/binder1st.h [4:5] - include/__functional/binder2nd.h [4:5] - include/__functional/compose.h [4:5] - include/__functional/default_searcher.h [4:5] - include/__functional/function.h [4:5] - include/__functional/hash.h [3:4] - include/__functional/identity.h [4:5] - include/__functional/invoke.h [4:5] - include/__functional/is_transparent.h [4:5] - include/__functional/mem_fn.h [4:5] - include/__functional/mem_fun_ref.h [4:5] - include/__functional/not_fn.h [4:5] - include/__functional/operations.h [4:5] - include/__functional/perfect_forward.h [4:5] - include/__functional/pointer_to_binary_function.h [4:5] - include/__functional/pointer_to_unary_function.h [4:5] - include/__functional/ranges_operations.h [4:5] - include/__functional/reference_wrapper.h [4:5] - include/__functional/unary_function.h [3:4] - include/__functional/unary_negate.h [4:5] - include/__functional/unwrap_ref.h [3:4] - include/__functional/weak_result_type.h [4:5] - include/__functional_base [4:5] - include/__hash_table [4:5] - include/__iterator/access.h [4:5] - include/__iterator/advance.h [4:5] - include/__iterator/back_insert_iterator.h [4:5] - include/__iterator/common_iterator.h [4:5] - include/__iterator/concepts.h [4:5] - include/__iterator/counted_iterator.h [4:5] - include/__iterator/data.h [4:5] - include/__iterator/default_sentinel.h [4:5] - include/__iterator/distance.h [4:5] - include/__iterator/empty.h [4:5] - include/__iterator/erase_if_container.h [4:5] - include/__iterator/front_insert_iterator.h [4:5] - include/__iterator/incrementable_traits.h [4:5] - include/__iterator/insert_iterator.h [4:5] - include/__iterator/istream_iterator.h [4:5] - include/__iterator/istreambuf_iterator.h [4:5] - include/__iterator/iter_move.h [4:5] - include/__iterator/iter_swap.h [4:5] - include/__iterator/iterator.h [4:5] - include/__iterator/iterator_traits.h [4:5] - include/__iterator/move_iterator.h [4:5] - include/__iterator/next.h [4:5] - include/__iterator/ostream_iterator.h [4:5] - include/__iterator/ostreambuf_iterator.h [4:5] - include/__iterator/prev.h [4:5] - include/__iterator/projected.h [4:5] - include/__iterator/readable_traits.h [4:5] - include/__iterator/reverse_access.h [4:5] - include/__iterator/reverse_iterator.h [4:5] - include/__iterator/size.h [4:5] - include/__iterator/unreachable_sentinel.h [4:5] - include/__iterator/wrap_iter.h [4:5] - include/__locale [4:5] - include/__memory/addressof.h [4:5] - include/__memory/allocation_guard.h [4:5] - include/__memory/allocator.h [4:5] - include/__memory/allocator_arg_t.h [4:5] - include/__memory/allocator_traits.h [4:5] - include/__memory/auto_ptr.h [4:5] - include/__memory/compressed_pair.h [4:5] - include/__memory/construct_at.h [4:5] - include/__memory/pointer_safety.h [4:5] - include/__memory/pointer_traits.h [4:5] - include/__memory/raw_storage_iterator.h [4:5] - include/__memory/shared_ptr.h [4:5] - include/__memory/temporary_buffer.h [4:5] - include/__memory/uninitialized_algorithms.h [4:5] - include/__memory/unique_ptr.h [4:5] - include/__memory/uses_allocator.h [4:5] - include/__mutex_base [4:5] - include/__node_handle [4:5] - include/__nullptr [4:5] - include/__random/uniform_int_distribution.h [3:4] - include/__ranges/access.h [4:5] - include/__ranges/all.h [4:5] - include/__ranges/common_view.h [4:5] - include/__ranges/concepts.h [4:5] - include/__ranges/copyable_box.h [4:5] - include/__ranges/counted.h [4:5] - include/__ranges/dangling.h [4:5] - include/__ranges/data.h [4:5] - include/__ranges/drop_view.h [4:5] - include/__ranges/empty.h [4:5] - include/__ranges/empty_view.h [4:5] - include/__ranges/enable_borrowed_range.h [4:5] - include/__ranges/enable_view.h [4:5] - include/__ranges/iota_view.h [4:5] - include/__ranges/join_view.h [4:5] - include/__ranges/non_propagating_cache.h [4:5] - include/__ranges/range_adaptor.h [4:5] - include/__ranges/ref_view.h [4:5] - include/__ranges/reverse_view.h [4:5] - include/__ranges/single_view.h [4:5] - include/__ranges/size.h [4:5] - include/__ranges/subrange.h [4:5] - include/__ranges/take_view.h [4:5] - include/__ranges/transform_view.h [4:5] - include/__ranges/view_interface.h [4:5] - include/__std_stream [4:5] - include/__string [4:5] - include/__support/android/locale_bionic.h [4:5] - include/__support/fuchsia/xlocale.h [4:5] - include/__support/ibm/gettod_zos.h [4:5] - include/__support/ibm/limits.h [4:5] - include/__support/ibm/locale_mgmt_zos.h [4:5] - include/__support/ibm/nanosleep.h [4:5] - include/__support/ibm/support.h [4:5] - include/__support/ibm/xlocale.h [4:5] - include/__support/musl/xlocale.h [4:5] - include/__support/newlib/xlocale.h [3:4] - include/__support/openbsd/xlocale.h [4:5] - include/__support/solaris/floatingpoint.h [3:4] - include/__support/solaris/wchar.h [3:4] - include/__support/solaris/xlocale.h [3:4] - include/__support/win32/limits_msvc_win32.h [4:5] - include/__support/win32/locale_win32.h [4:5] - include/__support/xlocale/__nop_locale_mgmt.h [4:5] - include/__support/xlocale/__posix_l_fallback.h [4:5] - include/__support/xlocale/__strtonum_fallback.h [4:5] - include/__threading_support [4:5] - include/__tree [4:5] - include/__tuple [4:5] - include/__undef_macros [4:5] - include/__utility/as_const.h [3:4] - include/__utility/cmp.h [3:4] - include/__utility/decay_copy.h [4:5] - include/__utility/declval.h [3:4] - include/__utility/exchange.h [3:4] - include/__utility/forward.h [4:5] - include/__utility/in_place.h [3:4] - include/__utility/integer_sequence.h [3:4] - include/__utility/move.h [4:5] - include/__utility/pair.h [3:4] - include/__utility/piecewise_construct.h [3:4] - include/__utility/rel_ops.h [3:4] - include/__utility/swap.h [3:4] - include/__utility/to_underlying.h [4:5] - include/__variant/monostate.h [4:5] - include/algorithm [4:5] - include/any [4:5] - include/array [4:5] - include/atomic [4:5] - include/barrier [4:5] - include/bit [4:5] - include/bitset [4:5] - include/cassert [4:5] - include/ccomplex [4:5] - include/cctype [4:5] - include/cerrno [4:5] - include/cfenv [4:5] - include/cfloat [4:5] - include/charconv [4:5] - include/chrono [4:5] - include/cinttypes [4:5] - include/ciso646 [4:5] - include/climits [4:5] - include/clocale [4:5] - include/cmath [4:5] - include/codecvt [4:5] - include/compare [4:5] - include/complex [4:5] - include/complex.h [4:5] - include/concepts [4:5] - include/condition_variable [4:5] - include/csetjmp [4:5] - include/csignal [4:5] - include/cstdarg [4:5] - include/cstdbool [4:5] - include/cstddef [4:5] - include/cstdint [4:5] - include/cstdio [4:5] - include/cstdlib [4:5] - include/cstring [4:5] - include/ctgmath [4:5] - include/ctime [4:5] - include/ctype.h [4:5] - include/cwchar [4:5] - include/cwctype [4:5] - include/deque [4:5] - include/errno.h [4:5] - include/exception [4:5] - include/execution [4:5] - include/experimental/__memory [4:5] - include/experimental/algorithm [4:5] - include/experimental/coroutine [4:5] - include/experimental/deque [4:5] - include/experimental/filesystem [4:5] - include/experimental/forward_list [4:5] - include/experimental/functional [4:5] - include/experimental/iterator [4:5] - include/experimental/list [4:5] - include/experimental/map [4:5] - include/experimental/memory_resource [4:5] - include/experimental/propagate_const [4:5] - include/experimental/regex [4:5] - include/experimental/set [4:5] - include/experimental/simd [4:5] - include/experimental/string [4:5] - include/experimental/type_traits [4:5] - include/experimental/unordered_map [4:5] - include/experimental/unordered_set [4:5] - include/experimental/utility [4:5] - include/experimental/vector [4:5] - include/ext/__hash [4:5] - include/ext/hash_map [4:5] - include/ext/hash_set [4:5] - include/filesystem [4:5] - include/float.h [4:5] - include/format [4:5] - include/forward_list [4:5] - include/fstream [4:5] - include/functional [4:5] - include/future [4:5] - include/initializer_list [4:5] - include/inttypes.h [4:5] - include/iomanip [4:5] - include/ios [4:5] - include/iosfwd [4:5] - include/iostream [4:5] - include/istream [4:5] - include/iterator [4:5] - include/latch [4:5] - include/limits [4:5] - include/limits.h [4:5] - include/list [4:5] - include/locale [4:5] - include/locale.h [4:5] - include/map [4:5] - include/math.h [4:5] - include/memory [4:5] - include/mutex [4:5] - include/new [4:5] - include/numbers [4:5] - include/numeric [4:5] - include/optional [4:5] - include/ostream [4:5] - include/queue [4:5] - include/random [4:5] - include/ranges [4:5] - include/ratio [4:5] - include/regex [4:5] - include/scoped_allocator [4:5] - include/semaphore [4:5] - include/set [4:5] - include/setjmp.h [4:5] - include/shared_mutex [4:5] - include/span [4:5] - include/sstream [4:5] - include/stack [4:5] - include/stdbool.h [4:5] - include/stddef.h [4:5] - include/stdexcept [4:5] - include/stdint.h [4:5] - include/stdio.h [4:5] - include/stdlib.h [4:5] - include/streambuf [4:5] - include/string [4:5] - include/string.h [4:5] - include/string_view [4:5] - include/strstream [4:5] - include/system_error [4:5] - include/tgmath.h [4:5] - include/thread [4:5] - include/tuple [4:5] - include/type_traits [4:5] - include/typeindex [4:5] - include/typeinfo [4:5] - include/unordered_map [4:5] - include/unordered_set [4:5] - include/utility [4:5] - include/valarray [4:5] - include/variant [4:5] - include/vector [4:5] - include/version [4:5] - include/wchar.h [4:5] - include/wctype.h [4:5] - src/algorithm.cpp [3:4] - src/any.cpp [3:4] - src/atomic.cpp [3:4] - src/barrier.cpp [3:4] - src/bind.cpp [3:4] - src/charconv.cpp [3:4] - src/chrono.cpp [3:4] - src/condition_variable.cpp [3:4] - src/condition_variable_destructor.cpp [3:4] - src/debug.cpp [3:4] - src/exception.cpp [3:4] - src/experimental/memory_resource.cpp [3:4] - src/filesystem/directory_iterator.cpp [3:4] - src/filesystem/filesystem_common.h [3:4] - src/filesystem/operations.cpp [3:4] - src/filesystem/posix_compat.h [3:4] - src/format.cpp [3:4] - src/functional.cpp [3:4] - src/future.cpp [3:4] - src/hash.cpp [3:4] - src/include/apple_availability.h [3:4] - src/include/atomic_support.h [3:4] - src/include/config_elast.h [3:4] - src/include/refstring.h [3:4] - src/include/sso_allocator.h [4:5] - src/ios.cpp [3:4] - src/ios.instantiations.cpp [3:4] - src/iostream.cpp [3:4] - src/locale.cpp [3:4] - src/memory.cpp [3:4] - src/mutex.cpp [3:4] - src/mutex_destructor.cpp [3:4] - src/new.cpp [3:4] - src/optional.cpp [3:4] - src/random.cpp [3:4] - src/random_shuffle.cpp [3:4] - src/regex.cpp [3:4] - src/shared_mutex.cpp [3:4] - src/stdexcept.cpp [3:4] - src/string.cpp [3:4] - src/strstream.cpp [3:4] - src/support/ibm/mbsnrtowcs.cpp [3:4] - src/support/ibm/wcsnrtombs.cpp [3:4] - src/support/ibm/xlocale_zos.cpp [3:4] - src/support/runtime/exception_fallback.ipp [4:5] - src/support/runtime/exception_glibcxx.ipp [4:5] - src/support/runtime/exception_libcxxabi.ipp [4:5] - src/support/runtime/exception_libcxxrt.ipp [4:5] - src/support/runtime/exception_msvc.ipp [4:5] - src/support/runtime/exception_pointer_cxxabi.ipp [4:5] - src/support/runtime/exception_pointer_glibcxx.ipp [4:5] - src/support/runtime/exception_pointer_msvc.ipp [4:5] - src/support/runtime/exception_pointer_unimplemented.ipp [4:5] - src/support/runtime/new_handler_fallback.ipp [4:5] - src/support/runtime/stdexcept_default.ipp [3:4] - src/support/runtime/stdexcept_vcruntime.ipp [3:4] - src/support/solaris/xlocale.cpp [3:4] - src/support/win32/locale_win32.cpp [4:5] - src/support/win32/support.cpp [4:5] - src/support/win32/thread_win32.cpp [4:5] - src/system_error.cpp [3:4] - src/thread.cpp [3:4] - src/typeinfo.cpp [3:4] - src/utility.cpp [3:4] - src/valarray.cpp [3:4] - src/variant.cpp [3:4] - src/vector.cpp [3:4] + include/__algorithm/adjacent_find.h [4:5] + include/__algorithm/all_of.h [4:5] + include/__algorithm/any_of.h [4:5] + include/__algorithm/binary_search.h [3:4] + include/__algorithm/clamp.h [3:4] + include/__algorithm/comp.h [3:4] + include/__algorithm/comp_ref_type.h [3:4] + include/__algorithm/copy.h [3:4] + include/__algorithm/copy_backward.h [3:4] + include/__algorithm/copy_if.h [3:4] + include/__algorithm/copy_n.h [3:4] + include/__algorithm/count.h [4:5] + include/__algorithm/count_if.h [4:5] + include/__algorithm/equal.h [4:5] + include/__algorithm/equal_range.h [3:4] + include/__algorithm/fill.h [3:4] + include/__algorithm/fill_n.h [3:4] + include/__algorithm/find.h [4:5] + include/__algorithm/find_end.h [4:5] + include/__algorithm/find_first_of.h [4:5] + include/__algorithm/find_if.h [4:5] + include/__algorithm/find_if_not.h [4:5] + include/__algorithm/for_each.h [4:5] + include/__algorithm/for_each_n.h [4:5] + include/__algorithm/generate.h [3:4] + include/__algorithm/generate_n.h [3:4] + include/__algorithm/half_positive.h [3:4] + include/__algorithm/includes.h [3:4] + include/__algorithm/inplace_merge.h [3:4] + include/__algorithm/is_heap.h [3:4] + include/__algorithm/is_heap_until.h [3:4] + include/__algorithm/is_partitioned.h [3:4] + include/__algorithm/is_permutation.h [4:5] + include/__algorithm/is_sorted.h [3:4] + include/__algorithm/is_sorted_until.h [3:4] + include/__algorithm/iter_swap.h [3:4] + include/__algorithm/lexicographical_compare.h [3:4] + include/__algorithm/lower_bound.h [3:4] + include/__algorithm/make_heap.h [3:4] + include/__algorithm/max.h [3:4] + include/__algorithm/max_element.h [3:4] + include/__algorithm/merge.h [3:4] + include/__algorithm/min.h [3:4] + include/__algorithm/min_element.h [3:4] + include/__algorithm/minmax.h [3:4] + include/__algorithm/minmax_element.h [3:4] + include/__algorithm/mismatch.h [4:5] + include/__algorithm/move.h [3:4] + include/__algorithm/move_backward.h [3:4] + include/__algorithm/next_permutation.h [3:4] + include/__algorithm/none_of.h [4:5] + include/__algorithm/nth_element.h [3:4] + include/__algorithm/partial_sort.h [3:4] + include/__algorithm/partial_sort_copy.h [3:4] + include/__algorithm/partition.h [3:4] + include/__algorithm/partition_copy.h [3:4] + include/__algorithm/partition_point.h [3:4] + include/__algorithm/pop_heap.h [3:4] + include/__algorithm/prev_permutation.h [3:4] + include/__algorithm/push_heap.h [3:4] + include/__algorithm/remove.h [3:4] + include/__algorithm/remove_copy.h [3:4] + include/__algorithm/remove_copy_if.h [3:4] + include/__algorithm/remove_if.h [3:4] + include/__algorithm/replace.h [3:4] + include/__algorithm/replace_copy.h [3:4] + include/__algorithm/replace_copy_if.h [3:4] + include/__algorithm/replace_if.h [3:4] + include/__algorithm/reverse.h [3:4] + include/__algorithm/reverse_copy.h [3:4] + include/__algorithm/rotate.h [3:4] + include/__algorithm/rotate_copy.h [3:4] + include/__algorithm/sample.h [3:4] + include/__algorithm/search.h [4:5] + include/__algorithm/search_n.h [4:5] + include/__algorithm/set_difference.h [3:4] + include/__algorithm/set_intersection.h [3:4] + include/__algorithm/set_symmetric_difference.h [3:4] + include/__algorithm/set_union.h [3:4] + include/__algorithm/shift_left.h [3:4] + include/__algorithm/shift_right.h [3:4] + include/__algorithm/shuffle.h [3:4] + include/__algorithm/sift_down.h [3:4] + include/__algorithm/sort.h [3:4] + include/__algorithm/sort_heap.h [3:4] + include/__algorithm/stable_partition.h [3:4] + include/__algorithm/stable_sort.h [3:4] + include/__algorithm/swap_ranges.h [3:4] + include/__algorithm/transform.h [3:4] + include/__algorithm/unique.h [3:4] + include/__algorithm/unique_copy.h [3:4] + include/__algorithm/unwrap_iter.h [3:4] + include/__algorithm/upper_bound.h [3:4] + include/__availability [4:5] + include/__bit/bit_cast.h [4:5] + include/__bit_reference [4:5] + include/__bits [4:5] + include/__bsd_locale_defaults.h [4:5] + include/__bsd_locale_fallbacks.h [4:5] + include/__charconv/chars_format.h [4:5] + include/__charconv/from_chars_result.h [4:5] + include/__charconv/to_chars_result.h [4:5] + include/__compare/common_comparison_category.h [3:4] + include/__compare/compare_three_way_result.h [3:4] + include/__compare/ordering.h [3:4] + include/__compare/synth_three_way.h [3:4] + include/__compare/three_way_comparable.h [3:4] + include/__concepts/arithmetic.h [3:4] + include/__concepts/assignable.h [3:4] + include/__concepts/boolean_testable.h [3:4] + include/__concepts/class_or_enum.h [3:4] + include/__concepts/common_reference_with.h [3:4] + include/__concepts/common_with.h [3:4] + include/__concepts/constructible.h [3:4] + include/__concepts/convertible_to.h [3:4] + include/__concepts/copyable.h [3:4] + include/__concepts/derived_from.h [3:4] + include/__concepts/destructible.h [3:4] + include/__concepts/different_from.h [3:4] + include/__concepts/equality_comparable.h [3:4] + include/__concepts/invocable.h [3:4] + include/__concepts/movable.h [3:4] + include/__concepts/predicate.h [3:4] + include/__concepts/regular.h [3:4] + include/__concepts/relation.h [3:4] + include/__concepts/same_as.h [3:4] + include/__concepts/semiregular.h [3:4] + include/__concepts/swappable.h [3:4] + include/__concepts/totally_ordered.h [3:4] + include/__config [4:5] + include/__config_site.in [3:4] + include/__debug [4:5] + include/__errc [4:5] + include/__format/format_arg.h [4:5] + include/__format/format_args.h [4:5] + include/__format/format_context.h [4:5] + include/__format/format_error.h [4:5] + include/__format/format_fwd.h [4:5] + include/__format/format_parse_context.h [4:5] + include/__format/format_string.h [4:5] + include/__format/formatter.h [4:5] + include/__format/parser_std_format_spec.h [4:5] + include/__function_like.h [4:5] + include/__functional/binary_function.h [4:5] + include/__functional/binary_negate.h [4:5] + include/__functional/bind.h [4:5] + include/__functional/bind_back.h [4:5] + include/__functional/bind_front.h [4:5] + include/__functional/binder1st.h [4:5] + include/__functional/binder2nd.h [4:5] + include/__functional/compose.h [4:5] + include/__functional/default_searcher.h [4:5] + include/__functional/function.h [4:5] + include/__functional/hash.h [3:4] + include/__functional/identity.h [4:5] + include/__functional/invoke.h [4:5] + include/__functional/is_transparent.h [4:5] + include/__functional/mem_fn.h [4:5] + include/__functional/mem_fun_ref.h [4:5] + include/__functional/not_fn.h [4:5] + include/__functional/operations.h [4:5] + include/__functional/perfect_forward.h [4:5] + include/__functional/pointer_to_binary_function.h [4:5] + include/__functional/pointer_to_unary_function.h [4:5] + include/__functional/ranges_operations.h [4:5] + include/__functional/reference_wrapper.h [4:5] + include/__functional/unary_function.h [3:4] + include/__functional/unary_negate.h [4:5] + include/__functional/unwrap_ref.h [3:4] + include/__functional/weak_result_type.h [4:5] + include/__functional_base [4:5] + include/__hash_table [4:5] + include/__iterator/access.h [4:5] + include/__iterator/advance.h [4:5] + include/__iterator/back_insert_iterator.h [4:5] + include/__iterator/common_iterator.h [4:5] + include/__iterator/concepts.h [4:5] + include/__iterator/counted_iterator.h [4:5] + include/__iterator/data.h [4:5] + include/__iterator/default_sentinel.h [4:5] + include/__iterator/distance.h [4:5] + include/__iterator/empty.h [4:5] + include/__iterator/erase_if_container.h [4:5] + include/__iterator/front_insert_iterator.h [4:5] + include/__iterator/incrementable_traits.h [4:5] + include/__iterator/insert_iterator.h [4:5] + include/__iterator/istream_iterator.h [4:5] + include/__iterator/istreambuf_iterator.h [4:5] + include/__iterator/iter_move.h [4:5] + include/__iterator/iter_swap.h [4:5] + include/__iterator/iterator.h [4:5] + include/__iterator/iterator_traits.h [4:5] + include/__iterator/move_iterator.h [4:5] + include/__iterator/next.h [4:5] + include/__iterator/ostream_iterator.h [4:5] + include/__iterator/ostreambuf_iterator.h [4:5] + include/__iterator/prev.h [4:5] + include/__iterator/projected.h [4:5] + include/__iterator/readable_traits.h [4:5] + include/__iterator/reverse_access.h [4:5] + include/__iterator/reverse_iterator.h [4:5] + include/__iterator/size.h [4:5] + include/__iterator/unreachable_sentinel.h [4:5] + include/__iterator/wrap_iter.h [4:5] + include/__locale [4:5] + include/__memory/addressof.h [4:5] + include/__memory/allocation_guard.h [4:5] + include/__memory/allocator.h [4:5] + include/__memory/allocator_arg_t.h [4:5] + include/__memory/allocator_traits.h [4:5] + include/__memory/auto_ptr.h [4:5] + include/__memory/compressed_pair.h [4:5] + include/__memory/construct_at.h [4:5] + include/__memory/pointer_safety.h [4:5] + include/__memory/pointer_traits.h [4:5] + include/__memory/raw_storage_iterator.h [4:5] + include/__memory/shared_ptr.h [4:5] + include/__memory/temporary_buffer.h [4:5] + include/__memory/uninitialized_algorithms.h [4:5] + include/__memory/unique_ptr.h [4:5] + include/__memory/uses_allocator.h [4:5] + include/__mutex_base [4:5] + include/__node_handle [4:5] + include/__nullptr [4:5] + include/__random/uniform_int_distribution.h [3:4] + include/__ranges/access.h [4:5] + include/__ranges/all.h [4:5] + include/__ranges/common_view.h [4:5] + include/__ranges/concepts.h [4:5] + include/__ranges/copyable_box.h [4:5] + include/__ranges/counted.h [4:5] + include/__ranges/dangling.h [4:5] + include/__ranges/data.h [4:5] + include/__ranges/drop_view.h [4:5] + include/__ranges/empty.h [4:5] + include/__ranges/empty_view.h [4:5] + include/__ranges/enable_borrowed_range.h [4:5] + include/__ranges/enable_view.h [4:5] + include/__ranges/iota_view.h [4:5] + include/__ranges/join_view.h [4:5] + include/__ranges/non_propagating_cache.h [4:5] + include/__ranges/range_adaptor.h [4:5] + include/__ranges/ref_view.h [4:5] + include/__ranges/reverse_view.h [4:5] + include/__ranges/single_view.h [4:5] + include/__ranges/size.h [4:5] + include/__ranges/subrange.h [4:5] + include/__ranges/take_view.h [4:5] + include/__ranges/transform_view.h [4:5] + include/__ranges/view_interface.h [4:5] + include/__std_stream [4:5] + include/__string [4:5] + include/__support/android/locale_bionic.h [4:5] + include/__support/fuchsia/xlocale.h [4:5] + include/__support/ibm/gettod_zos.h [4:5] + include/__support/ibm/limits.h [4:5] + include/__support/ibm/locale_mgmt_zos.h [4:5] + include/__support/ibm/nanosleep.h [4:5] + include/__support/ibm/support.h [4:5] + include/__support/ibm/xlocale.h [4:5] + include/__support/musl/xlocale.h [4:5] + include/__support/newlib/xlocale.h [3:4] + include/__support/openbsd/xlocale.h [4:5] + include/__support/solaris/floatingpoint.h [3:4] + include/__support/solaris/wchar.h [3:4] + include/__support/solaris/xlocale.h [3:4] + include/__support/win32/limits_msvc_win32.h [4:5] + include/__support/win32/locale_win32.h [4:5] + include/__support/xlocale/__nop_locale_mgmt.h [4:5] + include/__support/xlocale/__posix_l_fallback.h [4:5] + include/__support/xlocale/__strtonum_fallback.h [4:5] + include/__threading_support [4:5] + include/__tree [4:5] + include/__tuple [4:5] + include/__undef_macros [4:5] + include/__utility/as_const.h [3:4] + include/__utility/cmp.h [3:4] + include/__utility/decay_copy.h [4:5] + include/__utility/declval.h [3:4] + include/__utility/exchange.h [3:4] + include/__utility/forward.h [4:5] + include/__utility/in_place.h [3:4] + include/__utility/integer_sequence.h [3:4] + include/__utility/move.h [4:5] + include/__utility/pair.h [3:4] + include/__utility/piecewise_construct.h [3:4] + include/__utility/rel_ops.h [3:4] + include/__utility/swap.h [3:4] + include/__utility/to_underlying.h [4:5] + include/__variant/monostate.h [4:5] + include/algorithm [4:5] + include/any [4:5] + include/array [4:5] + include/atomic [4:5] + include/barrier [4:5] + include/bit [4:5] + include/bitset [4:5] + include/cassert [4:5] + include/ccomplex [4:5] + include/cctype [4:5] + include/cerrno [4:5] + include/cfenv [4:5] + include/cfloat [4:5] + include/charconv [4:5] + include/chrono [4:5] + include/cinttypes [4:5] + include/ciso646 [4:5] + include/climits [4:5] + include/clocale [4:5] + include/cmath [4:5] + include/codecvt [4:5] + include/compare [4:5] + include/complex [4:5] + include/complex.h [4:5] + include/concepts [4:5] + include/condition_variable [4:5] + include/csetjmp [4:5] + include/csignal [4:5] + include/cstdarg [4:5] + include/cstdbool [4:5] + include/cstddef [4:5] + include/cstdint [4:5] + include/cstdio [4:5] + include/cstdlib [4:5] + include/cstring [4:5] + include/ctgmath [4:5] + include/ctime [4:5] + include/ctype.h [4:5] + include/cwchar [4:5] + include/cwctype [4:5] + include/deque [4:5] + include/errno.h [4:5] + include/exception [4:5] + include/execution [4:5] + include/experimental/__memory [4:5] + include/experimental/algorithm [4:5] + include/experimental/coroutine [4:5] + include/experimental/deque [4:5] + include/experimental/filesystem [4:5] + include/experimental/forward_list [4:5] + include/experimental/functional [4:5] + include/experimental/iterator [4:5] + include/experimental/list [4:5] + include/experimental/map [4:5] + include/experimental/memory_resource [4:5] + include/experimental/propagate_const [4:5] + include/experimental/regex [4:5] + include/experimental/set [4:5] + include/experimental/simd [4:5] + include/experimental/string [4:5] + include/experimental/type_traits [4:5] + include/experimental/unordered_map [4:5] + include/experimental/unordered_set [4:5] + include/experimental/utility [4:5] + include/experimental/vector [4:5] + include/ext/__hash [4:5] + include/ext/hash_map [4:5] + include/ext/hash_set [4:5] + include/filesystem [4:5] + include/float.h [4:5] + include/format [4:5] + include/forward_list [4:5] + include/fstream [4:5] + include/functional [4:5] + include/future [4:5] + include/initializer_list [4:5] + include/inttypes.h [4:5] + include/iomanip [4:5] + include/ios [4:5] + include/iosfwd [4:5] + include/iostream [4:5] + include/istream [4:5] + include/iterator [4:5] + include/latch [4:5] + include/limits [4:5] + include/limits.h [4:5] + include/list [4:5] + include/locale [4:5] + include/locale.h [4:5] + include/map [4:5] + include/math.h [4:5] + include/memory [4:5] + include/mutex [4:5] + include/new [4:5] + include/numbers [4:5] + include/numeric [4:5] + include/optional [4:5] + include/ostream [4:5] + include/queue [4:5] + include/random [4:5] + include/ranges [4:5] + include/ratio [4:5] + include/regex [4:5] + include/scoped_allocator [4:5] + include/semaphore [4:5] + include/set [4:5] + include/setjmp.h [4:5] + include/shared_mutex [4:5] + include/span [4:5] + include/sstream [4:5] + include/stack [4:5] + include/stdbool.h [4:5] + include/stddef.h [4:5] + include/stdexcept [4:5] + include/stdint.h [4:5] + include/stdio.h [4:5] + include/stdlib.h [4:5] + include/streambuf [4:5] + include/string [4:5] + include/string.h [4:5] + include/string_view [4:5] + include/strstream [4:5] + include/system_error [4:5] + include/tgmath.h [4:5] + include/thread [4:5] + include/tuple [4:5] + include/type_traits [4:5] + include/typeindex [4:5] + include/typeinfo [4:5] + include/unordered_map [4:5] + include/unordered_set [4:5] + include/utility [4:5] + include/valarray [4:5] + include/variant [4:5] + include/vector [4:5] + include/version [4:5] + include/wchar.h [4:5] + include/wctype.h [4:5] + src/algorithm.cpp [3:4] + src/any.cpp [3:4] + src/atomic.cpp [3:4] + src/barrier.cpp [3:4] + src/bind.cpp [3:4] + src/charconv.cpp [3:4] + src/chrono.cpp [3:4] + src/condition_variable.cpp [3:4] + src/condition_variable_destructor.cpp [3:4] + src/debug.cpp [3:4] + src/exception.cpp [3:4] + src/experimental/memory_resource.cpp [3:4] + src/filesystem/directory_iterator.cpp [3:4] + src/filesystem/filesystem_common.h [3:4] + src/filesystem/operations.cpp [3:4] + src/filesystem/posix_compat.h [3:4] + src/format.cpp [3:4] + src/functional.cpp [3:4] + src/future.cpp [3:4] + src/hash.cpp [3:4] + src/include/apple_availability.h [3:4] + src/include/atomic_support.h [3:4] + src/include/config_elast.h [3:4] + src/include/refstring.h [3:4] + src/include/sso_allocator.h [4:5] + src/ios.cpp [3:4] + src/ios.instantiations.cpp [3:4] + src/iostream.cpp [3:4] + src/locale.cpp [3:4] + src/memory.cpp [3:4] + src/mutex.cpp [3:4] + src/mutex_destructor.cpp [3:4] + src/new.cpp [3:4] + src/optional.cpp [3:4] + src/random.cpp [3:4] + src/random_shuffle.cpp [3:4] + src/regex.cpp [3:4] + src/shared_mutex.cpp [3:4] + src/stdexcept.cpp [3:4] + src/string.cpp [3:4] + src/strstream.cpp [3:4] + src/support/ibm/mbsnrtowcs.cpp [3:4] + src/support/ibm/wcsnrtombs.cpp [3:4] + src/support/ibm/xlocale_zos.cpp [3:4] + src/support/runtime/exception_fallback.ipp [4:5] + src/support/runtime/exception_glibcxx.ipp [4:5] + src/support/runtime/exception_libcxxabi.ipp [4:5] + src/support/runtime/exception_libcxxrt.ipp [4:5] + src/support/runtime/exception_msvc.ipp [4:5] + src/support/runtime/exception_pointer_cxxabi.ipp [4:5] + src/support/runtime/exception_pointer_glibcxx.ipp [4:5] + src/support/runtime/exception_pointer_msvc.ipp [4:5] + src/support/runtime/exception_pointer_unimplemented.ipp [4:5] + src/support/runtime/new_handler_fallback.ipp [4:5] + src/support/runtime/stdexcept_default.ipp [3:4] + src/support/runtime/stdexcept_vcruntime.ipp [3:4] + src/support/solaris/xlocale.cpp [3:4] + src/support/win32/locale_win32.cpp [4:5] + src/support/win32/support.cpp [4:5] + src/support/win32/thread_win32.cpp [4:5] + src/system_error.cpp [3:4] + src/thread.cpp [3:4] + src/typeinfo.cpp [3:4] + src/utility.cpp [3:4] + src/valarray.cpp [3:4] + src/variant.cpp [3:4] + src/vector.cpp [3:4] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : NOTICE Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - include/__algorithm/adjacent_find.h [4:5] - include/__algorithm/all_of.h [4:5] - include/__algorithm/any_of.h [4:5] - include/__algorithm/binary_search.h [3:4] - include/__algorithm/clamp.h [3:4] - include/__algorithm/comp.h [3:4] - include/__algorithm/comp_ref_type.h [3:4] - include/__algorithm/copy.h [3:4] - include/__algorithm/copy_backward.h [3:4] - include/__algorithm/copy_if.h [3:4] - include/__algorithm/copy_n.h [3:4] - include/__algorithm/count.h [4:5] - include/__algorithm/count_if.h [4:5] - include/__algorithm/equal.h [4:5] - include/__algorithm/equal_range.h [3:4] - include/__algorithm/fill.h [3:4] - include/__algorithm/fill_n.h [3:4] - include/__algorithm/find.h [4:5] - include/__algorithm/find_end.h [4:5] - include/__algorithm/find_first_of.h [4:5] - include/__algorithm/find_if.h [4:5] - include/__algorithm/find_if_not.h [4:5] - include/__algorithm/for_each.h [4:5] - include/__algorithm/for_each_n.h [4:5] - include/__algorithm/generate.h [3:4] - include/__algorithm/generate_n.h [3:4] - include/__algorithm/half_positive.h [3:4] - include/__algorithm/includes.h [3:4] - include/__algorithm/inplace_merge.h [3:4] - include/__algorithm/is_heap.h [3:4] - include/__algorithm/is_heap_until.h [3:4] - include/__algorithm/is_partitioned.h [3:4] - include/__algorithm/is_permutation.h [4:5] - include/__algorithm/is_sorted.h [3:4] - include/__algorithm/is_sorted_until.h [3:4] - include/__algorithm/iter_swap.h [3:4] - include/__algorithm/lexicographical_compare.h [3:4] - include/__algorithm/lower_bound.h [3:4] - include/__algorithm/make_heap.h [3:4] - include/__algorithm/max.h [3:4] - include/__algorithm/max_element.h [3:4] - include/__algorithm/merge.h [3:4] - include/__algorithm/min.h [3:4] - include/__algorithm/min_element.h [3:4] - include/__algorithm/minmax.h [3:4] - include/__algorithm/minmax_element.h [3:4] - include/__algorithm/mismatch.h [4:5] - include/__algorithm/move.h [3:4] - include/__algorithm/move_backward.h [3:4] - include/__algorithm/next_permutation.h [3:4] - include/__algorithm/none_of.h [4:5] - include/__algorithm/nth_element.h [3:4] - include/__algorithm/partial_sort.h [3:4] - include/__algorithm/partial_sort_copy.h [3:4] - include/__algorithm/partition.h [3:4] - include/__algorithm/partition_copy.h [3:4] - include/__algorithm/partition_point.h [3:4] - include/__algorithm/pop_heap.h [3:4] - include/__algorithm/prev_permutation.h [3:4] - include/__algorithm/push_heap.h [3:4] - include/__algorithm/remove.h [3:4] - include/__algorithm/remove_copy.h [3:4] - include/__algorithm/remove_copy_if.h [3:4] - include/__algorithm/remove_if.h [3:4] - include/__algorithm/replace.h [3:4] - include/__algorithm/replace_copy.h [3:4] - include/__algorithm/replace_copy_if.h [3:4] - include/__algorithm/replace_if.h [3:4] - include/__algorithm/reverse.h [3:4] - include/__algorithm/reverse_copy.h [3:4] - include/__algorithm/rotate.h [3:4] - include/__algorithm/rotate_copy.h [3:4] - include/__algorithm/sample.h [3:4] - include/__algorithm/search.h [4:5] - include/__algorithm/search_n.h [4:5] - include/__algorithm/set_difference.h [3:4] - include/__algorithm/set_intersection.h [3:4] - include/__algorithm/set_symmetric_difference.h [3:4] - include/__algorithm/set_union.h [3:4] - include/__algorithm/shift_left.h [3:4] - include/__algorithm/shift_right.h [3:4] - include/__algorithm/shuffle.h [3:4] - include/__algorithm/sift_down.h [3:4] - include/__algorithm/sort.h [3:4] - include/__algorithm/sort_heap.h [3:4] - include/__algorithm/stable_partition.h [3:4] - include/__algorithm/stable_sort.h [3:4] - include/__algorithm/swap_ranges.h [3:4] - include/__algorithm/transform.h [3:4] - include/__algorithm/unique.h [3:4] - include/__algorithm/unique_copy.h [3:4] - include/__algorithm/unwrap_iter.h [3:4] - include/__algorithm/upper_bound.h [3:4] - include/__availability [4:5] - include/__bit/bit_cast.h [4:5] - include/__bit_reference [4:5] - include/__bits [4:5] - include/__bsd_locale_defaults.h [4:5] - include/__bsd_locale_fallbacks.h [4:5] - include/__charconv/chars_format.h [4:5] - include/__charconv/from_chars_result.h [4:5] - include/__charconv/to_chars_result.h [4:5] - include/__compare/common_comparison_category.h [3:4] - include/__compare/compare_three_way_result.h [3:4] - include/__compare/ordering.h [3:4] - include/__compare/synth_three_way.h [3:4] - include/__compare/three_way_comparable.h [3:4] - include/__concepts/arithmetic.h [3:4] - include/__concepts/assignable.h [3:4] - include/__concepts/boolean_testable.h [3:4] - include/__concepts/class_or_enum.h [3:4] - include/__concepts/common_reference_with.h [3:4] - include/__concepts/common_with.h [3:4] - include/__concepts/constructible.h [3:4] - include/__concepts/convertible_to.h [3:4] - include/__concepts/copyable.h [3:4] - include/__concepts/derived_from.h [3:4] - include/__concepts/destructible.h [3:4] - include/__concepts/different_from.h [3:4] - include/__concepts/equality_comparable.h [3:4] - include/__concepts/invocable.h [3:4] - include/__concepts/movable.h [3:4] - include/__concepts/predicate.h [3:4] - include/__concepts/regular.h [3:4] - include/__concepts/relation.h [3:4] - include/__concepts/same_as.h [3:4] - include/__concepts/semiregular.h [3:4] - include/__concepts/swappable.h [3:4] - include/__concepts/totally_ordered.h [3:4] - include/__config [4:5] - include/__config_site.in [3:4] - include/__debug [4:5] - include/__errc [4:5] - include/__format/format_arg.h [4:5] - include/__format/format_args.h [4:5] - include/__format/format_context.h [4:5] - include/__format/format_error.h [4:5] - include/__format/format_fwd.h [4:5] - include/__format/format_parse_context.h [4:5] - include/__format/format_string.h [4:5] - include/__format/formatter.h [4:5] - include/__format/parser_std_format_spec.h [4:5] - include/__function_like.h [4:5] - include/__functional/binary_function.h [4:5] - include/__functional/binary_negate.h [4:5] - include/__functional/bind.h [4:5] - include/__functional/bind_back.h [4:5] - include/__functional/bind_front.h [4:5] - include/__functional/binder1st.h [4:5] - include/__functional/binder2nd.h [4:5] - include/__functional/compose.h [4:5] - include/__functional/default_searcher.h [4:5] - include/__functional/function.h [4:5] - include/__functional/hash.h [3:4] - include/__functional/identity.h [4:5] - include/__functional/invoke.h [4:5] - include/__functional/is_transparent.h [4:5] - include/__functional/mem_fn.h [4:5] - include/__functional/mem_fun_ref.h [4:5] - include/__functional/not_fn.h [4:5] - include/__functional/operations.h [4:5] - include/__functional/perfect_forward.h [4:5] - include/__functional/pointer_to_binary_function.h [4:5] - include/__functional/pointer_to_unary_function.h [4:5] - include/__functional/ranges_operations.h [4:5] - include/__functional/reference_wrapper.h [4:5] - include/__functional/unary_function.h [3:4] - include/__functional/unary_negate.h [4:5] - include/__functional/unwrap_ref.h [3:4] - include/__functional/weak_result_type.h [4:5] - include/__functional_base [4:5] - include/__hash_table [4:5] - include/__iterator/access.h [4:5] - include/__iterator/advance.h [4:5] - include/__iterator/back_insert_iterator.h [4:5] - include/__iterator/common_iterator.h [4:5] - include/__iterator/concepts.h [4:5] - include/__iterator/counted_iterator.h [4:5] - include/__iterator/data.h [4:5] - include/__iterator/default_sentinel.h [4:5] - include/__iterator/distance.h [4:5] - include/__iterator/empty.h [4:5] - include/__iterator/erase_if_container.h [4:5] - include/__iterator/front_insert_iterator.h [4:5] - include/__iterator/incrementable_traits.h [4:5] - include/__iterator/insert_iterator.h [4:5] - include/__iterator/istream_iterator.h [4:5] - include/__iterator/istreambuf_iterator.h [4:5] - include/__iterator/iter_move.h [4:5] - include/__iterator/iter_swap.h [4:5] - include/__iterator/iterator.h [4:5] - include/__iterator/iterator_traits.h [4:5] - include/__iterator/move_iterator.h [4:5] - include/__iterator/next.h [4:5] - include/__iterator/ostream_iterator.h [4:5] - include/__iterator/ostreambuf_iterator.h [4:5] - include/__iterator/prev.h [4:5] - include/__iterator/projected.h [4:5] - include/__iterator/readable_traits.h [4:5] - include/__iterator/reverse_access.h [4:5] - include/__iterator/reverse_iterator.h [4:5] - include/__iterator/size.h [4:5] - include/__iterator/unreachable_sentinel.h [4:5] - include/__iterator/wrap_iter.h [4:5] - include/__locale [4:5] - include/__memory/addressof.h [4:5] - include/__memory/allocation_guard.h [4:5] - include/__memory/allocator.h [4:5] - include/__memory/allocator_arg_t.h [4:5] - include/__memory/allocator_traits.h [4:5] - include/__memory/auto_ptr.h [4:5] - include/__memory/compressed_pair.h [4:5] - include/__memory/construct_at.h [4:5] - include/__memory/pointer_safety.h [4:5] - include/__memory/pointer_traits.h [4:5] - include/__memory/raw_storage_iterator.h [4:5] - include/__memory/shared_ptr.h [4:5] - include/__memory/temporary_buffer.h [4:5] - include/__memory/uninitialized_algorithms.h [4:5] - include/__memory/unique_ptr.h [4:5] - include/__memory/uses_allocator.h [4:5] - include/__mutex_base [4:5] - include/__node_handle [4:5] - include/__nullptr [4:5] - include/__random/uniform_int_distribution.h [3:4] - include/__ranges/access.h [4:5] - include/__ranges/all.h [4:5] - include/__ranges/common_view.h [4:5] - include/__ranges/concepts.h [4:5] - include/__ranges/copyable_box.h [4:5] - include/__ranges/counted.h [4:5] - include/__ranges/dangling.h [4:5] - include/__ranges/data.h [4:5] - include/__ranges/drop_view.h [4:5] - include/__ranges/empty.h [4:5] - include/__ranges/empty_view.h [4:5] - include/__ranges/enable_borrowed_range.h [4:5] - include/__ranges/enable_view.h [4:5] - include/__ranges/iota_view.h [4:5] - include/__ranges/join_view.h [4:5] - include/__ranges/non_propagating_cache.h [4:5] - include/__ranges/range_adaptor.h [4:5] - include/__ranges/ref_view.h [4:5] - include/__ranges/reverse_view.h [4:5] - include/__ranges/single_view.h [4:5] - include/__ranges/size.h [4:5] - include/__ranges/subrange.h [4:5] - include/__ranges/take_view.h [4:5] - include/__ranges/transform_view.h [4:5] - include/__ranges/view_interface.h [4:5] - include/__std_stream [4:5] - include/__string [4:5] - include/__support/android/locale_bionic.h [4:5] - include/__support/fuchsia/xlocale.h [4:5] - include/__support/ibm/gettod_zos.h [4:5] - include/__support/ibm/limits.h [4:5] - include/__support/ibm/locale_mgmt_zos.h [4:5] - include/__support/ibm/nanosleep.h [4:5] - include/__support/ibm/support.h [4:5] - include/__support/ibm/xlocale.h [4:5] - include/__support/musl/xlocale.h [4:5] - include/__support/newlib/xlocale.h [3:4] - include/__support/openbsd/xlocale.h [4:5] - include/__support/solaris/floatingpoint.h [3:4] - include/__support/solaris/wchar.h [3:4] - include/__support/solaris/xlocale.h [3:4] - include/__support/win32/limits_msvc_win32.h [4:5] - include/__support/win32/locale_win32.h [4:5] - include/__support/xlocale/__nop_locale_mgmt.h [4:5] - include/__support/xlocale/__posix_l_fallback.h [4:5] - include/__support/xlocale/__strtonum_fallback.h [4:5] - include/__threading_support [4:5] - include/__tree [4:5] - include/__tuple [4:5] - include/__undef_macros [4:5] - include/__utility/as_const.h [3:4] - include/__utility/cmp.h [3:4] - include/__utility/decay_copy.h [4:5] - include/__utility/declval.h [3:4] - include/__utility/exchange.h [3:4] - include/__utility/forward.h [4:5] - include/__utility/in_place.h [3:4] - include/__utility/integer_sequence.h [3:4] - include/__utility/move.h [4:5] - include/__utility/pair.h [3:4] - include/__utility/piecewise_construct.h [3:4] - include/__utility/rel_ops.h [3:4] - include/__utility/swap.h [3:4] - include/__utility/to_underlying.h [4:5] - include/__variant/monostate.h [4:5] - include/algorithm [4:5] - include/any [4:5] - include/array [4:5] - include/atomic [4:5] - include/barrier [4:5] - include/bit [4:5] - include/bitset [4:5] - include/cassert [4:5] - include/ccomplex [4:5] - include/cctype [4:5] - include/cerrno [4:5] - include/cfenv [4:5] - include/cfloat [4:5] - include/charconv [4:5] - include/chrono [4:5] - include/cinttypes [4:5] - include/ciso646 [4:5] - include/climits [4:5] - include/clocale [4:5] - include/cmath [4:5] - include/codecvt [4:5] - include/compare [4:5] - include/complex [4:5] - include/complex.h [4:5] - include/concepts [4:5] - include/condition_variable [4:5] - include/csetjmp [4:5] - include/csignal [4:5] - include/cstdarg [4:5] - include/cstdbool [4:5] - include/cstddef [4:5] - include/cstdint [4:5] - include/cstdio [4:5] - include/cstdlib [4:5] - include/cstring [4:5] - include/ctgmath [4:5] - include/ctime [4:5] - include/ctype.h [4:5] - include/cwchar [4:5] - include/cwctype [4:5] - include/deque [4:5] - include/errno.h [4:5] - include/exception [4:5] - include/execution [4:5] - include/experimental/__memory [4:5] - include/experimental/algorithm [4:5] - include/experimental/coroutine [4:5] - include/experimental/deque [4:5] - include/experimental/filesystem [4:5] - include/experimental/forward_list [4:5] - include/experimental/functional [4:5] - include/experimental/iterator [4:5] - include/experimental/list [4:5] - include/experimental/map [4:5] - include/experimental/memory_resource [4:5] - include/experimental/propagate_const [4:5] - include/experimental/regex [4:5] - include/experimental/set [4:5] - include/experimental/simd [4:5] - include/experimental/string [4:5] - include/experimental/type_traits [4:5] - include/experimental/unordered_map [4:5] - include/experimental/unordered_set [4:5] - include/experimental/utility [4:5] - include/experimental/vector [4:5] - include/ext/__hash [4:5] - include/ext/hash_map [4:5] - include/ext/hash_set [4:5] - include/filesystem [4:5] - include/float.h [4:5] - include/format [4:5] - include/forward_list [4:5] - include/fstream [4:5] - include/functional [4:5] - include/future [4:5] - include/initializer_list [4:5] - include/inttypes.h [4:5] - include/iomanip [4:5] - include/ios [4:5] - include/iosfwd [4:5] - include/iostream [4:5] - include/istream [4:5] - include/iterator [4:5] - include/latch [4:5] - include/limits [4:5] - include/limits.h [4:5] - include/list [4:5] - include/locale [4:5] - include/locale.h [4:5] - include/map [4:5] - include/math.h [4:5] - include/memory [4:5] - include/mutex [4:5] - include/new [4:5] - include/numbers [4:5] - include/numeric [4:5] - include/optional [4:5] - include/ostream [4:5] - include/queue [4:5] - include/random [4:5] - include/ranges [4:5] - include/ratio [4:5] - include/regex [4:5] - include/scoped_allocator [4:5] - include/semaphore [4:5] - include/set [4:5] - include/setjmp.h [4:5] - include/shared_mutex [4:5] - include/span [4:5] - include/sstream [4:5] - include/stack [4:5] - include/stdbool.h [4:5] - include/stddef.h [4:5] - include/stdexcept [4:5] - include/stdint.h [4:5] - include/stdio.h [4:5] - include/stdlib.h [4:5] - include/streambuf [4:5] - include/string [4:5] - include/string.h [4:5] - include/string_view [4:5] - include/strstream [4:5] - include/system_error [4:5] - include/tgmath.h [4:5] - include/thread [4:5] - include/tuple [4:5] - include/type_traits [4:5] - include/typeindex [4:5] - include/typeinfo [4:5] - include/unordered_map [4:5] - include/unordered_set [4:5] - include/utility [4:5] - include/valarray [4:5] - include/variant [4:5] - include/vector [4:5] - include/version [4:5] - include/wchar.h [4:5] - include/wctype.h [4:5] - src/algorithm.cpp [3:4] - src/any.cpp [3:4] - src/atomic.cpp [3:4] - src/barrier.cpp [3:4] - src/bind.cpp [3:4] - src/charconv.cpp [3:4] - src/chrono.cpp [3:4] - src/condition_variable.cpp [3:4] - src/condition_variable_destructor.cpp [3:4] - src/debug.cpp [3:4] - src/exception.cpp [3:4] - src/experimental/memory_resource.cpp [3:4] - src/filesystem/directory_iterator.cpp [3:4] - src/filesystem/filesystem_common.h [3:4] - src/filesystem/operations.cpp [3:4] - src/filesystem/posix_compat.h [3:4] - src/format.cpp [3:4] - src/functional.cpp [3:4] - src/future.cpp [3:4] - src/hash.cpp [3:4] - src/include/apple_availability.h [3:4] - src/include/atomic_support.h [3:4] - src/include/config_elast.h [3:4] - src/include/refstring.h [3:4] - src/include/sso_allocator.h [4:5] - src/ios.cpp [3:4] - src/ios.instantiations.cpp [3:4] - src/iostream.cpp [3:4] - src/locale.cpp [3:4] - src/memory.cpp [3:4] - src/mutex.cpp [3:4] - src/mutex_destructor.cpp [3:4] - src/new.cpp [3:4] - src/optional.cpp [3:4] - src/random.cpp [3:4] - src/random_shuffle.cpp [3:4] - src/regex.cpp [3:4] - src/shared_mutex.cpp [3:4] - src/stdexcept.cpp [3:4] - src/string.cpp [3:4] - src/strstream.cpp [3:4] - src/support/ibm/mbsnrtowcs.cpp [3:4] - src/support/ibm/wcsnrtombs.cpp [3:4] - src/support/ibm/xlocale_zos.cpp [3:4] - src/support/runtime/exception_fallback.ipp [4:5] - src/support/runtime/exception_glibcxx.ipp [4:5] - src/support/runtime/exception_libcxxabi.ipp [4:5] - src/support/runtime/exception_libcxxrt.ipp [4:5] - src/support/runtime/exception_msvc.ipp [4:5] - src/support/runtime/exception_pointer_cxxabi.ipp [4:5] - src/support/runtime/exception_pointer_glibcxx.ipp [4:5] - src/support/runtime/exception_pointer_msvc.ipp [4:5] - src/support/runtime/exception_pointer_unimplemented.ipp [4:5] - src/support/runtime/new_handler_fallback.ipp [4:5] - src/support/runtime/stdexcept_default.ipp [3:4] - src/support/runtime/stdexcept_vcruntime.ipp [3:4] - src/support/solaris/xlocale.cpp [3:4] - src/support/win32/locale_win32.cpp [4:5] - src/support/win32/support.cpp [4:5] - src/support/win32/thread_win32.cpp [4:5] - src/system_error.cpp [3:4] - src/thread.cpp [3:4] - src/typeinfo.cpp [3:4] - src/utility.cpp [3:4] - src/valarray.cpp [3:4] - src/variant.cpp [3:4] - src/vector.cpp [3:4] + include/__algorithm/adjacent_find.h [4:5] + include/__algorithm/all_of.h [4:5] + include/__algorithm/any_of.h [4:5] + include/__algorithm/binary_search.h [3:4] + include/__algorithm/clamp.h [3:4] + include/__algorithm/comp.h [3:4] + include/__algorithm/comp_ref_type.h [3:4] + include/__algorithm/copy.h [3:4] + include/__algorithm/copy_backward.h [3:4] + include/__algorithm/copy_if.h [3:4] + include/__algorithm/copy_n.h [3:4] + include/__algorithm/count.h [4:5] + include/__algorithm/count_if.h [4:5] + include/__algorithm/equal.h [4:5] + include/__algorithm/equal_range.h [3:4] + include/__algorithm/fill.h [3:4] + include/__algorithm/fill_n.h [3:4] + include/__algorithm/find.h [4:5] + include/__algorithm/find_end.h [4:5] + include/__algorithm/find_first_of.h [4:5] + include/__algorithm/find_if.h [4:5] + include/__algorithm/find_if_not.h [4:5] + include/__algorithm/for_each.h [4:5] + include/__algorithm/for_each_n.h [4:5] + include/__algorithm/generate.h [3:4] + include/__algorithm/generate_n.h [3:4] + include/__algorithm/half_positive.h [3:4] + include/__algorithm/includes.h [3:4] + include/__algorithm/inplace_merge.h [3:4] + include/__algorithm/is_heap.h [3:4] + include/__algorithm/is_heap_until.h [3:4] + include/__algorithm/is_partitioned.h [3:4] + include/__algorithm/is_permutation.h [4:5] + include/__algorithm/is_sorted.h [3:4] + include/__algorithm/is_sorted_until.h [3:4] + include/__algorithm/iter_swap.h [3:4] + include/__algorithm/lexicographical_compare.h [3:4] + include/__algorithm/lower_bound.h [3:4] + include/__algorithm/make_heap.h [3:4] + include/__algorithm/max.h [3:4] + include/__algorithm/max_element.h [3:4] + include/__algorithm/merge.h [3:4] + include/__algorithm/min.h [3:4] + include/__algorithm/min_element.h [3:4] + include/__algorithm/minmax.h [3:4] + include/__algorithm/minmax_element.h [3:4] + include/__algorithm/mismatch.h [4:5] + include/__algorithm/move.h [3:4] + include/__algorithm/move_backward.h [3:4] + include/__algorithm/next_permutation.h [3:4] + include/__algorithm/none_of.h [4:5] + include/__algorithm/nth_element.h [3:4] + include/__algorithm/partial_sort.h [3:4] + include/__algorithm/partial_sort_copy.h [3:4] + include/__algorithm/partition.h [3:4] + include/__algorithm/partition_copy.h [3:4] + include/__algorithm/partition_point.h [3:4] + include/__algorithm/pop_heap.h [3:4] + include/__algorithm/prev_permutation.h [3:4] + include/__algorithm/push_heap.h [3:4] + include/__algorithm/remove.h [3:4] + include/__algorithm/remove_copy.h [3:4] + include/__algorithm/remove_copy_if.h [3:4] + include/__algorithm/remove_if.h [3:4] + include/__algorithm/replace.h [3:4] + include/__algorithm/replace_copy.h [3:4] + include/__algorithm/replace_copy_if.h [3:4] + include/__algorithm/replace_if.h [3:4] + include/__algorithm/reverse.h [3:4] + include/__algorithm/reverse_copy.h [3:4] + include/__algorithm/rotate.h [3:4] + include/__algorithm/rotate_copy.h [3:4] + include/__algorithm/sample.h [3:4] + include/__algorithm/search.h [4:5] + include/__algorithm/search_n.h [4:5] + include/__algorithm/set_difference.h [3:4] + include/__algorithm/set_intersection.h [3:4] + include/__algorithm/set_symmetric_difference.h [3:4] + include/__algorithm/set_union.h [3:4] + include/__algorithm/shift_left.h [3:4] + include/__algorithm/shift_right.h [3:4] + include/__algorithm/shuffle.h [3:4] + include/__algorithm/sift_down.h [3:4] + include/__algorithm/sort.h [3:4] + include/__algorithm/sort_heap.h [3:4] + include/__algorithm/stable_partition.h [3:4] + include/__algorithm/stable_sort.h [3:4] + include/__algorithm/swap_ranges.h [3:4] + include/__algorithm/transform.h [3:4] + include/__algorithm/unique.h [3:4] + include/__algorithm/unique_copy.h [3:4] + include/__algorithm/unwrap_iter.h [3:4] + include/__algorithm/upper_bound.h [3:4] + include/__availability [4:5] + include/__bit/bit_cast.h [4:5] + include/__bit_reference [4:5] + include/__bits [4:5] + include/__bsd_locale_defaults.h [4:5] + include/__bsd_locale_fallbacks.h [4:5] + include/__charconv/chars_format.h [4:5] + include/__charconv/from_chars_result.h [4:5] + include/__charconv/to_chars_result.h [4:5] + include/__compare/common_comparison_category.h [3:4] + include/__compare/compare_three_way_result.h [3:4] + include/__compare/ordering.h [3:4] + include/__compare/synth_three_way.h [3:4] + include/__compare/three_way_comparable.h [3:4] + include/__concepts/arithmetic.h [3:4] + include/__concepts/assignable.h [3:4] + include/__concepts/boolean_testable.h [3:4] + include/__concepts/class_or_enum.h [3:4] + include/__concepts/common_reference_with.h [3:4] + include/__concepts/common_with.h [3:4] + include/__concepts/constructible.h [3:4] + include/__concepts/convertible_to.h [3:4] + include/__concepts/copyable.h [3:4] + include/__concepts/derived_from.h [3:4] + include/__concepts/destructible.h [3:4] + include/__concepts/different_from.h [3:4] + include/__concepts/equality_comparable.h [3:4] + include/__concepts/invocable.h [3:4] + include/__concepts/movable.h [3:4] + include/__concepts/predicate.h [3:4] + include/__concepts/regular.h [3:4] + include/__concepts/relation.h [3:4] + include/__concepts/same_as.h [3:4] + include/__concepts/semiregular.h [3:4] + include/__concepts/swappable.h [3:4] + include/__concepts/totally_ordered.h [3:4] + include/__config [4:5] + include/__config_site.in [3:4] + include/__debug [4:5] + include/__errc [4:5] + include/__format/format_arg.h [4:5] + include/__format/format_args.h [4:5] + include/__format/format_context.h [4:5] + include/__format/format_error.h [4:5] + include/__format/format_fwd.h [4:5] + include/__format/format_parse_context.h [4:5] + include/__format/format_string.h [4:5] + include/__format/formatter.h [4:5] + include/__format/parser_std_format_spec.h [4:5] + include/__function_like.h [4:5] + include/__functional/binary_function.h [4:5] + include/__functional/binary_negate.h [4:5] + include/__functional/bind.h [4:5] + include/__functional/bind_back.h [4:5] + include/__functional/bind_front.h [4:5] + include/__functional/binder1st.h [4:5] + include/__functional/binder2nd.h [4:5] + include/__functional/compose.h [4:5] + include/__functional/default_searcher.h [4:5] + include/__functional/function.h [4:5] + include/__functional/hash.h [3:4] + include/__functional/identity.h [4:5] + include/__functional/invoke.h [4:5] + include/__functional/is_transparent.h [4:5] + include/__functional/mem_fn.h [4:5] + include/__functional/mem_fun_ref.h [4:5] + include/__functional/not_fn.h [4:5] + include/__functional/operations.h [4:5] + include/__functional/perfect_forward.h [4:5] + include/__functional/pointer_to_binary_function.h [4:5] + include/__functional/pointer_to_unary_function.h [4:5] + include/__functional/ranges_operations.h [4:5] + include/__functional/reference_wrapper.h [4:5] + include/__functional/unary_function.h [3:4] + include/__functional/unary_negate.h [4:5] + include/__functional/unwrap_ref.h [3:4] + include/__functional/weak_result_type.h [4:5] + include/__functional_base [4:5] + include/__hash_table [4:5] + include/__iterator/access.h [4:5] + include/__iterator/advance.h [4:5] + include/__iterator/back_insert_iterator.h [4:5] + include/__iterator/common_iterator.h [4:5] + include/__iterator/concepts.h [4:5] + include/__iterator/counted_iterator.h [4:5] + include/__iterator/data.h [4:5] + include/__iterator/default_sentinel.h [4:5] + include/__iterator/distance.h [4:5] + include/__iterator/empty.h [4:5] + include/__iterator/erase_if_container.h [4:5] + include/__iterator/front_insert_iterator.h [4:5] + include/__iterator/incrementable_traits.h [4:5] + include/__iterator/insert_iterator.h [4:5] + include/__iterator/istream_iterator.h [4:5] + include/__iterator/istreambuf_iterator.h [4:5] + include/__iterator/iter_move.h [4:5] + include/__iterator/iter_swap.h [4:5] + include/__iterator/iterator.h [4:5] + include/__iterator/iterator_traits.h [4:5] + include/__iterator/move_iterator.h [4:5] + include/__iterator/next.h [4:5] + include/__iterator/ostream_iterator.h [4:5] + include/__iterator/ostreambuf_iterator.h [4:5] + include/__iterator/prev.h [4:5] + include/__iterator/projected.h [4:5] + include/__iterator/readable_traits.h [4:5] + include/__iterator/reverse_access.h [4:5] + include/__iterator/reverse_iterator.h [4:5] + include/__iterator/size.h [4:5] + include/__iterator/unreachable_sentinel.h [4:5] + include/__iterator/wrap_iter.h [4:5] + include/__locale [4:5] + include/__memory/addressof.h [4:5] + include/__memory/allocation_guard.h [4:5] + include/__memory/allocator.h [4:5] + include/__memory/allocator_arg_t.h [4:5] + include/__memory/allocator_traits.h [4:5] + include/__memory/auto_ptr.h [4:5] + include/__memory/compressed_pair.h [4:5] + include/__memory/construct_at.h [4:5] + include/__memory/pointer_safety.h [4:5] + include/__memory/pointer_traits.h [4:5] + include/__memory/raw_storage_iterator.h [4:5] + include/__memory/shared_ptr.h [4:5] + include/__memory/temporary_buffer.h [4:5] + include/__memory/uninitialized_algorithms.h [4:5] + include/__memory/unique_ptr.h [4:5] + include/__memory/uses_allocator.h [4:5] + include/__mutex_base [4:5] + include/__node_handle [4:5] + include/__nullptr [4:5] + include/__random/uniform_int_distribution.h [3:4] + include/__ranges/access.h [4:5] + include/__ranges/all.h [4:5] + include/__ranges/common_view.h [4:5] + include/__ranges/concepts.h [4:5] + include/__ranges/copyable_box.h [4:5] + include/__ranges/counted.h [4:5] + include/__ranges/dangling.h [4:5] + include/__ranges/data.h [4:5] + include/__ranges/drop_view.h [4:5] + include/__ranges/empty.h [4:5] + include/__ranges/empty_view.h [4:5] + include/__ranges/enable_borrowed_range.h [4:5] + include/__ranges/enable_view.h [4:5] + include/__ranges/iota_view.h [4:5] + include/__ranges/join_view.h [4:5] + include/__ranges/non_propagating_cache.h [4:5] + include/__ranges/range_adaptor.h [4:5] + include/__ranges/ref_view.h [4:5] + include/__ranges/reverse_view.h [4:5] + include/__ranges/single_view.h [4:5] + include/__ranges/size.h [4:5] + include/__ranges/subrange.h [4:5] + include/__ranges/take_view.h [4:5] + include/__ranges/transform_view.h [4:5] + include/__ranges/view_interface.h [4:5] + include/__std_stream [4:5] + include/__string [4:5] + include/__support/android/locale_bionic.h [4:5] + include/__support/fuchsia/xlocale.h [4:5] + include/__support/ibm/gettod_zos.h [4:5] + include/__support/ibm/limits.h [4:5] + include/__support/ibm/locale_mgmt_zos.h [4:5] + include/__support/ibm/nanosleep.h [4:5] + include/__support/ibm/support.h [4:5] + include/__support/ibm/xlocale.h [4:5] + include/__support/musl/xlocale.h [4:5] + include/__support/newlib/xlocale.h [3:4] + include/__support/openbsd/xlocale.h [4:5] + include/__support/solaris/floatingpoint.h [3:4] + include/__support/solaris/wchar.h [3:4] + include/__support/solaris/xlocale.h [3:4] + include/__support/win32/limits_msvc_win32.h [4:5] + include/__support/win32/locale_win32.h [4:5] + include/__support/xlocale/__nop_locale_mgmt.h [4:5] + include/__support/xlocale/__posix_l_fallback.h [4:5] + include/__support/xlocale/__strtonum_fallback.h [4:5] + include/__threading_support [4:5] + include/__tree [4:5] + include/__tuple [4:5] + include/__undef_macros [4:5] + include/__utility/as_const.h [3:4] + include/__utility/cmp.h [3:4] + include/__utility/decay_copy.h [4:5] + include/__utility/declval.h [3:4] + include/__utility/exchange.h [3:4] + include/__utility/forward.h [4:5] + include/__utility/in_place.h [3:4] + include/__utility/integer_sequence.h [3:4] + include/__utility/move.h [4:5] + include/__utility/pair.h [3:4] + include/__utility/piecewise_construct.h [3:4] + include/__utility/rel_ops.h [3:4] + include/__utility/swap.h [3:4] + include/__utility/to_underlying.h [4:5] + include/__variant/monostate.h [4:5] + include/algorithm [4:5] + include/any [4:5] + include/array [4:5] + include/atomic [4:5] + include/barrier [4:5] + include/bit [4:5] + include/bitset [4:5] + include/cassert [4:5] + include/ccomplex [4:5] + include/cctype [4:5] + include/cerrno [4:5] + include/cfenv [4:5] + include/cfloat [4:5] + include/charconv [4:5] + include/chrono [4:5] + include/cinttypes [4:5] + include/ciso646 [4:5] + include/climits [4:5] + include/clocale [4:5] + include/cmath [4:5] + include/codecvt [4:5] + include/compare [4:5] + include/complex [4:5] + include/complex.h [4:5] + include/concepts [4:5] + include/condition_variable [4:5] + include/csetjmp [4:5] + include/csignal [4:5] + include/cstdarg [4:5] + include/cstdbool [4:5] + include/cstddef [4:5] + include/cstdint [4:5] + include/cstdio [4:5] + include/cstdlib [4:5] + include/cstring [4:5] + include/ctgmath [4:5] + include/ctime [4:5] + include/ctype.h [4:5] + include/cwchar [4:5] + include/cwctype [4:5] + include/deque [4:5] + include/errno.h [4:5] + include/exception [4:5] + include/execution [4:5] + include/experimental/__memory [4:5] + include/experimental/algorithm [4:5] + include/experimental/coroutine [4:5] + include/experimental/deque [4:5] + include/experimental/filesystem [4:5] + include/experimental/forward_list [4:5] + include/experimental/functional [4:5] + include/experimental/iterator [4:5] + include/experimental/list [4:5] + include/experimental/map [4:5] + include/experimental/memory_resource [4:5] + include/experimental/propagate_const [4:5] + include/experimental/regex [4:5] + include/experimental/set [4:5] + include/experimental/simd [4:5] + include/experimental/string [4:5] + include/experimental/type_traits [4:5] + include/experimental/unordered_map [4:5] + include/experimental/unordered_set [4:5] + include/experimental/utility [4:5] + include/experimental/vector [4:5] + include/ext/__hash [4:5] + include/ext/hash_map [4:5] + include/ext/hash_set [4:5] + include/filesystem [4:5] + include/float.h [4:5] + include/format [4:5] + include/forward_list [4:5] + include/fstream [4:5] + include/functional [4:5] + include/future [4:5] + include/initializer_list [4:5] + include/inttypes.h [4:5] + include/iomanip [4:5] + include/ios [4:5] + include/iosfwd [4:5] + include/iostream [4:5] + include/istream [4:5] + include/iterator [4:5] + include/latch [4:5] + include/limits [4:5] + include/limits.h [4:5] + include/list [4:5] + include/locale [4:5] + include/locale.h [4:5] + include/map [4:5] + include/math.h [4:5] + include/memory [4:5] + include/mutex [4:5] + include/new [4:5] + include/numbers [4:5] + include/numeric [4:5] + include/optional [4:5] + include/ostream [4:5] + include/queue [4:5] + include/random [4:5] + include/ranges [4:5] + include/ratio [4:5] + include/regex [4:5] + include/scoped_allocator [4:5] + include/semaphore [4:5] + include/set [4:5] + include/setjmp.h [4:5] + include/shared_mutex [4:5] + include/span [4:5] + include/sstream [4:5] + include/stack [4:5] + include/stdbool.h [4:5] + include/stddef.h [4:5] + include/stdexcept [4:5] + include/stdint.h [4:5] + include/stdio.h [4:5] + include/stdlib.h [4:5] + include/streambuf [4:5] + include/string [4:5] + include/string.h [4:5] + include/string_view [4:5] + include/strstream [4:5] + include/system_error [4:5] + include/tgmath.h [4:5] + include/thread [4:5] + include/tuple [4:5] + include/type_traits [4:5] + include/typeindex [4:5] + include/typeinfo [4:5] + include/unordered_map [4:5] + include/unordered_set [4:5] + include/utility [4:5] + include/valarray [4:5] + include/variant [4:5] + include/vector [4:5] + include/version [4:5] + include/wchar.h [4:5] + include/wctype.h [4:5] + src/algorithm.cpp [3:4] + src/any.cpp [3:4] + src/atomic.cpp [3:4] + src/barrier.cpp [3:4] + src/bind.cpp [3:4] + src/charconv.cpp [3:4] + src/chrono.cpp [3:4] + src/condition_variable.cpp [3:4] + src/condition_variable_destructor.cpp [3:4] + src/debug.cpp [3:4] + src/exception.cpp [3:4] + src/experimental/memory_resource.cpp [3:4] + src/filesystem/directory_iterator.cpp [3:4] + src/filesystem/filesystem_common.h [3:4] + src/filesystem/operations.cpp [3:4] + src/filesystem/posix_compat.h [3:4] + src/format.cpp [3:4] + src/functional.cpp [3:4] + src/future.cpp [3:4] + src/hash.cpp [3:4] + src/include/apple_availability.h [3:4] + src/include/atomic_support.h [3:4] + src/include/config_elast.h [3:4] + src/include/refstring.h [3:4] + src/include/sso_allocator.h [4:5] + src/ios.cpp [3:4] + src/ios.instantiations.cpp [3:4] + src/iostream.cpp [3:4] + src/locale.cpp [3:4] + src/memory.cpp [3:4] + src/mutex.cpp [3:4] + src/mutex_destructor.cpp [3:4] + src/new.cpp [3:4] + src/optional.cpp [3:4] + src/random.cpp [3:4] + src/random_shuffle.cpp [3:4] + src/regex.cpp [3:4] + src/shared_mutex.cpp [3:4] + src/stdexcept.cpp [3:4] + src/string.cpp [3:4] + src/strstream.cpp [3:4] + src/support/ibm/mbsnrtowcs.cpp [3:4] + src/support/ibm/wcsnrtombs.cpp [3:4] + src/support/ibm/xlocale_zos.cpp [3:4] + src/support/runtime/exception_fallback.ipp [4:5] + src/support/runtime/exception_glibcxx.ipp [4:5] + src/support/runtime/exception_libcxxabi.ipp [4:5] + src/support/runtime/exception_libcxxrt.ipp [4:5] + src/support/runtime/exception_msvc.ipp [4:5] + src/support/runtime/exception_pointer_cxxabi.ipp [4:5] + src/support/runtime/exception_pointer_glibcxx.ipp [4:5] + src/support/runtime/exception_pointer_msvc.ipp [4:5] + src/support/runtime/exception_pointer_unimplemented.ipp [4:5] + src/support/runtime/new_handler_fallback.ipp [4:5] + src/support/runtime/stdexcept_default.ipp [3:4] + src/support/runtime/stdexcept_vcruntime.ipp [3:4] + src/support/solaris/xlocale.cpp [3:4] + src/support/win32/locale_win32.cpp [4:5] + src/support/win32/support.cpp [4:5] + src/support/win32/thread_win32.cpp [4:5] + src/system_error.cpp [3:4] + src/thread.cpp [3:4] + src/typeinfo.cpp [3:4] + src/utility.cpp [3:4] + src/valarray.cpp [3:4] + src/variant.cpp [3:4] + src/vector.cpp [3:4] KEEP Apache-2.0 WITH LLVM-exception 8494a9caed330d9a4f40e19cce7dc770 -BELONGS ya.make -FILE_INCLUDE include/exception found in files: LICENSE.TXT at line 210 +BELONGS ya.make +FILE_INCLUDE include/exception found in files: LICENSE.TXT at line 210 Note: matched license text is too long. Read it in the source files. Scancode info: Original SPDX id: LLVM-exception @@ -1110,10 +1110,10 @@ FILE_INCLUDE include/exception found in files: LICENSE.TXT at line 210 Match type : TEXT Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - LICENSE.TXT [208:222] + LICENSE.TXT [208:222] KEEP Apache-2.0 WITH LLVM-exception 86617d55e1d949711c543404d91f4cea -BELONGS ya.make +BELONGS ya.make License text: // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception Scancode info: @@ -1122,21 +1122,21 @@ BELONGS ya.make Match type : TAG Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - include/experimental/__config [6:6] + include/experimental/__config [6:6] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : TAG Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - include/experimental/__config [6:6] + include/experimental/__config [6:6] KEEP Apache-2.0 9ac77f65a898755c7eed97099caded94 -BELONGS ya.make -FILE_INCLUDE import found in files: LICENSE.TXT at line 81 -FILE_INCLUDE include/any found in files: LICENSE.TXT at line 101, LICENSE.TXT at line 104, LICENSE.TXT at line 107, LICENSE.TXT at line 111, LICENSE.TXT at line 114, LICENSE.TXT at line 130, LICENSE.TXT at line 135, LICENSE.TXT at line 137, LICENSE.TXT at line 139, LICENSE.TXT at line 151, LICENSE.TXT at line 154, LICENSE.TXT at line 160, LICENSE.TXT at line 161, LICENSE.TXT at line 162, LICENSE.TXT at line 165, LICENSE.TXT at line 175, LICENSE.TXT at line 176, LICENSE.TXT at line 178, LICENSE.TXT at line 34, LICENSE.TXT at line 44, LICENSE.TXT at line 52, LICENSE.TXT at line 53, LICENSE.TXT at line 58, LICENSE.TXT at line 66, LICENSE.TXT at line 86, LICENSE.TXT at line 89, LICENSE.TXT at line 94, LICENSE.TXT at line 98 -FILE_INCLUDE include/format found in files: LICENSE.TXT at line 188 -FILE_INCLUDE include/version found in files: LICENSE.TXT at line 53 +BELONGS ya.make +FILE_INCLUDE import found in files: LICENSE.TXT at line 81 +FILE_INCLUDE include/any found in files: LICENSE.TXT at line 101, LICENSE.TXT at line 104, LICENSE.TXT at line 107, LICENSE.TXT at line 111, LICENSE.TXT at line 114, LICENSE.TXT at line 130, LICENSE.TXT at line 135, LICENSE.TXT at line 137, LICENSE.TXT at line 139, LICENSE.TXT at line 151, LICENSE.TXT at line 154, LICENSE.TXT at line 160, LICENSE.TXT at line 161, LICENSE.TXT at line 162, LICENSE.TXT at line 165, LICENSE.TXT at line 175, LICENSE.TXT at line 176, LICENSE.TXT at line 178, LICENSE.TXT at line 34, LICENSE.TXT at line 44, LICENSE.TXT at line 52, LICENSE.TXT at line 53, LICENSE.TXT at line 58, LICENSE.TXT at line 66, LICENSE.TXT at line 86, LICENSE.TXT at line 89, LICENSE.TXT at line 94, LICENSE.TXT at line 98 +FILE_INCLUDE include/format found in files: LICENSE.TXT at line 188 +FILE_INCLUDE include/version found in files: LICENSE.TXT at line 53 # any and version - just words, not file reference Note: matched license text is too long. Read it in the source files. Scancode info: @@ -1145,13 +1145,13 @@ FILE_INCLUDE include/version found in files: LICENSE.TXT at line 53 Match type : TEXT Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - LICENSE.TXT [5:205] + LICENSE.TXT [5:205] KEEP NCSA b160d8bd561da097b0edd40b062e1c84 -BELONGS ya.make -FILE_INCLUDE include/any found in files: LICENSE.TXT at line 264 -FILE_INCLUDE include/experimental/list found in files: LICENSE.TXT at line 272, LICENSE.TXT at line 275 -FILE_INCLUDE include/list found in files: LICENSE.TXT at line 272, LICENSE.TXT at line 275 +BELONGS ya.make +FILE_INCLUDE include/any found in files: LICENSE.TXT at line 264 +FILE_INCLUDE include/experimental/list found in files: LICENSE.TXT at line 272, LICENSE.TXT at line 275 +FILE_INCLUDE include/list found in files: LICENSE.TXT at line 272, LICENSE.TXT at line 275 # any and list - just words, not file reference Note: matched license text is too long. Read it in the source files. Scancode info: @@ -1160,10 +1160,10 @@ FILE_INCLUDE include/list found in files: LICENSE.TXT at line 272, LICENSE.TXT a Match type : TEXT Links : http://www.otm.illinois.edu/faculty/forms/opensource.asp, https://spdx.org/licenses/NCSA Files with this license: - LICENSE.TXT [264:289] + LICENSE.TXT [264:289] KEEP BSD-2-Clause AND MIT b1ce5ac90fd7360272c132242b0d10e9 -BELONGS ya.make +BELONGS ya.make License text: 2-clause BSD license instead of the MIT/UUIC license that the rest of libc++ is Scancode info: @@ -1172,17 +1172,17 @@ BELONGS ya.make Match type : REFERENCE Links : http://opensource.org/licenses/bsd-license.php, http://www.opensource.org/licenses/BSD-2-Clause, https://spdx.org/licenses/BSD-2-Clause Files with this license: - src/support/solaris/README [3:3] + src/support/solaris/README [3:3] Scancode info: Original SPDX id: MIT Score : 75.00 Match type : REFERENCE Links : http://opensource.org/licenses/mit-license.php, https://spdx.org/licenses/MIT Files with this license: - src/support/solaris/README [3:3] + src/support/solaris/README [3:3] KEEP Apache-2.0 WITH LLVM-exception b4f32daeb289687c0be6afeacb7df231 -BELONGS ya.make +BELONGS ya.make License text: // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -1192,17 +1192,17 @@ BELONGS ya.make Match type : NOTICE Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - include/experimental/__config [4:5] + include/experimental/__config [4:5] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : NOTICE Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - include/experimental/__config [4:5] + include/experimental/__config [4:5] KEEP Apache-2.0 WITH LLVM-exception b7566a1930e050e1090162bf1d543650 -BELONGS ya.make +BELONGS ya.make License text: // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception Scancode info: @@ -1211,1005 +1211,1005 @@ BELONGS ya.make Match type : TAG Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - include/__algorithm/adjacent_find.h [6:6] - include/__algorithm/all_of.h [6:6] - include/__algorithm/any_of.h [6:6] - include/__algorithm/binary_search.h [5:5] - include/__algorithm/clamp.h [5:5] - include/__algorithm/comp.h [5:5] - include/__algorithm/comp_ref_type.h [5:5] - include/__algorithm/copy.h [5:5] - include/__algorithm/copy_backward.h [5:5] - include/__algorithm/copy_if.h [5:5] - include/__algorithm/copy_n.h [5:5] - include/__algorithm/count.h [6:6] - include/__algorithm/count_if.h [6:6] - include/__algorithm/equal.h [6:6] - include/__algorithm/equal_range.h [5:5] - include/__algorithm/fill.h [5:5] - include/__algorithm/fill_n.h [5:5] - include/__algorithm/find.h [6:6] - include/__algorithm/find_end.h [6:6] - include/__algorithm/find_first_of.h [6:6] - include/__algorithm/find_if.h [6:6] - include/__algorithm/find_if_not.h [6:6] - include/__algorithm/for_each.h [6:6] - include/__algorithm/for_each_n.h [6:6] - include/__algorithm/generate.h [5:5] - include/__algorithm/generate_n.h [5:5] - include/__algorithm/half_positive.h [5:5] - include/__algorithm/includes.h [5:5] - include/__algorithm/inplace_merge.h [5:5] - include/__algorithm/is_heap.h [5:5] - include/__algorithm/is_heap_until.h [5:5] - include/__algorithm/is_partitioned.h [5:5] - include/__algorithm/is_permutation.h [6:6] - include/__algorithm/is_sorted.h [5:5] - include/__algorithm/is_sorted_until.h [5:5] - include/__algorithm/iter_swap.h [5:5] - include/__algorithm/lexicographical_compare.h [5:5] - include/__algorithm/lower_bound.h [5:5] - include/__algorithm/make_heap.h [5:5] - include/__algorithm/max.h [5:5] - include/__algorithm/max_element.h [5:5] - include/__algorithm/merge.h [5:5] - include/__algorithm/min.h [5:5] - include/__algorithm/min_element.h [5:5] - include/__algorithm/minmax.h [5:5] - include/__algorithm/minmax_element.h [5:5] - include/__algorithm/mismatch.h [6:6] - include/__algorithm/move.h [5:5] - include/__algorithm/move_backward.h [5:5] - include/__algorithm/next_permutation.h [5:5] - include/__algorithm/none_of.h [6:6] - include/__algorithm/nth_element.h [5:5] - include/__algorithm/partial_sort.h [5:5] - include/__algorithm/partial_sort_copy.h [5:5] - include/__algorithm/partition.h [5:5] - include/__algorithm/partition_copy.h [5:5] - include/__algorithm/partition_point.h [5:5] - include/__algorithm/pop_heap.h [5:5] - include/__algorithm/prev_permutation.h [5:5] - include/__algorithm/push_heap.h [5:5] - include/__algorithm/remove.h [5:5] - include/__algorithm/remove_copy.h [5:5] - include/__algorithm/remove_copy_if.h [5:5] - include/__algorithm/remove_if.h [5:5] - include/__algorithm/replace.h [5:5] - include/__algorithm/replace_copy.h [5:5] - include/__algorithm/replace_copy_if.h [5:5] - include/__algorithm/replace_if.h [5:5] - include/__algorithm/reverse.h [5:5] - include/__algorithm/reverse_copy.h [5:5] - include/__algorithm/rotate.h [5:5] - include/__algorithm/rotate_copy.h [5:5] - include/__algorithm/sample.h [5:5] - include/__algorithm/search.h [6:6] - include/__algorithm/search_n.h [6:6] - include/__algorithm/set_difference.h [5:5] - include/__algorithm/set_intersection.h [5:5] - include/__algorithm/set_symmetric_difference.h [5:5] - include/__algorithm/set_union.h [5:5] - include/__algorithm/shift_left.h [5:5] - include/__algorithm/shift_right.h [5:5] - include/__algorithm/shuffle.h [5:5] - include/__algorithm/sift_down.h [5:5] - include/__algorithm/sort.h [5:5] - include/__algorithm/sort_heap.h [5:5] - include/__algorithm/stable_partition.h [5:5] - include/__algorithm/stable_sort.h [5:5] - include/__algorithm/swap_ranges.h [5:5] - include/__algorithm/transform.h [5:5] - include/__algorithm/unique.h [5:5] - include/__algorithm/unique_copy.h [5:5] - include/__algorithm/unwrap_iter.h [5:5] - include/__algorithm/upper_bound.h [5:5] - include/__availability [6:6] - include/__bit/bit_cast.h [6:6] - include/__bit_reference [6:6] - include/__bits [6:6] - include/__bsd_locale_defaults.h [6:6] - include/__bsd_locale_fallbacks.h [6:6] - include/__charconv/chars_format.h [6:6] - include/__charconv/from_chars_result.h [6:6] - include/__charconv/to_chars_result.h [6:6] - include/__compare/common_comparison_category.h [5:5] - include/__compare/compare_three_way_result.h [5:5] - include/__compare/ordering.h [5:5] - include/__compare/synth_three_way.h [5:5] - include/__compare/three_way_comparable.h [5:5] - include/__concepts/arithmetic.h [5:5] - include/__concepts/assignable.h [5:5] - include/__concepts/boolean_testable.h [5:5] - include/__concepts/class_or_enum.h [5:5] - include/__concepts/common_reference_with.h [5:5] - include/__concepts/common_with.h [5:5] - include/__concepts/constructible.h [5:5] - include/__concepts/convertible_to.h [5:5] - include/__concepts/copyable.h [5:5] - include/__concepts/derived_from.h [5:5] - include/__concepts/destructible.h [5:5] - include/__concepts/different_from.h [5:5] - include/__concepts/equality_comparable.h [5:5] - include/__concepts/invocable.h [5:5] - include/__concepts/movable.h [5:5] - include/__concepts/predicate.h [5:5] - include/__concepts/regular.h [5:5] - include/__concepts/relation.h [5:5] - include/__concepts/same_as.h [5:5] - include/__concepts/semiregular.h [5:5] - include/__concepts/swappable.h [5:5] - include/__concepts/totally_ordered.h [5:5] - include/__config [6:6] - include/__config_site.in [5:5] - include/__debug [6:6] - include/__errc [6:6] - include/__format/format_arg.h [6:6] - include/__format/format_args.h [6:6] - include/__format/format_context.h [6:6] - include/__format/format_error.h [6:6] - include/__format/format_fwd.h [6:6] - include/__format/format_parse_context.h [6:6] - include/__format/format_string.h [6:6] - include/__format/formatter.h [6:6] - include/__format/parser_std_format_spec.h [6:6] - include/__function_like.h [6:6] - include/__functional/binary_function.h [6:6] - include/__functional/binary_negate.h [6:6] - include/__functional/bind.h [6:6] - include/__functional/bind_back.h [6:6] - include/__functional/bind_front.h [6:6] - include/__functional/binder1st.h [6:6] - include/__functional/binder2nd.h [6:6] - include/__functional/compose.h [6:6] - include/__functional/default_searcher.h [6:6] - include/__functional/function.h [6:6] - include/__functional/hash.h [5:5] - include/__functional/identity.h [6:6] - include/__functional/invoke.h [6:6] - include/__functional/is_transparent.h [6:6] - include/__functional/mem_fn.h [6:6] - include/__functional/mem_fun_ref.h [6:6] - include/__functional/not_fn.h [6:6] - include/__functional/operations.h [6:6] - include/__functional/perfect_forward.h [6:6] - include/__functional/pointer_to_binary_function.h [6:6] - include/__functional/pointer_to_unary_function.h [6:6] - include/__functional/ranges_operations.h [6:6] - include/__functional/reference_wrapper.h [6:6] - include/__functional/unary_function.h [5:5] - include/__functional/unary_negate.h [6:6] - include/__functional/unwrap_ref.h [5:5] - include/__functional/weak_result_type.h [6:6] - include/__functional_base [6:6] - include/__hash_table [6:6] - include/__iterator/access.h [6:6] - include/__iterator/advance.h [6:6] - include/__iterator/back_insert_iterator.h [6:6] - include/__iterator/common_iterator.h [6:6] - include/__iterator/concepts.h [6:6] - include/__iterator/counted_iterator.h [6:6] - include/__iterator/data.h [6:6] - include/__iterator/default_sentinel.h [6:6] - include/__iterator/distance.h [6:6] - include/__iterator/empty.h [6:6] - include/__iterator/erase_if_container.h [6:6] - include/__iterator/front_insert_iterator.h [6:6] - include/__iterator/incrementable_traits.h [6:6] - include/__iterator/insert_iterator.h [6:6] - include/__iterator/istream_iterator.h [6:6] - include/__iterator/istreambuf_iterator.h [6:6] - include/__iterator/iter_move.h [6:6] - include/__iterator/iter_swap.h [6:6] - include/__iterator/iterator.h [6:6] - include/__iterator/iterator_traits.h [6:6] - include/__iterator/move_iterator.h [6:6] - include/__iterator/next.h [6:6] - include/__iterator/ostream_iterator.h [6:6] - include/__iterator/ostreambuf_iterator.h [6:6] - include/__iterator/prev.h [6:6] - include/__iterator/projected.h [6:6] - include/__iterator/readable_traits.h [6:6] - include/__iterator/reverse_access.h [6:6] - include/__iterator/reverse_iterator.h [6:6] - include/__iterator/size.h [6:6] - include/__iterator/unreachable_sentinel.h [6:6] - include/__iterator/wrap_iter.h [6:6] - include/__locale [6:6] - include/__memory/addressof.h [6:6] - include/__memory/allocation_guard.h [6:6] - include/__memory/allocator.h [6:6] - include/__memory/allocator_arg_t.h [6:6] - include/__memory/allocator_traits.h [6:6] - include/__memory/auto_ptr.h [6:6] - include/__memory/compressed_pair.h [6:6] - include/__memory/construct_at.h [6:6] - include/__memory/pointer_safety.h [6:6] - include/__memory/pointer_traits.h [6:6] - include/__memory/raw_storage_iterator.h [6:6] - include/__memory/shared_ptr.h [6:6] - include/__memory/temporary_buffer.h [6:6] - include/__memory/uninitialized_algorithms.h [6:6] - include/__memory/unique_ptr.h [6:6] - include/__memory/uses_allocator.h [6:6] - include/__mutex_base [6:6] - include/__node_handle [6:6] - include/__nullptr [6:6] - include/__random/uniform_int_distribution.h [5:5] - include/__ranges/access.h [6:6] - include/__ranges/all.h [6:6] - include/__ranges/common_view.h [6:6] - include/__ranges/concepts.h [6:6] - include/__ranges/copyable_box.h [6:6] - include/__ranges/counted.h [6:6] - include/__ranges/dangling.h [6:6] - include/__ranges/data.h [6:6] - include/__ranges/drop_view.h [6:6] - include/__ranges/empty.h [6:6] - include/__ranges/empty_view.h [6:6] - include/__ranges/enable_borrowed_range.h [6:6] - include/__ranges/enable_view.h [6:6] - include/__ranges/iota_view.h [6:6] - include/__ranges/join_view.h [6:6] - include/__ranges/non_propagating_cache.h [6:6] - include/__ranges/range_adaptor.h [6:6] - include/__ranges/ref_view.h [6:6] - include/__ranges/reverse_view.h [6:6] - include/__ranges/single_view.h [6:6] - include/__ranges/size.h [6:6] - include/__ranges/subrange.h [6:6] - include/__ranges/take_view.h [6:6] - include/__ranges/transform_view.h [6:6] - include/__ranges/view_interface.h [6:6] - include/__std_stream [6:6] - include/__string [6:6] - include/__support/android/locale_bionic.h [6:6] - include/__support/fuchsia/xlocale.h [6:6] - include/__support/ibm/gettod_zos.h [6:6] - include/__support/ibm/limits.h [6:6] - include/__support/ibm/locale_mgmt_zos.h [6:6] - include/__support/ibm/nanosleep.h [6:6] - include/__support/ibm/support.h [6:6] - include/__support/ibm/xlocale.h [6:6] - include/__support/musl/xlocale.h [6:6] - include/__support/newlib/xlocale.h [5:5] - include/__support/openbsd/xlocale.h [6:6] - include/__support/solaris/floatingpoint.h [5:5] - include/__support/solaris/wchar.h [5:5] - include/__support/solaris/xlocale.h [5:5] - include/__support/win32/limits_msvc_win32.h [6:6] - include/__support/win32/locale_win32.h [6:6] - include/__support/xlocale/__nop_locale_mgmt.h [6:6] - include/__support/xlocale/__posix_l_fallback.h [6:6] - include/__support/xlocale/__strtonum_fallback.h [6:6] - include/__threading_support [6:6] - include/__tree [6:6] - include/__tuple [6:6] - include/__undef_macros [6:6] - include/__utility/as_const.h [5:5] - include/__utility/cmp.h [5:5] - include/__utility/decay_copy.h [6:6] - include/__utility/declval.h [5:5] - include/__utility/exchange.h [5:5] - include/__utility/forward.h [6:6] - include/__utility/in_place.h [5:5] - include/__utility/integer_sequence.h [5:5] - include/__utility/move.h [6:6] - include/__utility/pair.h [5:5] - include/__utility/piecewise_construct.h [5:5] - include/__utility/rel_ops.h [5:5] - include/__utility/swap.h [5:5] - include/__utility/to_underlying.h [6:6] - include/__variant/monostate.h [6:6] - include/algorithm [6:6] - include/any [6:6] - include/array [6:6] - include/atomic [6:6] - include/barrier [6:6] - include/bit [6:6] - include/bitset [6:6] - include/cassert [6:6] - include/ccomplex [6:6] - include/cctype [6:6] - include/cerrno [6:6] - include/cfenv [6:6] - include/cfloat [6:6] - include/charconv [6:6] - include/chrono [6:6] - include/cinttypes [6:6] - include/ciso646 [6:6] - include/climits [6:6] - include/clocale [6:6] - include/cmath [6:6] - include/codecvt [6:6] - include/compare [6:6] - include/complex [6:6] - include/complex.h [6:6] - include/concepts [6:6] - include/condition_variable [6:6] - include/csetjmp [6:6] - include/csignal [6:6] - include/cstdarg [6:6] - include/cstdbool [6:6] - include/cstddef [6:6] - include/cstdint [6:6] - include/cstdio [6:6] - include/cstdlib [6:6] - include/cstring [6:6] - include/ctgmath [6:6] - include/ctime [6:6] - include/ctype.h [6:6] - include/cwchar [6:6] - include/cwctype [6:6] - include/deque [6:6] - include/errno.h [6:6] - include/exception [6:6] - include/execution [6:6] - include/experimental/__memory [6:6] - include/experimental/algorithm [6:6] - include/experimental/coroutine [6:6] - include/experimental/deque [6:6] - include/experimental/filesystem [6:6] - include/experimental/forward_list [6:6] - include/experimental/functional [6:6] - include/experimental/iterator [6:6] - include/experimental/list [6:6] - include/experimental/map [6:6] - include/experimental/memory_resource [6:6] - include/experimental/propagate_const [6:6] - include/experimental/regex [6:6] - include/experimental/set [6:6] - include/experimental/simd [6:6] - include/experimental/string [6:6] - include/experimental/type_traits [6:6] - include/experimental/unordered_map [6:6] - include/experimental/unordered_set [6:6] - include/experimental/utility [6:6] - include/experimental/vector [6:6] - include/ext/__hash [6:6] - include/ext/hash_map [6:6] - include/ext/hash_set [6:6] - include/filesystem [6:6] - include/float.h [6:6] - include/format [6:6] - include/forward_list [6:6] - include/fstream [6:6] - include/functional [6:6] - include/future [6:6] - include/initializer_list [6:6] - include/inttypes.h [6:6] - include/iomanip [6:6] - include/ios [6:6] - include/iosfwd [6:6] - include/iostream [6:6] - include/istream [6:6] - include/iterator [6:6] - include/latch [6:6] - include/limits [6:6] - include/limits.h [6:6] - include/list [6:6] - include/locale [6:6] - include/locale.h [6:6] - include/map [6:6] - include/math.h [6:6] - include/memory [6:6] - include/mutex [6:6] - include/new [6:6] - include/numbers [6:6] - include/numeric [6:6] - include/optional [6:6] - include/ostream [6:6] - include/queue [6:6] - include/random [6:6] - include/ranges [6:6] - include/ratio [6:6] - include/regex [6:6] - include/scoped_allocator [6:6] - include/semaphore [6:6] - include/set [6:6] - include/setjmp.h [6:6] - include/shared_mutex [6:6] - include/span [6:6] - include/sstream [6:6] - include/stack [6:6] - include/stdbool.h [6:6] - include/stddef.h [6:6] - include/stdexcept [6:6] - include/stdint.h [6:6] - include/stdio.h [6:6] - include/stdlib.h [6:6] - include/streambuf [6:6] - include/string [6:6] - include/string.h [6:6] - include/string_view [6:6] - include/strstream [6:6] - include/system_error [6:6] - include/tgmath.h [6:6] - include/thread [6:6] - include/tuple [6:6] - include/type_traits [6:6] - include/typeindex [6:6] - include/typeinfo [6:6] - include/unordered_map [6:6] - include/unordered_set [6:6] - include/utility [6:6] - include/valarray [6:6] - include/variant [6:6] - include/vector [6:6] - include/version [6:6] - include/wchar.h [6:6] - include/wctype.h [6:6] - src/algorithm.cpp [5:5] - src/any.cpp [5:5] - src/atomic.cpp [5:5] - src/barrier.cpp [5:5] - src/bind.cpp [5:5] - src/charconv.cpp [5:5] - src/chrono.cpp [5:5] - src/condition_variable.cpp [5:5] - src/condition_variable_destructor.cpp [5:5] - src/debug.cpp [5:5] - src/exception.cpp [5:5] - src/experimental/memory_resource.cpp [5:5] - src/filesystem/directory_iterator.cpp [5:5] - src/filesystem/filesystem_common.h [5:5] - src/filesystem/operations.cpp [5:5] - src/filesystem/posix_compat.h [5:5] - src/format.cpp [5:5] - src/functional.cpp [5:5] - src/future.cpp [5:5] - src/hash.cpp [5:5] - src/include/apple_availability.h [5:5] - src/include/atomic_support.h [5:5] - src/include/config_elast.h [5:5] - src/include/refstring.h [5:5] - src/include/sso_allocator.h [6:6] - src/ios.cpp [5:5] - src/ios.instantiations.cpp [5:5] - src/iostream.cpp [5:5] - src/locale.cpp [5:5] - src/memory.cpp [5:5] - src/mutex.cpp [5:5] - src/mutex_destructor.cpp [5:5] - src/new.cpp [5:5] - src/optional.cpp [5:5] - src/random.cpp [5:5] - src/random_shuffle.cpp [5:5] - src/regex.cpp [5:5] - src/shared_mutex.cpp [5:5] - src/stdexcept.cpp [5:5] - src/string.cpp [5:5] - src/strstream.cpp [5:5] - src/support/ibm/mbsnrtowcs.cpp [5:5] - src/support/ibm/wcsnrtombs.cpp [5:5] - src/support/ibm/xlocale_zos.cpp [5:5] - src/support/runtime/exception_fallback.ipp [6:6] - src/support/runtime/exception_glibcxx.ipp [6:6] - src/support/runtime/exception_libcxxabi.ipp [6:6] - src/support/runtime/exception_libcxxrt.ipp [6:6] - src/support/runtime/exception_msvc.ipp [6:6] - src/support/runtime/exception_pointer_cxxabi.ipp [6:6] - src/support/runtime/exception_pointer_glibcxx.ipp [6:6] - src/support/runtime/exception_pointer_msvc.ipp [6:6] - src/support/runtime/exception_pointer_unimplemented.ipp [6:6] - src/support/runtime/new_handler_fallback.ipp [6:6] - src/support/runtime/stdexcept_default.ipp [5:5] - src/support/runtime/stdexcept_vcruntime.ipp [5:5] - src/support/solaris/xlocale.cpp [5:5] - src/support/win32/locale_win32.cpp [6:6] - src/support/win32/support.cpp [6:6] - src/support/win32/thread_win32.cpp [6:6] - src/system_error.cpp [5:5] - src/thread.cpp [5:5] - src/typeinfo.cpp [5:5] - src/utility.cpp [5:5] - src/valarray.cpp [5:5] - src/variant.cpp [5:5] - src/vector.cpp [5:5] + include/__algorithm/adjacent_find.h [6:6] + include/__algorithm/all_of.h [6:6] + include/__algorithm/any_of.h [6:6] + include/__algorithm/binary_search.h [5:5] + include/__algorithm/clamp.h [5:5] + include/__algorithm/comp.h [5:5] + include/__algorithm/comp_ref_type.h [5:5] + include/__algorithm/copy.h [5:5] + include/__algorithm/copy_backward.h [5:5] + include/__algorithm/copy_if.h [5:5] + include/__algorithm/copy_n.h [5:5] + include/__algorithm/count.h [6:6] + include/__algorithm/count_if.h [6:6] + include/__algorithm/equal.h [6:6] + include/__algorithm/equal_range.h [5:5] + include/__algorithm/fill.h [5:5] + include/__algorithm/fill_n.h [5:5] + include/__algorithm/find.h [6:6] + include/__algorithm/find_end.h [6:6] + include/__algorithm/find_first_of.h [6:6] + include/__algorithm/find_if.h [6:6] + include/__algorithm/find_if_not.h [6:6] + include/__algorithm/for_each.h [6:6] + include/__algorithm/for_each_n.h [6:6] + include/__algorithm/generate.h [5:5] + include/__algorithm/generate_n.h [5:5] + include/__algorithm/half_positive.h [5:5] + include/__algorithm/includes.h [5:5] + include/__algorithm/inplace_merge.h [5:5] + include/__algorithm/is_heap.h [5:5] + include/__algorithm/is_heap_until.h [5:5] + include/__algorithm/is_partitioned.h [5:5] + include/__algorithm/is_permutation.h [6:6] + include/__algorithm/is_sorted.h [5:5] + include/__algorithm/is_sorted_until.h [5:5] + include/__algorithm/iter_swap.h [5:5] + include/__algorithm/lexicographical_compare.h [5:5] + include/__algorithm/lower_bound.h [5:5] + include/__algorithm/make_heap.h [5:5] + include/__algorithm/max.h [5:5] + include/__algorithm/max_element.h [5:5] + include/__algorithm/merge.h [5:5] + include/__algorithm/min.h [5:5] + include/__algorithm/min_element.h [5:5] + include/__algorithm/minmax.h [5:5] + include/__algorithm/minmax_element.h [5:5] + include/__algorithm/mismatch.h [6:6] + include/__algorithm/move.h [5:5] + include/__algorithm/move_backward.h [5:5] + include/__algorithm/next_permutation.h [5:5] + include/__algorithm/none_of.h [6:6] + include/__algorithm/nth_element.h [5:5] + include/__algorithm/partial_sort.h [5:5] + include/__algorithm/partial_sort_copy.h [5:5] + include/__algorithm/partition.h [5:5] + include/__algorithm/partition_copy.h [5:5] + include/__algorithm/partition_point.h [5:5] + include/__algorithm/pop_heap.h [5:5] + include/__algorithm/prev_permutation.h [5:5] + include/__algorithm/push_heap.h [5:5] + include/__algorithm/remove.h [5:5] + include/__algorithm/remove_copy.h [5:5] + include/__algorithm/remove_copy_if.h [5:5] + include/__algorithm/remove_if.h [5:5] + include/__algorithm/replace.h [5:5] + include/__algorithm/replace_copy.h [5:5] + include/__algorithm/replace_copy_if.h [5:5] + include/__algorithm/replace_if.h [5:5] + include/__algorithm/reverse.h [5:5] + include/__algorithm/reverse_copy.h [5:5] + include/__algorithm/rotate.h [5:5] + include/__algorithm/rotate_copy.h [5:5] + include/__algorithm/sample.h [5:5] + include/__algorithm/search.h [6:6] + include/__algorithm/search_n.h [6:6] + include/__algorithm/set_difference.h [5:5] + include/__algorithm/set_intersection.h [5:5] + include/__algorithm/set_symmetric_difference.h [5:5] + include/__algorithm/set_union.h [5:5] + include/__algorithm/shift_left.h [5:5] + include/__algorithm/shift_right.h [5:5] + include/__algorithm/shuffle.h [5:5] + include/__algorithm/sift_down.h [5:5] + include/__algorithm/sort.h [5:5] + include/__algorithm/sort_heap.h [5:5] + include/__algorithm/stable_partition.h [5:5] + include/__algorithm/stable_sort.h [5:5] + include/__algorithm/swap_ranges.h [5:5] + include/__algorithm/transform.h [5:5] + include/__algorithm/unique.h [5:5] + include/__algorithm/unique_copy.h [5:5] + include/__algorithm/unwrap_iter.h [5:5] + include/__algorithm/upper_bound.h [5:5] + include/__availability [6:6] + include/__bit/bit_cast.h [6:6] + include/__bit_reference [6:6] + include/__bits [6:6] + include/__bsd_locale_defaults.h [6:6] + include/__bsd_locale_fallbacks.h [6:6] + include/__charconv/chars_format.h [6:6] + include/__charconv/from_chars_result.h [6:6] + include/__charconv/to_chars_result.h [6:6] + include/__compare/common_comparison_category.h [5:5] + include/__compare/compare_three_way_result.h [5:5] + include/__compare/ordering.h [5:5] + include/__compare/synth_three_way.h [5:5] + include/__compare/three_way_comparable.h [5:5] + include/__concepts/arithmetic.h [5:5] + include/__concepts/assignable.h [5:5] + include/__concepts/boolean_testable.h [5:5] + include/__concepts/class_or_enum.h [5:5] + include/__concepts/common_reference_with.h [5:5] + include/__concepts/common_with.h [5:5] + include/__concepts/constructible.h [5:5] + include/__concepts/convertible_to.h [5:5] + include/__concepts/copyable.h [5:5] + include/__concepts/derived_from.h [5:5] + include/__concepts/destructible.h [5:5] + include/__concepts/different_from.h [5:5] + include/__concepts/equality_comparable.h [5:5] + include/__concepts/invocable.h [5:5] + include/__concepts/movable.h [5:5] + include/__concepts/predicate.h [5:5] + include/__concepts/regular.h [5:5] + include/__concepts/relation.h [5:5] + include/__concepts/same_as.h [5:5] + include/__concepts/semiregular.h [5:5] + include/__concepts/swappable.h [5:5] + include/__concepts/totally_ordered.h [5:5] + include/__config [6:6] + include/__config_site.in [5:5] + include/__debug [6:6] + include/__errc [6:6] + include/__format/format_arg.h [6:6] + include/__format/format_args.h [6:6] + include/__format/format_context.h [6:6] + include/__format/format_error.h [6:6] + include/__format/format_fwd.h [6:6] + include/__format/format_parse_context.h [6:6] + include/__format/format_string.h [6:6] + include/__format/formatter.h [6:6] + include/__format/parser_std_format_spec.h [6:6] + include/__function_like.h [6:6] + include/__functional/binary_function.h [6:6] + include/__functional/binary_negate.h [6:6] + include/__functional/bind.h [6:6] + include/__functional/bind_back.h [6:6] + include/__functional/bind_front.h [6:6] + include/__functional/binder1st.h [6:6] + include/__functional/binder2nd.h [6:6] + include/__functional/compose.h [6:6] + include/__functional/default_searcher.h [6:6] + include/__functional/function.h [6:6] + include/__functional/hash.h [5:5] + include/__functional/identity.h [6:6] + include/__functional/invoke.h [6:6] + include/__functional/is_transparent.h [6:6] + include/__functional/mem_fn.h [6:6] + include/__functional/mem_fun_ref.h [6:6] + include/__functional/not_fn.h [6:6] + include/__functional/operations.h [6:6] + include/__functional/perfect_forward.h [6:6] + include/__functional/pointer_to_binary_function.h [6:6] + include/__functional/pointer_to_unary_function.h [6:6] + include/__functional/ranges_operations.h [6:6] + include/__functional/reference_wrapper.h [6:6] + include/__functional/unary_function.h [5:5] + include/__functional/unary_negate.h [6:6] + include/__functional/unwrap_ref.h [5:5] + include/__functional/weak_result_type.h [6:6] + include/__functional_base [6:6] + include/__hash_table [6:6] + include/__iterator/access.h [6:6] + include/__iterator/advance.h [6:6] + include/__iterator/back_insert_iterator.h [6:6] + include/__iterator/common_iterator.h [6:6] + include/__iterator/concepts.h [6:6] + include/__iterator/counted_iterator.h [6:6] + include/__iterator/data.h [6:6] + include/__iterator/default_sentinel.h [6:6] + include/__iterator/distance.h [6:6] + include/__iterator/empty.h [6:6] + include/__iterator/erase_if_container.h [6:6] + include/__iterator/front_insert_iterator.h [6:6] + include/__iterator/incrementable_traits.h [6:6] + include/__iterator/insert_iterator.h [6:6] + include/__iterator/istream_iterator.h [6:6] + include/__iterator/istreambuf_iterator.h [6:6] + include/__iterator/iter_move.h [6:6] + include/__iterator/iter_swap.h [6:6] + include/__iterator/iterator.h [6:6] + include/__iterator/iterator_traits.h [6:6] + include/__iterator/move_iterator.h [6:6] + include/__iterator/next.h [6:6] + include/__iterator/ostream_iterator.h [6:6] + include/__iterator/ostreambuf_iterator.h [6:6] + include/__iterator/prev.h [6:6] + include/__iterator/projected.h [6:6] + include/__iterator/readable_traits.h [6:6] + include/__iterator/reverse_access.h [6:6] + include/__iterator/reverse_iterator.h [6:6] + include/__iterator/size.h [6:6] + include/__iterator/unreachable_sentinel.h [6:6] + include/__iterator/wrap_iter.h [6:6] + include/__locale [6:6] + include/__memory/addressof.h [6:6] + include/__memory/allocation_guard.h [6:6] + include/__memory/allocator.h [6:6] + include/__memory/allocator_arg_t.h [6:6] + include/__memory/allocator_traits.h [6:6] + include/__memory/auto_ptr.h [6:6] + include/__memory/compressed_pair.h [6:6] + include/__memory/construct_at.h [6:6] + include/__memory/pointer_safety.h [6:6] + include/__memory/pointer_traits.h [6:6] + include/__memory/raw_storage_iterator.h [6:6] + include/__memory/shared_ptr.h [6:6] + include/__memory/temporary_buffer.h [6:6] + include/__memory/uninitialized_algorithms.h [6:6] + include/__memory/unique_ptr.h [6:6] + include/__memory/uses_allocator.h [6:6] + include/__mutex_base [6:6] + include/__node_handle [6:6] + include/__nullptr [6:6] + include/__random/uniform_int_distribution.h [5:5] + include/__ranges/access.h [6:6] + include/__ranges/all.h [6:6] + include/__ranges/common_view.h [6:6] + include/__ranges/concepts.h [6:6] + include/__ranges/copyable_box.h [6:6] + include/__ranges/counted.h [6:6] + include/__ranges/dangling.h [6:6] + include/__ranges/data.h [6:6] + include/__ranges/drop_view.h [6:6] + include/__ranges/empty.h [6:6] + include/__ranges/empty_view.h [6:6] + include/__ranges/enable_borrowed_range.h [6:6] + include/__ranges/enable_view.h [6:6] + include/__ranges/iota_view.h [6:6] + include/__ranges/join_view.h [6:6] + include/__ranges/non_propagating_cache.h [6:6] + include/__ranges/range_adaptor.h [6:6] + include/__ranges/ref_view.h [6:6] + include/__ranges/reverse_view.h [6:6] + include/__ranges/single_view.h [6:6] + include/__ranges/size.h [6:6] + include/__ranges/subrange.h [6:6] + include/__ranges/take_view.h [6:6] + include/__ranges/transform_view.h [6:6] + include/__ranges/view_interface.h [6:6] + include/__std_stream [6:6] + include/__string [6:6] + include/__support/android/locale_bionic.h [6:6] + include/__support/fuchsia/xlocale.h [6:6] + include/__support/ibm/gettod_zos.h [6:6] + include/__support/ibm/limits.h [6:6] + include/__support/ibm/locale_mgmt_zos.h [6:6] + include/__support/ibm/nanosleep.h [6:6] + include/__support/ibm/support.h [6:6] + include/__support/ibm/xlocale.h [6:6] + include/__support/musl/xlocale.h [6:6] + include/__support/newlib/xlocale.h [5:5] + include/__support/openbsd/xlocale.h [6:6] + include/__support/solaris/floatingpoint.h [5:5] + include/__support/solaris/wchar.h [5:5] + include/__support/solaris/xlocale.h [5:5] + include/__support/win32/limits_msvc_win32.h [6:6] + include/__support/win32/locale_win32.h [6:6] + include/__support/xlocale/__nop_locale_mgmt.h [6:6] + include/__support/xlocale/__posix_l_fallback.h [6:6] + include/__support/xlocale/__strtonum_fallback.h [6:6] + include/__threading_support [6:6] + include/__tree [6:6] + include/__tuple [6:6] + include/__undef_macros [6:6] + include/__utility/as_const.h [5:5] + include/__utility/cmp.h [5:5] + include/__utility/decay_copy.h [6:6] + include/__utility/declval.h [5:5] + include/__utility/exchange.h [5:5] + include/__utility/forward.h [6:6] + include/__utility/in_place.h [5:5] + include/__utility/integer_sequence.h [5:5] + include/__utility/move.h [6:6] + include/__utility/pair.h [5:5] + include/__utility/piecewise_construct.h [5:5] + include/__utility/rel_ops.h [5:5] + include/__utility/swap.h [5:5] + include/__utility/to_underlying.h [6:6] + include/__variant/monostate.h [6:6] + include/algorithm [6:6] + include/any [6:6] + include/array [6:6] + include/atomic [6:6] + include/barrier [6:6] + include/bit [6:6] + include/bitset [6:6] + include/cassert [6:6] + include/ccomplex [6:6] + include/cctype [6:6] + include/cerrno [6:6] + include/cfenv [6:6] + include/cfloat [6:6] + include/charconv [6:6] + include/chrono [6:6] + include/cinttypes [6:6] + include/ciso646 [6:6] + include/climits [6:6] + include/clocale [6:6] + include/cmath [6:6] + include/codecvt [6:6] + include/compare [6:6] + include/complex [6:6] + include/complex.h [6:6] + include/concepts [6:6] + include/condition_variable [6:6] + include/csetjmp [6:6] + include/csignal [6:6] + include/cstdarg [6:6] + include/cstdbool [6:6] + include/cstddef [6:6] + include/cstdint [6:6] + include/cstdio [6:6] + include/cstdlib [6:6] + include/cstring [6:6] + include/ctgmath [6:6] + include/ctime [6:6] + include/ctype.h [6:6] + include/cwchar [6:6] + include/cwctype [6:6] + include/deque [6:6] + include/errno.h [6:6] + include/exception [6:6] + include/execution [6:6] + include/experimental/__memory [6:6] + include/experimental/algorithm [6:6] + include/experimental/coroutine [6:6] + include/experimental/deque [6:6] + include/experimental/filesystem [6:6] + include/experimental/forward_list [6:6] + include/experimental/functional [6:6] + include/experimental/iterator [6:6] + include/experimental/list [6:6] + include/experimental/map [6:6] + include/experimental/memory_resource [6:6] + include/experimental/propagate_const [6:6] + include/experimental/regex [6:6] + include/experimental/set [6:6] + include/experimental/simd [6:6] + include/experimental/string [6:6] + include/experimental/type_traits [6:6] + include/experimental/unordered_map [6:6] + include/experimental/unordered_set [6:6] + include/experimental/utility [6:6] + include/experimental/vector [6:6] + include/ext/__hash [6:6] + include/ext/hash_map [6:6] + include/ext/hash_set [6:6] + include/filesystem [6:6] + include/float.h [6:6] + include/format [6:6] + include/forward_list [6:6] + include/fstream [6:6] + include/functional [6:6] + include/future [6:6] + include/initializer_list [6:6] + include/inttypes.h [6:6] + include/iomanip [6:6] + include/ios [6:6] + include/iosfwd [6:6] + include/iostream [6:6] + include/istream [6:6] + include/iterator [6:6] + include/latch [6:6] + include/limits [6:6] + include/limits.h [6:6] + include/list [6:6] + include/locale [6:6] + include/locale.h [6:6] + include/map [6:6] + include/math.h [6:6] + include/memory [6:6] + include/mutex [6:6] + include/new [6:6] + include/numbers [6:6] + include/numeric [6:6] + include/optional [6:6] + include/ostream [6:6] + include/queue [6:6] + include/random [6:6] + include/ranges [6:6] + include/ratio [6:6] + include/regex [6:6] + include/scoped_allocator [6:6] + include/semaphore [6:6] + include/set [6:6] + include/setjmp.h [6:6] + include/shared_mutex [6:6] + include/span [6:6] + include/sstream [6:6] + include/stack [6:6] + include/stdbool.h [6:6] + include/stddef.h [6:6] + include/stdexcept [6:6] + include/stdint.h [6:6] + include/stdio.h [6:6] + include/stdlib.h [6:6] + include/streambuf [6:6] + include/string [6:6] + include/string.h [6:6] + include/string_view [6:6] + include/strstream [6:6] + include/system_error [6:6] + include/tgmath.h [6:6] + include/thread [6:6] + include/tuple [6:6] + include/type_traits [6:6] + include/typeindex [6:6] + include/typeinfo [6:6] + include/unordered_map [6:6] + include/unordered_set [6:6] + include/utility [6:6] + include/valarray [6:6] + include/variant [6:6] + include/vector [6:6] + include/version [6:6] + include/wchar.h [6:6] + include/wctype.h [6:6] + src/algorithm.cpp [5:5] + src/any.cpp [5:5] + src/atomic.cpp [5:5] + src/barrier.cpp [5:5] + src/bind.cpp [5:5] + src/charconv.cpp [5:5] + src/chrono.cpp [5:5] + src/condition_variable.cpp [5:5] + src/condition_variable_destructor.cpp [5:5] + src/debug.cpp [5:5] + src/exception.cpp [5:5] + src/experimental/memory_resource.cpp [5:5] + src/filesystem/directory_iterator.cpp [5:5] + src/filesystem/filesystem_common.h [5:5] + src/filesystem/operations.cpp [5:5] + src/filesystem/posix_compat.h [5:5] + src/format.cpp [5:5] + src/functional.cpp [5:5] + src/future.cpp [5:5] + src/hash.cpp [5:5] + src/include/apple_availability.h [5:5] + src/include/atomic_support.h [5:5] + src/include/config_elast.h [5:5] + src/include/refstring.h [5:5] + src/include/sso_allocator.h [6:6] + src/ios.cpp [5:5] + src/ios.instantiations.cpp [5:5] + src/iostream.cpp [5:5] + src/locale.cpp [5:5] + src/memory.cpp [5:5] + src/mutex.cpp [5:5] + src/mutex_destructor.cpp [5:5] + src/new.cpp [5:5] + src/optional.cpp [5:5] + src/random.cpp [5:5] + src/random_shuffle.cpp [5:5] + src/regex.cpp [5:5] + src/shared_mutex.cpp [5:5] + src/stdexcept.cpp [5:5] + src/string.cpp [5:5] + src/strstream.cpp [5:5] + src/support/ibm/mbsnrtowcs.cpp [5:5] + src/support/ibm/wcsnrtombs.cpp [5:5] + src/support/ibm/xlocale_zos.cpp [5:5] + src/support/runtime/exception_fallback.ipp [6:6] + src/support/runtime/exception_glibcxx.ipp [6:6] + src/support/runtime/exception_libcxxabi.ipp [6:6] + src/support/runtime/exception_libcxxrt.ipp [6:6] + src/support/runtime/exception_msvc.ipp [6:6] + src/support/runtime/exception_pointer_cxxabi.ipp [6:6] + src/support/runtime/exception_pointer_glibcxx.ipp [6:6] + src/support/runtime/exception_pointer_msvc.ipp [6:6] + src/support/runtime/exception_pointer_unimplemented.ipp [6:6] + src/support/runtime/new_handler_fallback.ipp [6:6] + src/support/runtime/stdexcept_default.ipp [5:5] + src/support/runtime/stdexcept_vcruntime.ipp [5:5] + src/support/solaris/xlocale.cpp [5:5] + src/support/win32/locale_win32.cpp [6:6] + src/support/win32/support.cpp [6:6] + src/support/win32/thread_win32.cpp [6:6] + src/system_error.cpp [5:5] + src/thread.cpp [5:5] + src/typeinfo.cpp [5:5] + src/utility.cpp [5:5] + src/valarray.cpp [5:5] + src/variant.cpp [5:5] + src/vector.cpp [5:5] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : TAG Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - include/__algorithm/adjacent_find.h [6:6] - include/__algorithm/all_of.h [6:6] - include/__algorithm/any_of.h [6:6] - include/__algorithm/binary_search.h [5:5] - include/__algorithm/clamp.h [5:5] - include/__algorithm/comp.h [5:5] - include/__algorithm/comp_ref_type.h [5:5] - include/__algorithm/copy.h [5:5] - include/__algorithm/copy_backward.h [5:5] - include/__algorithm/copy_if.h [5:5] - include/__algorithm/copy_n.h [5:5] - include/__algorithm/count.h [6:6] - include/__algorithm/count_if.h [6:6] - include/__algorithm/equal.h [6:6] - include/__algorithm/equal_range.h [5:5] - include/__algorithm/fill.h [5:5] - include/__algorithm/fill_n.h [5:5] - include/__algorithm/find.h [6:6] - include/__algorithm/find_end.h [6:6] - include/__algorithm/find_first_of.h [6:6] - include/__algorithm/find_if.h [6:6] - include/__algorithm/find_if_not.h [6:6] - include/__algorithm/for_each.h [6:6] - include/__algorithm/for_each_n.h [6:6] - include/__algorithm/generate.h [5:5] - include/__algorithm/generate_n.h [5:5] - include/__algorithm/half_positive.h [5:5] - include/__algorithm/includes.h [5:5] - include/__algorithm/inplace_merge.h [5:5] - include/__algorithm/is_heap.h [5:5] - include/__algorithm/is_heap_until.h [5:5] - include/__algorithm/is_partitioned.h [5:5] - include/__algorithm/is_permutation.h [6:6] - include/__algorithm/is_sorted.h [5:5] - include/__algorithm/is_sorted_until.h [5:5] - include/__algorithm/iter_swap.h [5:5] - include/__algorithm/lexicographical_compare.h [5:5] - include/__algorithm/lower_bound.h [5:5] - include/__algorithm/make_heap.h [5:5] - include/__algorithm/max.h [5:5] - include/__algorithm/max_element.h [5:5] - include/__algorithm/merge.h [5:5] - include/__algorithm/min.h [5:5] - include/__algorithm/min_element.h [5:5] - include/__algorithm/minmax.h [5:5] - include/__algorithm/minmax_element.h [5:5] - include/__algorithm/mismatch.h [6:6] - include/__algorithm/move.h [5:5] - include/__algorithm/move_backward.h [5:5] - include/__algorithm/next_permutation.h [5:5] - include/__algorithm/none_of.h [6:6] - include/__algorithm/nth_element.h [5:5] - include/__algorithm/partial_sort.h [5:5] - include/__algorithm/partial_sort_copy.h [5:5] - include/__algorithm/partition.h [5:5] - include/__algorithm/partition_copy.h [5:5] - include/__algorithm/partition_point.h [5:5] - include/__algorithm/pop_heap.h [5:5] - include/__algorithm/prev_permutation.h [5:5] - include/__algorithm/push_heap.h [5:5] - include/__algorithm/remove.h [5:5] - include/__algorithm/remove_copy.h [5:5] - include/__algorithm/remove_copy_if.h [5:5] - include/__algorithm/remove_if.h [5:5] - include/__algorithm/replace.h [5:5] - include/__algorithm/replace_copy.h [5:5] - include/__algorithm/replace_copy_if.h [5:5] - include/__algorithm/replace_if.h [5:5] - include/__algorithm/reverse.h [5:5] - include/__algorithm/reverse_copy.h [5:5] - include/__algorithm/rotate.h [5:5] - include/__algorithm/rotate_copy.h [5:5] - include/__algorithm/sample.h [5:5] - include/__algorithm/search.h [6:6] - include/__algorithm/search_n.h [6:6] - include/__algorithm/set_difference.h [5:5] - include/__algorithm/set_intersection.h [5:5] - include/__algorithm/set_symmetric_difference.h [5:5] - include/__algorithm/set_union.h [5:5] - include/__algorithm/shift_left.h [5:5] - include/__algorithm/shift_right.h [5:5] - include/__algorithm/shuffle.h [5:5] - include/__algorithm/sift_down.h [5:5] - include/__algorithm/sort.h [5:5] - include/__algorithm/sort_heap.h [5:5] - include/__algorithm/stable_partition.h [5:5] - include/__algorithm/stable_sort.h [5:5] - include/__algorithm/swap_ranges.h [5:5] - include/__algorithm/transform.h [5:5] - include/__algorithm/unique.h [5:5] - include/__algorithm/unique_copy.h [5:5] - include/__algorithm/unwrap_iter.h [5:5] - include/__algorithm/upper_bound.h [5:5] - include/__availability [6:6] - include/__bit/bit_cast.h [6:6] - include/__bit_reference [6:6] - include/__bits [6:6] - include/__bsd_locale_defaults.h [6:6] - include/__bsd_locale_fallbacks.h [6:6] - include/__charconv/chars_format.h [6:6] - include/__charconv/from_chars_result.h [6:6] - include/__charconv/to_chars_result.h [6:6] - include/__compare/common_comparison_category.h [5:5] - include/__compare/compare_three_way_result.h [5:5] - include/__compare/ordering.h [5:5] - include/__compare/synth_three_way.h [5:5] - include/__compare/three_way_comparable.h [5:5] - include/__concepts/arithmetic.h [5:5] - include/__concepts/assignable.h [5:5] - include/__concepts/boolean_testable.h [5:5] - include/__concepts/class_or_enum.h [5:5] - include/__concepts/common_reference_with.h [5:5] - include/__concepts/common_with.h [5:5] - include/__concepts/constructible.h [5:5] - include/__concepts/convertible_to.h [5:5] - include/__concepts/copyable.h [5:5] - include/__concepts/derived_from.h [5:5] - include/__concepts/destructible.h [5:5] - include/__concepts/different_from.h [5:5] - include/__concepts/equality_comparable.h [5:5] - include/__concepts/invocable.h [5:5] - include/__concepts/movable.h [5:5] - include/__concepts/predicate.h [5:5] - include/__concepts/regular.h [5:5] - include/__concepts/relation.h [5:5] - include/__concepts/same_as.h [5:5] - include/__concepts/semiregular.h [5:5] - include/__concepts/swappable.h [5:5] - include/__concepts/totally_ordered.h [5:5] - include/__config [6:6] - include/__config_site.in [5:5] - include/__debug [6:6] - include/__errc [6:6] - include/__format/format_arg.h [6:6] - include/__format/format_args.h [6:6] - include/__format/format_context.h [6:6] - include/__format/format_error.h [6:6] - include/__format/format_fwd.h [6:6] - include/__format/format_parse_context.h [6:6] - include/__format/format_string.h [6:6] - include/__format/formatter.h [6:6] - include/__format/parser_std_format_spec.h [6:6] - include/__function_like.h [6:6] - include/__functional/binary_function.h [6:6] - include/__functional/binary_negate.h [6:6] - include/__functional/bind.h [6:6] - include/__functional/bind_back.h [6:6] - include/__functional/bind_front.h [6:6] - include/__functional/binder1st.h [6:6] - include/__functional/binder2nd.h [6:6] - include/__functional/compose.h [6:6] - include/__functional/default_searcher.h [6:6] - include/__functional/function.h [6:6] - include/__functional/hash.h [5:5] - include/__functional/identity.h [6:6] - include/__functional/invoke.h [6:6] - include/__functional/is_transparent.h [6:6] - include/__functional/mem_fn.h [6:6] - include/__functional/mem_fun_ref.h [6:6] - include/__functional/not_fn.h [6:6] - include/__functional/operations.h [6:6] - include/__functional/perfect_forward.h [6:6] - include/__functional/pointer_to_binary_function.h [6:6] - include/__functional/pointer_to_unary_function.h [6:6] - include/__functional/ranges_operations.h [6:6] - include/__functional/reference_wrapper.h [6:6] - include/__functional/unary_function.h [5:5] - include/__functional/unary_negate.h [6:6] - include/__functional/unwrap_ref.h [5:5] - include/__functional/weak_result_type.h [6:6] - include/__functional_base [6:6] - include/__hash_table [6:6] - include/__iterator/access.h [6:6] - include/__iterator/advance.h [6:6] - include/__iterator/back_insert_iterator.h [6:6] - include/__iterator/common_iterator.h [6:6] - include/__iterator/concepts.h [6:6] - include/__iterator/counted_iterator.h [6:6] - include/__iterator/data.h [6:6] - include/__iterator/default_sentinel.h [6:6] - include/__iterator/distance.h [6:6] - include/__iterator/empty.h [6:6] - include/__iterator/erase_if_container.h [6:6] - include/__iterator/front_insert_iterator.h [6:6] - include/__iterator/incrementable_traits.h [6:6] - include/__iterator/insert_iterator.h [6:6] - include/__iterator/istream_iterator.h [6:6] - include/__iterator/istreambuf_iterator.h [6:6] - include/__iterator/iter_move.h [6:6] - include/__iterator/iter_swap.h [6:6] - include/__iterator/iterator.h [6:6] - include/__iterator/iterator_traits.h [6:6] - include/__iterator/move_iterator.h [6:6] - include/__iterator/next.h [6:6] - include/__iterator/ostream_iterator.h [6:6] - include/__iterator/ostreambuf_iterator.h [6:6] - include/__iterator/prev.h [6:6] - include/__iterator/projected.h [6:6] - include/__iterator/readable_traits.h [6:6] - include/__iterator/reverse_access.h [6:6] - include/__iterator/reverse_iterator.h [6:6] - include/__iterator/size.h [6:6] - include/__iterator/unreachable_sentinel.h [6:6] - include/__iterator/wrap_iter.h [6:6] - include/__locale [6:6] - include/__memory/addressof.h [6:6] - include/__memory/allocation_guard.h [6:6] - include/__memory/allocator.h [6:6] - include/__memory/allocator_arg_t.h [6:6] - include/__memory/allocator_traits.h [6:6] - include/__memory/auto_ptr.h [6:6] - include/__memory/compressed_pair.h [6:6] - include/__memory/construct_at.h [6:6] - include/__memory/pointer_safety.h [6:6] - include/__memory/pointer_traits.h [6:6] - include/__memory/raw_storage_iterator.h [6:6] - include/__memory/shared_ptr.h [6:6] - include/__memory/temporary_buffer.h [6:6] - include/__memory/uninitialized_algorithms.h [6:6] - include/__memory/unique_ptr.h [6:6] - include/__memory/uses_allocator.h [6:6] - include/__mutex_base [6:6] - include/__node_handle [6:6] - include/__nullptr [6:6] - include/__random/uniform_int_distribution.h [5:5] - include/__ranges/access.h [6:6] - include/__ranges/all.h [6:6] - include/__ranges/common_view.h [6:6] - include/__ranges/concepts.h [6:6] - include/__ranges/copyable_box.h [6:6] - include/__ranges/counted.h [6:6] - include/__ranges/dangling.h [6:6] - include/__ranges/data.h [6:6] - include/__ranges/drop_view.h [6:6] - include/__ranges/empty.h [6:6] - include/__ranges/empty_view.h [6:6] - include/__ranges/enable_borrowed_range.h [6:6] - include/__ranges/enable_view.h [6:6] - include/__ranges/iota_view.h [6:6] - include/__ranges/join_view.h [6:6] - include/__ranges/non_propagating_cache.h [6:6] - include/__ranges/range_adaptor.h [6:6] - include/__ranges/ref_view.h [6:6] - include/__ranges/reverse_view.h [6:6] - include/__ranges/single_view.h [6:6] - include/__ranges/size.h [6:6] - include/__ranges/subrange.h [6:6] - include/__ranges/take_view.h [6:6] - include/__ranges/transform_view.h [6:6] - include/__ranges/view_interface.h [6:6] - include/__std_stream [6:6] - include/__string [6:6] - include/__support/android/locale_bionic.h [6:6] - include/__support/fuchsia/xlocale.h [6:6] - include/__support/ibm/gettod_zos.h [6:6] - include/__support/ibm/limits.h [6:6] - include/__support/ibm/locale_mgmt_zos.h [6:6] - include/__support/ibm/nanosleep.h [6:6] - include/__support/ibm/support.h [6:6] - include/__support/ibm/xlocale.h [6:6] - include/__support/musl/xlocale.h [6:6] - include/__support/newlib/xlocale.h [5:5] - include/__support/openbsd/xlocale.h [6:6] - include/__support/solaris/floatingpoint.h [5:5] - include/__support/solaris/wchar.h [5:5] - include/__support/solaris/xlocale.h [5:5] - include/__support/win32/limits_msvc_win32.h [6:6] - include/__support/win32/locale_win32.h [6:6] - include/__support/xlocale/__nop_locale_mgmt.h [6:6] - include/__support/xlocale/__posix_l_fallback.h [6:6] - include/__support/xlocale/__strtonum_fallback.h [6:6] - include/__threading_support [6:6] - include/__tree [6:6] - include/__tuple [6:6] - include/__undef_macros [6:6] - include/__utility/as_const.h [5:5] - include/__utility/cmp.h [5:5] - include/__utility/decay_copy.h [6:6] - include/__utility/declval.h [5:5] - include/__utility/exchange.h [5:5] - include/__utility/forward.h [6:6] - include/__utility/in_place.h [5:5] - include/__utility/integer_sequence.h [5:5] - include/__utility/move.h [6:6] - include/__utility/pair.h [5:5] - include/__utility/piecewise_construct.h [5:5] - include/__utility/rel_ops.h [5:5] - include/__utility/swap.h [5:5] - include/__utility/to_underlying.h [6:6] - include/__variant/monostate.h [6:6] - include/algorithm [6:6] - include/any [6:6] - include/array [6:6] - include/atomic [6:6] - include/barrier [6:6] - include/bit [6:6] - include/bitset [6:6] - include/cassert [6:6] - include/ccomplex [6:6] - include/cctype [6:6] - include/cerrno [6:6] - include/cfenv [6:6] - include/cfloat [6:6] - include/charconv [6:6] - include/chrono [6:6] - include/cinttypes [6:6] - include/ciso646 [6:6] - include/climits [6:6] - include/clocale [6:6] - include/cmath [6:6] - include/codecvt [6:6] - include/compare [6:6] - include/complex [6:6] - include/complex.h [6:6] - include/concepts [6:6] - include/condition_variable [6:6] - include/csetjmp [6:6] - include/csignal [6:6] - include/cstdarg [6:6] - include/cstdbool [6:6] - include/cstddef [6:6] - include/cstdint [6:6] - include/cstdio [6:6] - include/cstdlib [6:6] - include/cstring [6:6] - include/ctgmath [6:6] - include/ctime [6:6] - include/ctype.h [6:6] - include/cwchar [6:6] - include/cwctype [6:6] - include/deque [6:6] - include/errno.h [6:6] - include/exception [6:6] - include/execution [6:6] - include/experimental/__memory [6:6] - include/experimental/algorithm [6:6] - include/experimental/coroutine [6:6] - include/experimental/deque [6:6] - include/experimental/filesystem [6:6] - include/experimental/forward_list [6:6] - include/experimental/functional [6:6] - include/experimental/iterator [6:6] - include/experimental/list [6:6] - include/experimental/map [6:6] - include/experimental/memory_resource [6:6] - include/experimental/propagate_const [6:6] - include/experimental/regex [6:6] - include/experimental/set [6:6] - include/experimental/simd [6:6] - include/experimental/string [6:6] - include/experimental/type_traits [6:6] - include/experimental/unordered_map [6:6] - include/experimental/unordered_set [6:6] - include/experimental/utility [6:6] - include/experimental/vector [6:6] - include/ext/__hash [6:6] - include/ext/hash_map [6:6] - include/ext/hash_set [6:6] - include/filesystem [6:6] - include/float.h [6:6] - include/format [6:6] - include/forward_list [6:6] - include/fstream [6:6] - include/functional [6:6] - include/future [6:6] - include/initializer_list [6:6] - include/inttypes.h [6:6] - include/iomanip [6:6] - include/ios [6:6] - include/iosfwd [6:6] - include/iostream [6:6] - include/istream [6:6] - include/iterator [6:6] - include/latch [6:6] - include/limits [6:6] - include/limits.h [6:6] - include/list [6:6] - include/locale [6:6] - include/locale.h [6:6] - include/map [6:6] - include/math.h [6:6] - include/memory [6:6] - include/mutex [6:6] - include/new [6:6] - include/numbers [6:6] - include/numeric [6:6] - include/optional [6:6] - include/ostream [6:6] - include/queue [6:6] - include/random [6:6] - include/ranges [6:6] - include/ratio [6:6] - include/regex [6:6] - include/scoped_allocator [6:6] - include/semaphore [6:6] - include/set [6:6] - include/setjmp.h [6:6] - include/shared_mutex [6:6] - include/span [6:6] - include/sstream [6:6] - include/stack [6:6] - include/stdbool.h [6:6] - include/stddef.h [6:6] - include/stdexcept [6:6] - include/stdint.h [6:6] - include/stdio.h [6:6] - include/stdlib.h [6:6] - include/streambuf [6:6] - include/string [6:6] - include/string.h [6:6] - include/string_view [6:6] - include/strstream [6:6] - include/system_error [6:6] - include/tgmath.h [6:6] - include/thread [6:6] - include/tuple [6:6] - include/type_traits [6:6] - include/typeindex [6:6] - include/typeinfo [6:6] - include/unordered_map [6:6] - include/unordered_set [6:6] - include/utility [6:6] - include/valarray [6:6] - include/variant [6:6] - include/vector [6:6] - include/version [6:6] - include/wchar.h [6:6] - include/wctype.h [6:6] - src/algorithm.cpp [5:5] - src/any.cpp [5:5] - src/atomic.cpp [5:5] - src/barrier.cpp [5:5] - src/bind.cpp [5:5] - src/charconv.cpp [5:5] - src/chrono.cpp [5:5] - src/condition_variable.cpp [5:5] - src/condition_variable_destructor.cpp [5:5] - src/debug.cpp [5:5] - src/exception.cpp [5:5] - src/experimental/memory_resource.cpp [5:5] - src/filesystem/directory_iterator.cpp [5:5] - src/filesystem/filesystem_common.h [5:5] - src/filesystem/operations.cpp [5:5] - src/filesystem/posix_compat.h [5:5] - src/format.cpp [5:5] - src/functional.cpp [5:5] - src/future.cpp [5:5] - src/hash.cpp [5:5] - src/include/apple_availability.h [5:5] - src/include/atomic_support.h [5:5] - src/include/config_elast.h [5:5] - src/include/refstring.h [5:5] - src/include/sso_allocator.h [6:6] - src/ios.cpp [5:5] - src/ios.instantiations.cpp [5:5] - src/iostream.cpp [5:5] - src/locale.cpp [5:5] - src/memory.cpp [5:5] - src/mutex.cpp [5:5] - src/mutex_destructor.cpp [5:5] - src/new.cpp [5:5] - src/optional.cpp [5:5] - src/random.cpp [5:5] - src/random_shuffle.cpp [5:5] - src/regex.cpp [5:5] - src/shared_mutex.cpp [5:5] - src/stdexcept.cpp [5:5] - src/string.cpp [5:5] - src/strstream.cpp [5:5] - src/support/ibm/mbsnrtowcs.cpp [5:5] - src/support/ibm/wcsnrtombs.cpp [5:5] - src/support/ibm/xlocale_zos.cpp [5:5] - src/support/runtime/exception_fallback.ipp [6:6] - src/support/runtime/exception_glibcxx.ipp [6:6] - src/support/runtime/exception_libcxxabi.ipp [6:6] - src/support/runtime/exception_libcxxrt.ipp [6:6] - src/support/runtime/exception_msvc.ipp [6:6] - src/support/runtime/exception_pointer_cxxabi.ipp [6:6] - src/support/runtime/exception_pointer_glibcxx.ipp [6:6] - src/support/runtime/exception_pointer_msvc.ipp [6:6] - src/support/runtime/exception_pointer_unimplemented.ipp [6:6] - src/support/runtime/new_handler_fallback.ipp [6:6] - src/support/runtime/stdexcept_default.ipp [5:5] - src/support/runtime/stdexcept_vcruntime.ipp [5:5] - src/support/solaris/xlocale.cpp [5:5] - src/support/win32/locale_win32.cpp [6:6] - src/support/win32/support.cpp [6:6] - src/support/win32/thread_win32.cpp [6:6] - src/system_error.cpp [5:5] - src/thread.cpp [5:5] - src/typeinfo.cpp [5:5] - src/utility.cpp [5:5] - src/valarray.cpp [5:5] - src/variant.cpp [5:5] - src/vector.cpp [5:5] + include/__algorithm/adjacent_find.h [6:6] + include/__algorithm/all_of.h [6:6] + include/__algorithm/any_of.h [6:6] + include/__algorithm/binary_search.h [5:5] + include/__algorithm/clamp.h [5:5] + include/__algorithm/comp.h [5:5] + include/__algorithm/comp_ref_type.h [5:5] + include/__algorithm/copy.h [5:5] + include/__algorithm/copy_backward.h [5:5] + include/__algorithm/copy_if.h [5:5] + include/__algorithm/copy_n.h [5:5] + include/__algorithm/count.h [6:6] + include/__algorithm/count_if.h [6:6] + include/__algorithm/equal.h [6:6] + include/__algorithm/equal_range.h [5:5] + include/__algorithm/fill.h [5:5] + include/__algorithm/fill_n.h [5:5] + include/__algorithm/find.h [6:6] + include/__algorithm/find_end.h [6:6] + include/__algorithm/find_first_of.h [6:6] + include/__algorithm/find_if.h [6:6] + include/__algorithm/find_if_not.h [6:6] + include/__algorithm/for_each.h [6:6] + include/__algorithm/for_each_n.h [6:6] + include/__algorithm/generate.h [5:5] + include/__algorithm/generate_n.h [5:5] + include/__algorithm/half_positive.h [5:5] + include/__algorithm/includes.h [5:5] + include/__algorithm/inplace_merge.h [5:5] + include/__algorithm/is_heap.h [5:5] + include/__algorithm/is_heap_until.h [5:5] + include/__algorithm/is_partitioned.h [5:5] + include/__algorithm/is_permutation.h [6:6] + include/__algorithm/is_sorted.h [5:5] + include/__algorithm/is_sorted_until.h [5:5] + include/__algorithm/iter_swap.h [5:5] + include/__algorithm/lexicographical_compare.h [5:5] + include/__algorithm/lower_bound.h [5:5] + include/__algorithm/make_heap.h [5:5] + include/__algorithm/max.h [5:5] + include/__algorithm/max_element.h [5:5] + include/__algorithm/merge.h [5:5] + include/__algorithm/min.h [5:5] + include/__algorithm/min_element.h [5:5] + include/__algorithm/minmax.h [5:5] + include/__algorithm/minmax_element.h [5:5] + include/__algorithm/mismatch.h [6:6] + include/__algorithm/move.h [5:5] + include/__algorithm/move_backward.h [5:5] + include/__algorithm/next_permutation.h [5:5] + include/__algorithm/none_of.h [6:6] + include/__algorithm/nth_element.h [5:5] + include/__algorithm/partial_sort.h [5:5] + include/__algorithm/partial_sort_copy.h [5:5] + include/__algorithm/partition.h [5:5] + include/__algorithm/partition_copy.h [5:5] + include/__algorithm/partition_point.h [5:5] + include/__algorithm/pop_heap.h [5:5] + include/__algorithm/prev_permutation.h [5:5] + include/__algorithm/push_heap.h [5:5] + include/__algorithm/remove.h [5:5] + include/__algorithm/remove_copy.h [5:5] + include/__algorithm/remove_copy_if.h [5:5] + include/__algorithm/remove_if.h [5:5] + include/__algorithm/replace.h [5:5] + include/__algorithm/replace_copy.h [5:5] + include/__algorithm/replace_copy_if.h [5:5] + include/__algorithm/replace_if.h [5:5] + include/__algorithm/reverse.h [5:5] + include/__algorithm/reverse_copy.h [5:5] + include/__algorithm/rotate.h [5:5] + include/__algorithm/rotate_copy.h [5:5] + include/__algorithm/sample.h [5:5] + include/__algorithm/search.h [6:6] + include/__algorithm/search_n.h [6:6] + include/__algorithm/set_difference.h [5:5] + include/__algorithm/set_intersection.h [5:5] + include/__algorithm/set_symmetric_difference.h [5:5] + include/__algorithm/set_union.h [5:5] + include/__algorithm/shift_left.h [5:5] + include/__algorithm/shift_right.h [5:5] + include/__algorithm/shuffle.h [5:5] + include/__algorithm/sift_down.h [5:5] + include/__algorithm/sort.h [5:5] + include/__algorithm/sort_heap.h [5:5] + include/__algorithm/stable_partition.h [5:5] + include/__algorithm/stable_sort.h [5:5] + include/__algorithm/swap_ranges.h [5:5] + include/__algorithm/transform.h [5:5] + include/__algorithm/unique.h [5:5] + include/__algorithm/unique_copy.h [5:5] + include/__algorithm/unwrap_iter.h [5:5] + include/__algorithm/upper_bound.h [5:5] + include/__availability [6:6] + include/__bit/bit_cast.h [6:6] + include/__bit_reference [6:6] + include/__bits [6:6] + include/__bsd_locale_defaults.h [6:6] + include/__bsd_locale_fallbacks.h [6:6] + include/__charconv/chars_format.h [6:6] + include/__charconv/from_chars_result.h [6:6] + include/__charconv/to_chars_result.h [6:6] + include/__compare/common_comparison_category.h [5:5] + include/__compare/compare_three_way_result.h [5:5] + include/__compare/ordering.h [5:5] + include/__compare/synth_three_way.h [5:5] + include/__compare/three_way_comparable.h [5:5] + include/__concepts/arithmetic.h [5:5] + include/__concepts/assignable.h [5:5] + include/__concepts/boolean_testable.h [5:5] + include/__concepts/class_or_enum.h [5:5] + include/__concepts/common_reference_with.h [5:5] + include/__concepts/common_with.h [5:5] + include/__concepts/constructible.h [5:5] + include/__concepts/convertible_to.h [5:5] + include/__concepts/copyable.h [5:5] + include/__concepts/derived_from.h [5:5] + include/__concepts/destructible.h [5:5] + include/__concepts/different_from.h [5:5] + include/__concepts/equality_comparable.h [5:5] + include/__concepts/invocable.h [5:5] + include/__concepts/movable.h [5:5] + include/__concepts/predicate.h [5:5] + include/__concepts/regular.h [5:5] + include/__concepts/relation.h [5:5] + include/__concepts/same_as.h [5:5] + include/__concepts/semiregular.h [5:5] + include/__concepts/swappable.h [5:5] + include/__concepts/totally_ordered.h [5:5] + include/__config [6:6] + include/__config_site.in [5:5] + include/__debug [6:6] + include/__errc [6:6] + include/__format/format_arg.h [6:6] + include/__format/format_args.h [6:6] + include/__format/format_context.h [6:6] + include/__format/format_error.h [6:6] + include/__format/format_fwd.h [6:6] + include/__format/format_parse_context.h [6:6] + include/__format/format_string.h [6:6] + include/__format/formatter.h [6:6] + include/__format/parser_std_format_spec.h [6:6] + include/__function_like.h [6:6] + include/__functional/binary_function.h [6:6] + include/__functional/binary_negate.h [6:6] + include/__functional/bind.h [6:6] + include/__functional/bind_back.h [6:6] + include/__functional/bind_front.h [6:6] + include/__functional/binder1st.h [6:6] + include/__functional/binder2nd.h [6:6] + include/__functional/compose.h [6:6] + include/__functional/default_searcher.h [6:6] + include/__functional/function.h [6:6] + include/__functional/hash.h [5:5] + include/__functional/identity.h [6:6] + include/__functional/invoke.h [6:6] + include/__functional/is_transparent.h [6:6] + include/__functional/mem_fn.h [6:6] + include/__functional/mem_fun_ref.h [6:6] + include/__functional/not_fn.h [6:6] + include/__functional/operations.h [6:6] + include/__functional/perfect_forward.h [6:6] + include/__functional/pointer_to_binary_function.h [6:6] + include/__functional/pointer_to_unary_function.h [6:6] + include/__functional/ranges_operations.h [6:6] + include/__functional/reference_wrapper.h [6:6] + include/__functional/unary_function.h [5:5] + include/__functional/unary_negate.h [6:6] + include/__functional/unwrap_ref.h [5:5] + include/__functional/weak_result_type.h [6:6] + include/__functional_base [6:6] + include/__hash_table [6:6] + include/__iterator/access.h [6:6] + include/__iterator/advance.h [6:6] + include/__iterator/back_insert_iterator.h [6:6] + include/__iterator/common_iterator.h [6:6] + include/__iterator/concepts.h [6:6] + include/__iterator/counted_iterator.h [6:6] + include/__iterator/data.h [6:6] + include/__iterator/default_sentinel.h [6:6] + include/__iterator/distance.h [6:6] + include/__iterator/empty.h [6:6] + include/__iterator/erase_if_container.h [6:6] + include/__iterator/front_insert_iterator.h [6:6] + include/__iterator/incrementable_traits.h [6:6] + include/__iterator/insert_iterator.h [6:6] + include/__iterator/istream_iterator.h [6:6] + include/__iterator/istreambuf_iterator.h [6:6] + include/__iterator/iter_move.h [6:6] + include/__iterator/iter_swap.h [6:6] + include/__iterator/iterator.h [6:6] + include/__iterator/iterator_traits.h [6:6] + include/__iterator/move_iterator.h [6:6] + include/__iterator/next.h [6:6] + include/__iterator/ostream_iterator.h [6:6] + include/__iterator/ostreambuf_iterator.h [6:6] + include/__iterator/prev.h [6:6] + include/__iterator/projected.h [6:6] + include/__iterator/readable_traits.h [6:6] + include/__iterator/reverse_access.h [6:6] + include/__iterator/reverse_iterator.h [6:6] + include/__iterator/size.h [6:6] + include/__iterator/unreachable_sentinel.h [6:6] + include/__iterator/wrap_iter.h [6:6] + include/__locale [6:6] + include/__memory/addressof.h [6:6] + include/__memory/allocation_guard.h [6:6] + include/__memory/allocator.h [6:6] + include/__memory/allocator_arg_t.h [6:6] + include/__memory/allocator_traits.h [6:6] + include/__memory/auto_ptr.h [6:6] + include/__memory/compressed_pair.h [6:6] + include/__memory/construct_at.h [6:6] + include/__memory/pointer_safety.h [6:6] + include/__memory/pointer_traits.h [6:6] + include/__memory/raw_storage_iterator.h [6:6] + include/__memory/shared_ptr.h [6:6] + include/__memory/temporary_buffer.h [6:6] + include/__memory/uninitialized_algorithms.h [6:6] + include/__memory/unique_ptr.h [6:6] + include/__memory/uses_allocator.h [6:6] + include/__mutex_base [6:6] + include/__node_handle [6:6] + include/__nullptr [6:6] + include/__random/uniform_int_distribution.h [5:5] + include/__ranges/access.h [6:6] + include/__ranges/all.h [6:6] + include/__ranges/common_view.h [6:6] + include/__ranges/concepts.h [6:6] + include/__ranges/copyable_box.h [6:6] + include/__ranges/counted.h [6:6] + include/__ranges/dangling.h [6:6] + include/__ranges/data.h [6:6] + include/__ranges/drop_view.h [6:6] + include/__ranges/empty.h [6:6] + include/__ranges/empty_view.h [6:6] + include/__ranges/enable_borrowed_range.h [6:6] + include/__ranges/enable_view.h [6:6] + include/__ranges/iota_view.h [6:6] + include/__ranges/join_view.h [6:6] + include/__ranges/non_propagating_cache.h [6:6] + include/__ranges/range_adaptor.h [6:6] + include/__ranges/ref_view.h [6:6] + include/__ranges/reverse_view.h [6:6] + include/__ranges/single_view.h [6:6] + include/__ranges/size.h [6:6] + include/__ranges/subrange.h [6:6] + include/__ranges/take_view.h [6:6] + include/__ranges/transform_view.h [6:6] + include/__ranges/view_interface.h [6:6] + include/__std_stream [6:6] + include/__string [6:6] + include/__support/android/locale_bionic.h [6:6] + include/__support/fuchsia/xlocale.h [6:6] + include/__support/ibm/gettod_zos.h [6:6] + include/__support/ibm/limits.h [6:6] + include/__support/ibm/locale_mgmt_zos.h [6:6] + include/__support/ibm/nanosleep.h [6:6] + include/__support/ibm/support.h [6:6] + include/__support/ibm/xlocale.h [6:6] + include/__support/musl/xlocale.h [6:6] + include/__support/newlib/xlocale.h [5:5] + include/__support/openbsd/xlocale.h [6:6] + include/__support/solaris/floatingpoint.h [5:5] + include/__support/solaris/wchar.h [5:5] + include/__support/solaris/xlocale.h [5:5] + include/__support/win32/limits_msvc_win32.h [6:6] + include/__support/win32/locale_win32.h [6:6] + include/__support/xlocale/__nop_locale_mgmt.h [6:6] + include/__support/xlocale/__posix_l_fallback.h [6:6] + include/__support/xlocale/__strtonum_fallback.h [6:6] + include/__threading_support [6:6] + include/__tree [6:6] + include/__tuple [6:6] + include/__undef_macros [6:6] + include/__utility/as_const.h [5:5] + include/__utility/cmp.h [5:5] + include/__utility/decay_copy.h [6:6] + include/__utility/declval.h [5:5] + include/__utility/exchange.h [5:5] + include/__utility/forward.h [6:6] + include/__utility/in_place.h [5:5] + include/__utility/integer_sequence.h [5:5] + include/__utility/move.h [6:6] + include/__utility/pair.h [5:5] + include/__utility/piecewise_construct.h [5:5] + include/__utility/rel_ops.h [5:5] + include/__utility/swap.h [5:5] + include/__utility/to_underlying.h [6:6] + include/__variant/monostate.h [6:6] + include/algorithm [6:6] + include/any [6:6] + include/array [6:6] + include/atomic [6:6] + include/barrier [6:6] + include/bit [6:6] + include/bitset [6:6] + include/cassert [6:6] + include/ccomplex [6:6] + include/cctype [6:6] + include/cerrno [6:6] + include/cfenv [6:6] + include/cfloat [6:6] + include/charconv [6:6] + include/chrono [6:6] + include/cinttypes [6:6] + include/ciso646 [6:6] + include/climits [6:6] + include/clocale [6:6] + include/cmath [6:6] + include/codecvt [6:6] + include/compare [6:6] + include/complex [6:6] + include/complex.h [6:6] + include/concepts [6:6] + include/condition_variable [6:6] + include/csetjmp [6:6] + include/csignal [6:6] + include/cstdarg [6:6] + include/cstdbool [6:6] + include/cstddef [6:6] + include/cstdint [6:6] + include/cstdio [6:6] + include/cstdlib [6:6] + include/cstring [6:6] + include/ctgmath [6:6] + include/ctime [6:6] + include/ctype.h [6:6] + include/cwchar [6:6] + include/cwctype [6:6] + include/deque [6:6] + include/errno.h [6:6] + include/exception [6:6] + include/execution [6:6] + include/experimental/__memory [6:6] + include/experimental/algorithm [6:6] + include/experimental/coroutine [6:6] + include/experimental/deque [6:6] + include/experimental/filesystem [6:6] + include/experimental/forward_list [6:6] + include/experimental/functional [6:6] + include/experimental/iterator [6:6] + include/experimental/list [6:6] + include/experimental/map [6:6] + include/experimental/memory_resource [6:6] + include/experimental/propagate_const [6:6] + include/experimental/regex [6:6] + include/experimental/set [6:6] + include/experimental/simd [6:6] + include/experimental/string [6:6] + include/experimental/type_traits [6:6] + include/experimental/unordered_map [6:6] + include/experimental/unordered_set [6:6] + include/experimental/utility [6:6] + include/experimental/vector [6:6] + include/ext/__hash [6:6] + include/ext/hash_map [6:6] + include/ext/hash_set [6:6] + include/filesystem [6:6] + include/float.h [6:6] + include/format [6:6] + include/forward_list [6:6] + include/fstream [6:6] + include/functional [6:6] + include/future [6:6] + include/initializer_list [6:6] + include/inttypes.h [6:6] + include/iomanip [6:6] + include/ios [6:6] + include/iosfwd [6:6] + include/iostream [6:6] + include/istream [6:6] + include/iterator [6:6] + include/latch [6:6] + include/limits [6:6] + include/limits.h [6:6] + include/list [6:6] + include/locale [6:6] + include/locale.h [6:6] + include/map [6:6] + include/math.h [6:6] + include/memory [6:6] + include/mutex [6:6] + include/new [6:6] + include/numbers [6:6] + include/numeric [6:6] + include/optional [6:6] + include/ostream [6:6] + include/queue [6:6] + include/random [6:6] + include/ranges [6:6] + include/ratio [6:6] + include/regex [6:6] + include/scoped_allocator [6:6] + include/semaphore [6:6] + include/set [6:6] + include/setjmp.h [6:6] + include/shared_mutex [6:6] + include/span [6:6] + include/sstream [6:6] + include/stack [6:6] + include/stdbool.h [6:6] + include/stddef.h [6:6] + include/stdexcept [6:6] + include/stdint.h [6:6] + include/stdio.h [6:6] + include/stdlib.h [6:6] + include/streambuf [6:6] + include/string [6:6] + include/string.h [6:6] + include/string_view [6:6] + include/strstream [6:6] + include/system_error [6:6] + include/tgmath.h [6:6] + include/thread [6:6] + include/tuple [6:6] + include/type_traits [6:6] + include/typeindex [6:6] + include/typeinfo [6:6] + include/unordered_map [6:6] + include/unordered_set [6:6] + include/utility [6:6] + include/valarray [6:6] + include/variant [6:6] + include/vector [6:6] + include/version [6:6] + include/wchar.h [6:6] + include/wctype.h [6:6] + src/algorithm.cpp [5:5] + src/any.cpp [5:5] + src/atomic.cpp [5:5] + src/barrier.cpp [5:5] + src/bind.cpp [5:5] + src/charconv.cpp [5:5] + src/chrono.cpp [5:5] + src/condition_variable.cpp [5:5] + src/condition_variable_destructor.cpp [5:5] + src/debug.cpp [5:5] + src/exception.cpp [5:5] + src/experimental/memory_resource.cpp [5:5] + src/filesystem/directory_iterator.cpp [5:5] + src/filesystem/filesystem_common.h [5:5] + src/filesystem/operations.cpp [5:5] + src/filesystem/posix_compat.h [5:5] + src/format.cpp [5:5] + src/functional.cpp [5:5] + src/future.cpp [5:5] + src/hash.cpp [5:5] + src/include/apple_availability.h [5:5] + src/include/atomic_support.h [5:5] + src/include/config_elast.h [5:5] + src/include/refstring.h [5:5] + src/include/sso_allocator.h [6:6] + src/ios.cpp [5:5] + src/ios.instantiations.cpp [5:5] + src/iostream.cpp [5:5] + src/locale.cpp [5:5] + src/memory.cpp [5:5] + src/mutex.cpp [5:5] + src/mutex_destructor.cpp [5:5] + src/new.cpp [5:5] + src/optional.cpp [5:5] + src/random.cpp [5:5] + src/random_shuffle.cpp [5:5] + src/regex.cpp [5:5] + src/shared_mutex.cpp [5:5] + src/stdexcept.cpp [5:5] + src/string.cpp [5:5] + src/strstream.cpp [5:5] + src/support/ibm/mbsnrtowcs.cpp [5:5] + src/support/ibm/wcsnrtombs.cpp [5:5] + src/support/ibm/xlocale_zos.cpp [5:5] + src/support/runtime/exception_fallback.ipp [6:6] + src/support/runtime/exception_glibcxx.ipp [6:6] + src/support/runtime/exception_libcxxabi.ipp [6:6] + src/support/runtime/exception_libcxxrt.ipp [6:6] + src/support/runtime/exception_msvc.ipp [6:6] + src/support/runtime/exception_pointer_cxxabi.ipp [6:6] + src/support/runtime/exception_pointer_glibcxx.ipp [6:6] + src/support/runtime/exception_pointer_msvc.ipp [6:6] + src/support/runtime/exception_pointer_unimplemented.ipp [6:6] + src/support/runtime/new_handler_fallback.ipp [6:6] + src/support/runtime/stdexcept_default.ipp [5:5] + src/support/runtime/stdexcept_vcruntime.ipp [5:5] + src/support/solaris/xlocale.cpp [5:5] + src/support/win32/locale_win32.cpp [6:6] + src/support/win32/support.cpp [6:6] + src/support/win32/thread_win32.cpp [6:6] + src/system_error.cpp [5:5] + src/thread.cpp [5:5] + src/typeinfo.cpp [5:5] + src/utility.cpp [5:5] + src/valarray.cpp [5:5] + src/variant.cpp [5:5] + src/vector.cpp [5:5] KEEP Apache-2.0 WITH LLVM-exception c1e6c6536fcc444f916047679115c618 -BELONGS ya.make +BELONGS ya.make License text: * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception Scancode info: @@ -2218,17 +2218,17 @@ BELONGS ya.make Match type : TAG Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - src/filesystem/int128_builtins.cpp [5:5] + src/filesystem/int128_builtins.cpp [5:5] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : TAG Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - src/filesystem/int128_builtins.cpp [5:5] + src/filesystem/int128_builtins.cpp [5:5] KEEP NCSA c26d0b72f92421989c4471ae0acbc943 -BELONGS ya.make +BELONGS ya.make License text: University of Illinois/NCSA Open Source License @@ -2238,10 +2238,10 @@ BELONGS ya.make Match type : REFERENCE Links : http://www.otm.illinois.edu/faculty/forms/opensource.asp, https://spdx.org/licenses/NCSA Files with this license: - LICENSE.TXT [249:250] + LICENSE.TXT [249:250] SKIP LicenseRef-scancode-unknown-license-reference d4fd839c20b32e384ccf02a801e876d1 -BELONGS ya.make +BELONGS ya.make # part of bsd-2-clause text License text: distributed under. @@ -2251,10 +2251,10 @@ BELONGS ya.make Match type : INTRO Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.LICENSE Files with this license: - src/support/solaris/README [4:4] + src/support/solaris/README [4:4] KEEP Apache-2.0 WITH LLVM-exception df18889e552d44a4679aff552267f802 -BELONGS ya.make +BELONGS ya.make License text: The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: Scancode info: @@ -2263,19 +2263,19 @@ BELONGS ya.make Match type : NOTICE Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 Files with this license: - LICENSE.TXT [2:2] + LICENSE.TXT [2:2] Scancode info: Original SPDX id: LLVM-exception Score : 100.00 Match type : NOTICE Links : http://llvm.org/foundation/relicensing/LICENSE.txt, https://spdx.org/licenses/LLVM-exception Files with this license: - LICENSE.TXT [2:2] + LICENSE.TXT [2:2] KEEP BSD-2-Clause f59cebb43ee786218189ac014af76fbb -BELONGS ya.make -FILE_INCLUDE include/experimental/list found in files: src/support/solaris/mbsnrtowcs.inc at line 13, src/support/solaris/mbsnrtowcs.inc at line 15, src/support/solaris/wcsnrtombs.inc at line 10, src/support/solaris/wcsnrtombs.inc at line 8 -FILE_INCLUDE include/list found in files: src/support/solaris/mbsnrtowcs.inc at line 13, src/support/solaris/mbsnrtowcs.inc at line 15, src/support/solaris/wcsnrtombs.inc at line 10, src/support/solaris/wcsnrtombs.inc at line 8 +BELONGS ya.make +FILE_INCLUDE include/experimental/list found in files: src/support/solaris/mbsnrtowcs.inc at line 13, src/support/solaris/mbsnrtowcs.inc at line 15, src/support/solaris/wcsnrtombs.inc at line 10, src/support/solaris/wcsnrtombs.inc at line 8 +FILE_INCLUDE include/list found in files: src/support/solaris/mbsnrtowcs.inc at line 13, src/support/solaris/mbsnrtowcs.inc at line 15, src/support/solaris/wcsnrtombs.inc at line 10, src/support/solaris/wcsnrtombs.inc at line 8 # list - just word, not file reference Note: matched license text is too long. Read it in the source files. Scancode info: @@ -2284,5 +2284,5 @@ FILE_INCLUDE include/list found in files: src/support/solaris/mbsnrtowcs.inc at Match type : TEXT Links : http://opensource.org/licenses/bsd-license.php, http://www.opensource.org/licenses/BSD-2-Clause, https://spdx.org/licenses/BSD-2-Clause Files with this license: - src/support/solaris/mbsnrtowcs.inc [9:28] - src/support/solaris/wcsnrtombs.inc [4:23] + src/support/solaris/mbsnrtowcs.inc [9:28] + src/support/solaris/wcsnrtombs.inc [4:23] diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt b/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt index b13eb77e46..848b9cbbe4 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/licenses.list.txt @@ -283,7 +283,7 @@ Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT -====================File: CREDITS.TXT==================== +====================File: CREDITS.TXT==================== This file is a partial list of people who have contributed to the LLVM/libc++ project. If you have contributed a patch or made some other contribution to LLVM/libc++, please submit a patch to this file to add yourself, and it will be @@ -323,10 +323,10 @@ N: Jonathan B Coe E: jbcoe@me.com D: Implementation of propagate_const. -N: Matthew Dempsky -E: matthew@dempsky.org -D: Minor patches and bug fixes. - +N: Matthew Dempsky +E: matthew@dempsky.org +D: Minor patches and bug fixes. + N: Christopher Di Bella E: cjdb@google.com E: cjdb.ns@gmail.com @@ -395,10 +395,10 @@ N: Jon Roelofs E: jroelofS@jroelofs.com D: Remote testing, Newlib port, baremetal/single-threaded support. -N: Kent Ross -E: k@mad.cash -D: Patches for operator<=> support - +N: Kent Ross +E: k@mad.cash +D: Patches for operator<=> support + N: Jonathan Sauer D: Minor patches, mostly related to constexpr @@ -417,10 +417,10 @@ N: Stephan Tolksdorf E: st@quanttec.com D: Minor <atomic> fix -N: Ruben Van Boxem -E: vanboxem dot ruben at gmail dot com -D: Initial Windows patches. - +N: Ruben Van Boxem +E: vanboxem dot ruben at gmail dot com +D: Initial Windows patches. + N: Michael van der Westhuizen E: r1mikey at gmail dot com @@ -444,15 +444,15 @@ E: jyasskin@gmail.com E: jyasskin@google.com D: Linux fixes. -N: Zhihao Yuan -E: lichray@gmail.com -D: Standard compatibility fixes. - +N: Zhihao Yuan +E: lichray@gmail.com +D: Standard compatibility fixes. -====================File: import==================== + +====================File: import==================== #!/bin/sh -e -rev=1e628d0c +rev=1e628d0c output_dir="libcxx-r$rev" if [ -z $1 ] ; then git clone https://github.com/llvm/llvm-project.git --no-checkout "$output_dir/tmp" @@ -474,697 +474,697 @@ rm src/CMakeLists.txt include/CMakeLists.txt find -type f | xargs sed -e 's/\t/ /g' -e 's/ *$//' -i -====================File: include/any==================== -// -*- C++ -*- -//===------------------------------ any -----------------------------------===// -// -// 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_ANY -#define _LIBCPP_ANY - -/* - any synopsis - -namespace std { - - class bad_any_cast : public bad_cast - { - public: - virtual const char* what() const noexcept; - }; - - class any - { - public: - - // 6.3.1 any construct/destruct - any() noexcept; - - any(const any& other); - any(any&& other) noexcept; - - template <class ValueType> - any(ValueType&& value); - - ~any(); - - // 6.3.2 any assignments - any& operator=(const any& rhs); - any& operator=(any&& rhs) noexcept; - - template <class ValueType> - any& operator=(ValueType&& rhs); - - // 6.3.3 any modifiers - template <class ValueType, class... Args> - decay_t<ValueType>& emplace(Args&&... args); - template <class ValueType, class U, class... Args> - decay_t<ValueType>& emplace(initializer_list<U>, Args&&...); - void reset() noexcept; - void swap(any& rhs) noexcept; - - // 6.3.4 any observers - bool has_value() const noexcept; - const type_info& type() const noexcept; - }; - - // 6.4 Non-member functions - void swap(any& x, any& y) noexcept; - - template <class T, class ...Args> - any make_any(Args&& ...args); - template <class T, class U, class ...Args> - any make_any(initializer_list<U>, Args&& ...args); - - template<class ValueType> - ValueType any_cast(const any& operand); - template<class ValueType> - ValueType any_cast(any& operand); - template<class ValueType> - ValueType any_cast(any&& operand); - - template<class ValueType> - const ValueType* any_cast(const any* operand) noexcept; - template<class ValueType> - ValueType* any_cast(any* operand) noexcept; - -} // namespace std - -*/ - -#include <__availability> -#include <__config> -#include <__utility/forward.h> -#include <cstdlib> -#include <memory> -#include <type_traits> -#include <typeinfo> -#include <version> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -namespace std { -class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast -{ -public: - virtual const char* what() const _NOEXCEPT; -}; -} // namespace std - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if _LIBCPP_STD_VER > 14 - -_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -void __throw_bad_any_cast() -{ -#ifndef _LIBCPP_NO_EXCEPTIONS - throw bad_any_cast(); -#else - _VSTD::abort(); -#endif -} - -// Forward declarations -class _LIBCPP_TEMPLATE_VIS any; - -template <class _ValueType> -_LIBCPP_INLINE_VISIBILITY -add_pointer_t<add_const_t<_ValueType>> -any_cast(any const *) _NOEXCEPT; - -template <class _ValueType> -_LIBCPP_INLINE_VISIBILITY -add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT; - -namespace __any_imp -{ - using _Buffer = aligned_storage_t<3*sizeof(void*), alignment_of<void*>::value>; - - template <class _Tp> - using _IsSmallObject = integral_constant<bool - , sizeof(_Tp) <= sizeof(_Buffer) - && alignment_of<_Buffer>::value - % alignment_of<_Tp>::value == 0 - && is_nothrow_move_constructible<_Tp>::value - >; - - enum class _Action { - _Destroy, - _Copy, - _Move, - _Get, - _TypeInfo - }; - - template <class _Tp> struct _SmallHandler; - template <class _Tp> struct _LargeHandler; - - template <class _Tp> - struct _LIBCPP_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; }; - template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id; - - template <class _Tp> - inline _LIBCPP_INLINE_VISIBILITY - constexpr const void* __get_fallback_typeid() { - return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id; - } - - template <class _Tp> - inline _LIBCPP_INLINE_VISIBILITY - bool __compare_typeid(type_info const* __id, const void* __fallback_id) - { -#if !defined(_LIBCPP_NO_RTTI) - if (__id && *__id == typeid(_Tp)) - return true; -#endif - if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>()) - return true; - return false; - } - - template <class _Tp> - using _Handler = conditional_t< - _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>; - -} // namespace __any_imp - -class _LIBCPP_TEMPLATE_VIS any -{ -public: - // construct/destruct - _LIBCPP_INLINE_VISIBILITY - constexpr any() _NOEXCEPT : __h(nullptr) {} - - _LIBCPP_INLINE_VISIBILITY - any(any const & __other) : __h(nullptr) - { - if (__other.__h) __other.__call(_Action::_Copy, this); - } - - _LIBCPP_INLINE_VISIBILITY - any(any && __other) _NOEXCEPT : __h(nullptr) - { - if (__other.__h) __other.__call(_Action::_Move, this); - } - - 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> - > - _LIBCPP_INLINE_VISIBILITY - any(_ValueType && __value); - - template <class _ValueType, class ..._Args, - class _Tp = decay_t<_ValueType>, - class = enable_if_t< - is_constructible<_Tp, _Args...>::value && - is_copy_constructible<_Tp>::value - > - > - _LIBCPP_INLINE_VISIBILITY - explicit any(in_place_type_t<_ValueType>, _Args&&... __args); - - template <class _ValueType, class _Up, class ..._Args, - class _Tp = decay_t<_ValueType>, - class = enable_if_t< - is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> - > - _LIBCPP_INLINE_VISIBILITY - explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args); - - _LIBCPP_INLINE_VISIBILITY - ~any() { this->reset(); } - - // assignments - _LIBCPP_INLINE_VISIBILITY - any & operator=(any const & __rhs) { - any(__rhs).swap(*this); - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - any & operator=(any && __rhs) _NOEXCEPT { - any(_VSTD::move(__rhs)).swap(*this); - return *this; - } - - template < - class _ValueType - , class _Tp = decay_t<_ValueType> - , class = enable_if_t< - !is_same<_Tp, any>::value - && is_copy_constructible<_Tp>::value> - > - _LIBCPP_INLINE_VISIBILITY - any & operator=(_ValueType && __rhs); - - template <class _ValueType, class ..._Args, - class _Tp = decay_t<_ValueType>, - class = enable_if_t< - is_constructible<_Tp, _Args...>::value && - is_copy_constructible<_Tp>::value> - > - _LIBCPP_INLINE_VISIBILITY - _Tp& emplace(_Args&&... args); - - template <class _ValueType, class _Up, class ..._Args, - class _Tp = decay_t<_ValueType>, - class = enable_if_t< - is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && - is_copy_constructible<_Tp>::value> - > - _LIBCPP_INLINE_VISIBILITY - _Tp& emplace(initializer_list<_Up>, _Args&&...); - - // 6.3.3 any modifiers - _LIBCPP_INLINE_VISIBILITY - void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); } - - _LIBCPP_INLINE_VISIBILITY - void swap(any & __rhs) _NOEXCEPT; - - // 6.3.4 any observers - _LIBCPP_INLINE_VISIBILITY - bool has_value() const _NOEXCEPT { return __h != nullptr; } - -#if !defined(_LIBCPP_NO_RTTI) - _LIBCPP_INLINE_VISIBILITY - const type_info & type() const _NOEXCEPT { - if (__h) { - return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo)); - } else { - return typeid(void); - } - } -#endif - -private: - typedef __any_imp::_Action _Action; - using _HandleFuncPtr = void* (*)(_Action, any const *, any *, const type_info *, - const void* __fallback_info); - - union _Storage { - constexpr _Storage() : __ptr(nullptr) {} - void * __ptr; - __any_imp::_Buffer __buf; - }; - - _LIBCPP_INLINE_VISIBILITY - void * __call(_Action __a, any * __other = nullptr, - type_info const * __info = nullptr, - const void* __fallback_info = nullptr) const - { - return __h(__a, this, __other, __info, __fallback_info); - } - - _LIBCPP_INLINE_VISIBILITY - void * __call(_Action __a, any * __other = nullptr, - type_info const * __info = nullptr, - const void* __fallback_info = nullptr) - { - return __h(__a, this, __other, __info, __fallback_info); - } - - template <class> - friend struct __any_imp::_SmallHandler; - template <class> - friend struct __any_imp::_LargeHandler; - - template <class _ValueType> - friend add_pointer_t<add_const_t<_ValueType>> - any_cast(any const *) _NOEXCEPT; - - template <class _ValueType> - friend add_pointer_t<_ValueType> - any_cast(any *) _NOEXCEPT; - - _HandleFuncPtr __h = nullptr; - _Storage __s; -}; - -namespace __any_imp -{ - template <class _Tp> - struct _LIBCPP_TEMPLATE_VIS _SmallHandler - { - _LIBCPP_INLINE_VISIBILITY - static void* __handle(_Action __act, any const * __this, any * __other, - type_info const * __info, const void* __fallback_info) - { - switch (__act) - { - case _Action::_Destroy: - __destroy(const_cast<any &>(*__this)); - return nullptr; - case _Action::_Copy: - __copy(*__this, *__other); - return nullptr; - case _Action::_Move: - __move(const_cast<any &>(*__this), *__other); - return nullptr; - case _Action::_Get: - return __get(const_cast<any &>(*__this), __info, __fallback_info); - case _Action::_TypeInfo: - return __type_info(); - } - } - - template <class ..._Args> - _LIBCPP_INLINE_VISIBILITY - static _Tp& __create(any & __dest, _Args&&... __args) { - typedef allocator<_Tp> _Alloc; - typedef allocator_traits<_Alloc> _ATraits; - _Alloc __a; - _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf)); - _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); - __dest.__h = &_SmallHandler::__handle; - return *__ret; - } - - private: - _LIBCPP_INLINE_VISIBILITY - static void __destroy(any & __this) { - typedef allocator<_Tp> _Alloc; - typedef allocator_traits<_Alloc> _ATraits; - _Alloc __a; - _Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf)); - _ATraits::destroy(__a, __p); - __this.__h = nullptr; - } - - _LIBCPP_INLINE_VISIBILITY - static void __copy(any const & __this, any & __dest) { - _SmallHandler::__create(__dest, *static_cast<_Tp const *>( - static_cast<void const *>(&__this.__s.__buf))); - } - - _LIBCPP_INLINE_VISIBILITY - static void __move(any & __this, any & __dest) { - _SmallHandler::__create(__dest, _VSTD::move( - *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf)))); - __destroy(__this); - } - - _LIBCPP_INLINE_VISIBILITY - static void* __get(any & __this, - type_info const * __info, - const void* __fallback_id) - { - if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id)) - return static_cast<void*>(&__this.__s.__buf); - return nullptr; - } - - _LIBCPP_INLINE_VISIBILITY - static void* __type_info() - { -#if !defined(_LIBCPP_NO_RTTI) - return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); -#else - return nullptr; -#endif - } - }; - - template <class _Tp> - struct _LIBCPP_TEMPLATE_VIS _LargeHandler - { - _LIBCPP_INLINE_VISIBILITY - static void* __handle(_Action __act, any const * __this, - any * __other, type_info const * __info, - void const* __fallback_info) - { - switch (__act) - { - case _Action::_Destroy: - __destroy(const_cast<any &>(*__this)); - return nullptr; - case _Action::_Copy: - __copy(*__this, *__other); - return nullptr; - case _Action::_Move: - __move(const_cast<any &>(*__this), *__other); - return nullptr; - case _Action::_Get: - return __get(const_cast<any &>(*__this), __info, __fallback_info); - case _Action::_TypeInfo: - return __type_info(); - } - } - - template <class ..._Args> - _LIBCPP_INLINE_VISIBILITY - static _Tp& __create(any & __dest, _Args&&... __args) { - typedef allocator<_Tp> _Alloc; - typedef allocator_traits<_Alloc> _ATraits; - typedef __allocator_destructor<_Alloc> _Dp; - _Alloc __a; - unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1)); - _Tp * __ret = __hold.get(); - _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); - __dest.__s.__ptr = __hold.release(); - __dest.__h = &_LargeHandler::__handle; - return *__ret; - } - - private: - - _LIBCPP_INLINE_VISIBILITY - static void __destroy(any & __this){ - typedef allocator<_Tp> _Alloc; - typedef allocator_traits<_Alloc> _ATraits; - _Alloc __a; - _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr); - _ATraits::destroy(__a, __p); - _ATraits::deallocate(__a, __p, 1); - __this.__h = nullptr; - } - - _LIBCPP_INLINE_VISIBILITY - static void __copy(any const & __this, any & __dest) { - _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr)); - } - - _LIBCPP_INLINE_VISIBILITY - static void __move(any & __this, any & __dest) { - __dest.__s.__ptr = __this.__s.__ptr; - __dest.__h = &_LargeHandler::__handle; - __this.__h = nullptr; - } - - _LIBCPP_INLINE_VISIBILITY - static void* __get(any & __this, type_info const * __info, - void const* __fallback_info) - { - if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info)) - return static_cast<void*>(__this.__s.__ptr); - return nullptr; - - } - - _LIBCPP_INLINE_VISIBILITY - static void* __type_info() - { -#if !defined(_LIBCPP_NO_RTTI) - return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); -#else - return nullptr; -#endif - } - }; - -} // namespace __any_imp - - -template <class _ValueType, class _Tp, class> -any::any(_ValueType && __v) : __h(nullptr) -{ - __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v)); -} - -template <class _ValueType, class ..._Args, class _Tp, class> -any::any(in_place_type_t<_ValueType>, _Args&&... __args) { - __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...); -} - -template <class _ValueType, class _Up, class ..._Args, class _Tp, class> -any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) { - __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...); -} - -template <class _ValueType, class, class> -inline _LIBCPP_INLINE_VISIBILITY -any & any::operator=(_ValueType && __v) -{ - any(_VSTD::forward<_ValueType>(__v)).swap(*this); - return *this; -} - -template <class _ValueType, class ..._Args, class _Tp, class> -inline _LIBCPP_INLINE_VISIBILITY -_Tp& any::emplace(_Args&&... __args) { - reset(); - return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...); -} - -template <class _ValueType, class _Up, class ..._Args, class _Tp, class> -inline _LIBCPP_INLINE_VISIBILITY -_Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) { - reset(); - return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...); -} - -inline _LIBCPP_INLINE_VISIBILITY -void any::swap(any & __rhs) _NOEXCEPT -{ - if (this == &__rhs) - return; - if (__h && __rhs.__h) { - any __tmp; - __rhs.__call(_Action::_Move, &__tmp); - this->__call(_Action::_Move, &__rhs); - __tmp.__call(_Action::_Move, this); - } - else if (__h) { - this->__call(_Action::_Move, &__rhs); - } - else if (__rhs.__h) { - __rhs.__call(_Action::_Move, this); - } -} - -// 6.4 Non-member functions - -inline _LIBCPP_INLINE_VISIBILITY -void swap(any & __lhs, any & __rhs) _NOEXCEPT -{ - __lhs.swap(__rhs); -} - -template <class _Tp, class ..._Args> -inline _LIBCPP_INLINE_VISIBILITY -any make_any(_Args&&... __args) { - return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...); -} - -template <class _Tp, class _Up, class ..._Args> -inline _LIBCPP_INLINE_VISIBILITY -any make_any(initializer_list<_Up> __il, _Args&&... __args) { - return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...); -} - -template <class _ValueType> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any const & __v) -{ - using _RawValueType = __uncvref_t<_ValueType>; - static_assert(is_constructible<_ValueType, _RawValueType const &>::value, - "ValueType is required to be a const lvalue reference " - "or a CopyConstructible type"); - auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return static_cast<_ValueType>(*__tmp); -} - -template <class _ValueType> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any & __v) -{ - using _RawValueType = __uncvref_t<_ValueType>; - static_assert(is_constructible<_ValueType, _RawValueType &>::value, - "ValueType is required to be an lvalue reference " - "or a CopyConstructible type"); - auto __tmp = _VSTD::any_cast<_RawValueType>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return static_cast<_ValueType>(*__tmp); -} - -template <class _ValueType> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any && __v) -{ - using _RawValueType = __uncvref_t<_ValueType>; - static_assert(is_constructible<_ValueType, _RawValueType>::value, - "ValueType is required to be an rvalue reference " - "or a CopyConstructible type"); - auto __tmp = _VSTD::any_cast<_RawValueType>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return static_cast<_ValueType>(_VSTD::move(*__tmp)); -} - -template <class _ValueType> -inline _LIBCPP_INLINE_VISIBILITY -add_pointer_t<add_const_t<_ValueType>> -any_cast(any const * __any) _NOEXCEPT -{ - static_assert(!is_reference<_ValueType>::value, - "_ValueType may not be a reference."); - return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any)); -} - -template <class _RetType> -inline _LIBCPP_INLINE_VISIBILITY -_RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept { - return static_cast<_RetType>(__p); -} - -template <class _RetType> -inline _LIBCPP_INLINE_VISIBILITY -_RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept { - return nullptr; -} - -template <class _ValueType> -add_pointer_t<_ValueType> -any_cast(any * __any) _NOEXCEPT -{ - using __any_imp::_Action; - static_assert(!is_reference<_ValueType>::value, - "_ValueType may not be a reference."); - typedef typename add_pointer<_ValueType>::type _ReturnType; - if (__any && __any->__h) { - void *__p = __any->__call(_Action::_Get, nullptr, -#if !defined(_LIBCPP_NO_RTTI) - &typeid(_ValueType), -#else - nullptr, -#endif - __any_imp::__get_fallback_typeid<_ValueType>()); - return _VSTD::__pointer_or_func_cast<_ReturnType>( - __p, is_function<_ValueType>{}); - } - return nullptr; -} - -#endif // _LIBCPP_STD_VER > 14 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_ANY - - -====================File: include/exception==================== +====================File: include/any==================== // -*- C++ -*- +//===------------------------------ any -----------------------------------===// +// +// 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_ANY +#define _LIBCPP_ANY + +/* + any synopsis + +namespace std { + + class bad_any_cast : public bad_cast + { + public: + virtual const char* what() const noexcept; + }; + + class any + { + public: + + // 6.3.1 any construct/destruct + any() noexcept; + + any(const any& other); + any(any&& other) noexcept; + + template <class ValueType> + any(ValueType&& value); + + ~any(); + + // 6.3.2 any assignments + any& operator=(const any& rhs); + any& operator=(any&& rhs) noexcept; + + template <class ValueType> + any& operator=(ValueType&& rhs); + + // 6.3.3 any modifiers + template <class ValueType, class... Args> + decay_t<ValueType>& emplace(Args&&... args); + template <class ValueType, class U, class... Args> + decay_t<ValueType>& emplace(initializer_list<U>, Args&&...); + void reset() noexcept; + void swap(any& rhs) noexcept; + + // 6.3.4 any observers + bool has_value() const noexcept; + const type_info& type() const noexcept; + }; + + // 6.4 Non-member functions + void swap(any& x, any& y) noexcept; + + template <class T, class ...Args> + any make_any(Args&& ...args); + template <class T, class U, class ...Args> + any make_any(initializer_list<U>, Args&& ...args); + + template<class ValueType> + ValueType any_cast(const any& operand); + template<class ValueType> + ValueType any_cast(any& operand); + template<class ValueType> + ValueType any_cast(any&& operand); + + template<class ValueType> + const ValueType* any_cast(const any* operand) noexcept; + template<class ValueType> + ValueType* any_cast(any* operand) noexcept; + +} // namespace std + +*/ + +#include <__availability> +#include <__config> +#include <__utility/forward.h> +#include <cstdlib> +#include <memory> +#include <type_traits> +#include <typeinfo> +#include <version> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +namespace std { +class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast +{ +public: + virtual const char* what() const _NOEXCEPT; +}; +} // namespace std + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +void __throw_bad_any_cast() +{ +#ifndef _LIBCPP_NO_EXCEPTIONS + throw bad_any_cast(); +#else + _VSTD::abort(); +#endif +} + +// Forward declarations +class _LIBCPP_TEMPLATE_VIS any; + +template <class _ValueType> +_LIBCPP_INLINE_VISIBILITY +add_pointer_t<add_const_t<_ValueType>> +any_cast(any const *) _NOEXCEPT; + +template <class _ValueType> +_LIBCPP_INLINE_VISIBILITY +add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT; + +namespace __any_imp +{ + using _Buffer = aligned_storage_t<3*sizeof(void*), alignment_of<void*>::value>; + + template <class _Tp> + using _IsSmallObject = integral_constant<bool + , sizeof(_Tp) <= sizeof(_Buffer) + && alignment_of<_Buffer>::value + % alignment_of<_Tp>::value == 0 + && is_nothrow_move_constructible<_Tp>::value + >; + + enum class _Action { + _Destroy, + _Copy, + _Move, + _Get, + _TypeInfo + }; + + template <class _Tp> struct _SmallHandler; + template <class _Tp> struct _LargeHandler; + + template <class _Tp> + struct _LIBCPP_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; }; + template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id; + + template <class _Tp> + inline _LIBCPP_INLINE_VISIBILITY + constexpr const void* __get_fallback_typeid() { + return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id; + } + + template <class _Tp> + inline _LIBCPP_INLINE_VISIBILITY + bool __compare_typeid(type_info const* __id, const void* __fallback_id) + { +#if !defined(_LIBCPP_NO_RTTI) + if (__id && *__id == typeid(_Tp)) + return true; +#endif + if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>()) + return true; + return false; + } + + template <class _Tp> + using _Handler = conditional_t< + _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>; + +} // namespace __any_imp + +class _LIBCPP_TEMPLATE_VIS any +{ +public: + // construct/destruct + _LIBCPP_INLINE_VISIBILITY + constexpr any() _NOEXCEPT : __h(nullptr) {} + + _LIBCPP_INLINE_VISIBILITY + any(any const & __other) : __h(nullptr) + { + if (__other.__h) __other.__call(_Action::_Copy, this); + } + + _LIBCPP_INLINE_VISIBILITY + any(any && __other) _NOEXCEPT : __h(nullptr) + { + if (__other.__h) __other.__call(_Action::_Move, this); + } + + 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> + > + _LIBCPP_INLINE_VISIBILITY + any(_ValueType && __value); + + template <class _ValueType, class ..._Args, + class _Tp = decay_t<_ValueType>, + class = enable_if_t< + is_constructible<_Tp, _Args...>::value && + is_copy_constructible<_Tp>::value + > + > + _LIBCPP_INLINE_VISIBILITY + explicit any(in_place_type_t<_ValueType>, _Args&&... __args); + + template <class _ValueType, class _Up, class ..._Args, + class _Tp = decay_t<_ValueType>, + class = enable_if_t< + is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && + is_copy_constructible<_Tp>::value> + > + _LIBCPP_INLINE_VISIBILITY + explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args); + + _LIBCPP_INLINE_VISIBILITY + ~any() { this->reset(); } + + // assignments + _LIBCPP_INLINE_VISIBILITY + any & operator=(any const & __rhs) { + any(__rhs).swap(*this); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + any & operator=(any && __rhs) _NOEXCEPT { + any(_VSTD::move(__rhs)).swap(*this); + return *this; + } + + template < + class _ValueType + , class _Tp = decay_t<_ValueType> + , class = enable_if_t< + !is_same<_Tp, any>::value + && is_copy_constructible<_Tp>::value> + > + _LIBCPP_INLINE_VISIBILITY + any & operator=(_ValueType && __rhs); + + template <class _ValueType, class ..._Args, + class _Tp = decay_t<_ValueType>, + class = enable_if_t< + is_constructible<_Tp, _Args...>::value && + is_copy_constructible<_Tp>::value> + > + _LIBCPP_INLINE_VISIBILITY + _Tp& emplace(_Args&&... args); + + template <class _ValueType, class _Up, class ..._Args, + class _Tp = decay_t<_ValueType>, + class = enable_if_t< + is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value && + is_copy_constructible<_Tp>::value> + > + _LIBCPP_INLINE_VISIBILITY + _Tp& emplace(initializer_list<_Up>, _Args&&...); + + // 6.3.3 any modifiers + _LIBCPP_INLINE_VISIBILITY + void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); } + + _LIBCPP_INLINE_VISIBILITY + void swap(any & __rhs) _NOEXCEPT; + + // 6.3.4 any observers + _LIBCPP_INLINE_VISIBILITY + bool has_value() const _NOEXCEPT { return __h != nullptr; } + +#if !defined(_LIBCPP_NO_RTTI) + _LIBCPP_INLINE_VISIBILITY + const type_info & type() const _NOEXCEPT { + if (__h) { + return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo)); + } else { + return typeid(void); + } + } +#endif + +private: + typedef __any_imp::_Action _Action; + using _HandleFuncPtr = void* (*)(_Action, any const *, any *, const type_info *, + const void* __fallback_info); + + union _Storage { + constexpr _Storage() : __ptr(nullptr) {} + void * __ptr; + __any_imp::_Buffer __buf; + }; + + _LIBCPP_INLINE_VISIBILITY + void * __call(_Action __a, any * __other = nullptr, + type_info const * __info = nullptr, + const void* __fallback_info = nullptr) const + { + return __h(__a, this, __other, __info, __fallback_info); + } + + _LIBCPP_INLINE_VISIBILITY + void * __call(_Action __a, any * __other = nullptr, + type_info const * __info = nullptr, + const void* __fallback_info = nullptr) + { + return __h(__a, this, __other, __info, __fallback_info); + } + + template <class> + friend struct __any_imp::_SmallHandler; + template <class> + friend struct __any_imp::_LargeHandler; + + template <class _ValueType> + friend add_pointer_t<add_const_t<_ValueType>> + any_cast(any const *) _NOEXCEPT; + + template <class _ValueType> + friend add_pointer_t<_ValueType> + any_cast(any *) _NOEXCEPT; + + _HandleFuncPtr __h = nullptr; + _Storage __s; +}; + +namespace __any_imp +{ + template <class _Tp> + struct _LIBCPP_TEMPLATE_VIS _SmallHandler + { + _LIBCPP_INLINE_VISIBILITY + static void* __handle(_Action __act, any const * __this, any * __other, + type_info const * __info, const void* __fallback_info) + { + switch (__act) + { + case _Action::_Destroy: + __destroy(const_cast<any &>(*__this)); + return nullptr; + case _Action::_Copy: + __copy(*__this, *__other); + return nullptr; + case _Action::_Move: + __move(const_cast<any &>(*__this), *__other); + return nullptr; + case _Action::_Get: + return __get(const_cast<any &>(*__this), __info, __fallback_info); + case _Action::_TypeInfo: + return __type_info(); + } + } + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY + static _Tp& __create(any & __dest, _Args&&... __args) { + typedef allocator<_Tp> _Alloc; + typedef allocator_traits<_Alloc> _ATraits; + _Alloc __a; + _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf)); + _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); + __dest.__h = &_SmallHandler::__handle; + return *__ret; + } + + private: + _LIBCPP_INLINE_VISIBILITY + static void __destroy(any & __this) { + typedef allocator<_Tp> _Alloc; + typedef allocator_traits<_Alloc> _ATraits; + _Alloc __a; + _Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf)); + _ATraits::destroy(__a, __p); + __this.__h = nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + static void __copy(any const & __this, any & __dest) { + _SmallHandler::__create(__dest, *static_cast<_Tp const *>( + static_cast<void const *>(&__this.__s.__buf))); + } + + _LIBCPP_INLINE_VISIBILITY + static void __move(any & __this, any & __dest) { + _SmallHandler::__create(__dest, _VSTD::move( + *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf)))); + __destroy(__this); + } + + _LIBCPP_INLINE_VISIBILITY + static void* __get(any & __this, + type_info const * __info, + const void* __fallback_id) + { + if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id)) + return static_cast<void*>(&__this.__s.__buf); + return nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + static void* __type_info() + { +#if !defined(_LIBCPP_NO_RTTI) + return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); +#else + return nullptr; +#endif + } + }; + + template <class _Tp> + struct _LIBCPP_TEMPLATE_VIS _LargeHandler + { + _LIBCPP_INLINE_VISIBILITY + static void* __handle(_Action __act, any const * __this, + any * __other, type_info const * __info, + void const* __fallback_info) + { + switch (__act) + { + case _Action::_Destroy: + __destroy(const_cast<any &>(*__this)); + return nullptr; + case _Action::_Copy: + __copy(*__this, *__other); + return nullptr; + case _Action::_Move: + __move(const_cast<any &>(*__this), *__other); + return nullptr; + case _Action::_Get: + return __get(const_cast<any &>(*__this), __info, __fallback_info); + case _Action::_TypeInfo: + return __type_info(); + } + } + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY + static _Tp& __create(any & __dest, _Args&&... __args) { + typedef allocator<_Tp> _Alloc; + typedef allocator_traits<_Alloc> _ATraits; + typedef __allocator_destructor<_Alloc> _Dp; + _Alloc __a; + unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1)); + _Tp * __ret = __hold.get(); + _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); + __dest.__s.__ptr = __hold.release(); + __dest.__h = &_LargeHandler::__handle; + return *__ret; + } + + private: + + _LIBCPP_INLINE_VISIBILITY + static void __destroy(any & __this){ + typedef allocator<_Tp> _Alloc; + typedef allocator_traits<_Alloc> _ATraits; + _Alloc __a; + _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr); + _ATraits::destroy(__a, __p); + _ATraits::deallocate(__a, __p, 1); + __this.__h = nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + static void __copy(any const & __this, any & __dest) { + _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr)); + } + + _LIBCPP_INLINE_VISIBILITY + static void __move(any & __this, any & __dest) { + __dest.__s.__ptr = __this.__s.__ptr; + __dest.__h = &_LargeHandler::__handle; + __this.__h = nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + static void* __get(any & __this, type_info const * __info, + void const* __fallback_info) + { + if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info)) + return static_cast<void*>(__this.__s.__ptr); + return nullptr; + + } + + _LIBCPP_INLINE_VISIBILITY + static void* __type_info() + { +#if !defined(_LIBCPP_NO_RTTI) + return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); +#else + return nullptr; +#endif + } + }; + +} // namespace __any_imp + + +template <class _ValueType, class _Tp, class> +any::any(_ValueType && __v) : __h(nullptr) +{ + __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v)); +} + +template <class _ValueType, class ..._Args, class _Tp, class> +any::any(in_place_type_t<_ValueType>, _Args&&... __args) { + __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...); +} + +template <class _ValueType, class _Up, class ..._Args, class _Tp, class> +any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) { + __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...); +} + +template <class _ValueType, class, class> +inline _LIBCPP_INLINE_VISIBILITY +any & any::operator=(_ValueType && __v) +{ + any(_VSTD::forward<_ValueType>(__v)).swap(*this); + return *this; +} + +template <class _ValueType, class ..._Args, class _Tp, class> +inline _LIBCPP_INLINE_VISIBILITY +_Tp& any::emplace(_Args&&... __args) { + reset(); + return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...); +} + +template <class _ValueType, class _Up, class ..._Args, class _Tp, class> +inline _LIBCPP_INLINE_VISIBILITY +_Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) { + reset(); + return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...); +} + +inline _LIBCPP_INLINE_VISIBILITY +void any::swap(any & __rhs) _NOEXCEPT +{ + if (this == &__rhs) + return; + if (__h && __rhs.__h) { + any __tmp; + __rhs.__call(_Action::_Move, &__tmp); + this->__call(_Action::_Move, &__rhs); + __tmp.__call(_Action::_Move, this); + } + else if (__h) { + this->__call(_Action::_Move, &__rhs); + } + else if (__rhs.__h) { + __rhs.__call(_Action::_Move, this); + } +} + +// 6.4 Non-member functions + +inline _LIBCPP_INLINE_VISIBILITY +void swap(any & __lhs, any & __rhs) _NOEXCEPT +{ + __lhs.swap(__rhs); +} + +template <class _Tp, class ..._Args> +inline _LIBCPP_INLINE_VISIBILITY +any make_any(_Args&&... __args) { + return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...); +} + +template <class _Tp, class _Up, class ..._Args> +inline _LIBCPP_INLINE_VISIBILITY +any make_any(initializer_list<_Up> __il, _Args&&... __args) { + return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...); +} + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +_ValueType any_cast(any const & __v) +{ + using _RawValueType = __uncvref_t<_ValueType>; + static_assert(is_constructible<_ValueType, _RawValueType const &>::value, + "ValueType is required to be a const lvalue reference " + "or a CopyConstructible type"); + auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v); + if (__tmp == nullptr) + __throw_bad_any_cast(); + return static_cast<_ValueType>(*__tmp); +} + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +_ValueType any_cast(any & __v) +{ + using _RawValueType = __uncvref_t<_ValueType>; + static_assert(is_constructible<_ValueType, _RawValueType &>::value, + "ValueType is required to be an lvalue reference " + "or a CopyConstructible type"); + auto __tmp = _VSTD::any_cast<_RawValueType>(&__v); + if (__tmp == nullptr) + __throw_bad_any_cast(); + return static_cast<_ValueType>(*__tmp); +} + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +_ValueType any_cast(any && __v) +{ + using _RawValueType = __uncvref_t<_ValueType>; + static_assert(is_constructible<_ValueType, _RawValueType>::value, + "ValueType is required to be an rvalue reference " + "or a CopyConstructible type"); + auto __tmp = _VSTD::any_cast<_RawValueType>(&__v); + if (__tmp == nullptr) + __throw_bad_any_cast(); + return static_cast<_ValueType>(_VSTD::move(*__tmp)); +} + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +add_pointer_t<add_const_t<_ValueType>> +any_cast(any const * __any) _NOEXCEPT +{ + static_assert(!is_reference<_ValueType>::value, + "_ValueType may not be a reference."); + return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any)); +} + +template <class _RetType> +inline _LIBCPP_INLINE_VISIBILITY +_RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept { + return static_cast<_RetType>(__p); +} + +template <class _RetType> +inline _LIBCPP_INLINE_VISIBILITY +_RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept { + return nullptr; +} + +template <class _ValueType> +add_pointer_t<_ValueType> +any_cast(any * __any) _NOEXCEPT +{ + using __any_imp::_Action; + static_assert(!is_reference<_ValueType>::value, + "_ValueType may not be a reference."); + typedef typename add_pointer<_ValueType>::type _ReturnType; + if (__any && __any->__h) { + void *__p = __any->__call(_Action::_Get, nullptr, +#if !defined(_LIBCPP_NO_RTTI) + &typeid(_ValueType), +#else + nullptr, +#endif + __any_imp::__get_fallback_typeid<_ValueType>()); + return _VSTD::__pointer_or_func_cast<_ReturnType>( + __p, is_function<_ValueType>{}); + } + return nullptr; +} + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_ANY + + +====================File: include/exception==================== +// -*- C++ -*- //===-------------------------- exception ---------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -1242,9 +1242,9 @@ template <class E> void rethrow_if_nested(const E& e); */ -#include <__availability> +#include <__availability> #include <__config> -#include <__memory/addressof.h> +#include <__memory/addressof.h> #include <cstddef> #include <cstdlib> #include <type_traits> @@ -1315,7 +1315,7 @@ public: exception_ptr& operator=(const exception_ptr&) _NOEXCEPT; ~exception_ptr() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT {return __ptr_ != nullptr;} friend _LIBCPP_INLINE_VISIBILITY @@ -1407,7 +1407,7 @@ struct __throw_with_nested<_Tp, _Up, true> { _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void __do_throw(_Tp&& __t) { - throw __nested<_Up>(static_cast<_Tp&&>(__t)); + throw __nested<_Up>(static_cast<_Tp&&>(__t)); } }; @@ -1418,9 +1418,9 @@ struct __throw_with_nested<_Tp, _Up, false> { __do_throw(_Tp&& __t) #else __do_throw (_Tp& __t) -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG { - throw static_cast<_Tp&&>(__t); + throw static_cast<_Tp&&>(__t); } }; #endif @@ -1437,7 +1437,7 @@ throw_with_nested(_Tp&& __t) is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value && !__libcpp_is_final<_Up>::value>:: - __do_throw(static_cast<_Tp&&>(__t)); + __do_throw(static_cast<_Tp&&>(__t)); #else ((void)__t); // FIXME: Make this abort @@ -1471,3878 +1471,3878 @@ rethrow_if_nested(const _Ep&, } // std -#endif // _LIBCPP_EXCEPTION - - -====================File: include/experimental/list==================== -// -*- C++ -*- -//===--------------------------- list ------------------------------------===// -// -// 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_EXPERIMENTAL_LIST -#define _LIBCPP_EXPERIMENTAL_LIST -/* - experimental/list synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T> - using list = std::list<T,polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <list> -#include <experimental/memory_resource> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _ValueT> -using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_LIST */ - - -====================File: include/format==================== -// -*- C++ -*- -//===--------------------------- format -----------------------------------===// -// -// 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_FORMAT -#define _LIBCPP_FORMAT - -/* - -namespace std { - // [format.context], class template basic_format_context - template<class Out, class charT> - class basic_format_context { - basic_format_args<basic_format_context> args_; // exposition only - Out out_; // exposition only - - public: - using iterator = Out; - using char_type = charT; - template<class T> using formatter_type = formatter<T, charT>; - - basic_format_arg<basic_format_context> arg(size_t id) const; - std::locale locale(); - - iterator out(); - void advance_to(iterator it); - }; - using format_context = basic_format_context<unspecified, char>; - using wformat_context = basic_format_context<unspecified, wchar_t>; - - // [format.args], class template basic_format_args - template<class Context> - class basic_format_args { - size_t size_; // exposition only - const basic_format_arg<Context>* data_; // exposition only - - public: - basic_format_args() noexcept; - - template<class... Args> - basic_format_args(const format-arg-store<Context, Args...>& store) noexcept; - - basic_format_arg<Context> get(size_t i) const noexcept; - }; - using format_args = basic_format_args<format_context>; - using wformat_args = basic_format_args<wformat_context>; - - - template<class Out, class charT> - using format_args_t = basic_format_args<basic_format_context<Out, charT>>; - - // [format.functions], formatting functions - template<class... Args> - string format(string_view fmt, const Args&... args); - template<class... Args> - wstring format(wstring_view fmt, const Args&... args); - template<class... Args> - string format(const locale& loc, string_view fmt, const Args&... args); - template<class... Args> - wstring format(const locale& loc, wstring_view fmt, const Args&... args); - - string vformat(string_view fmt, format_args args); - wstring vformat(wstring_view fmt, wformat_args args); - string vformat(const locale& loc, string_view fmt, format_args args); - wstring vformat(const locale& loc, wstring_view fmt, wformat_args args); - - template<class Out, class... Args> - Out format_to(Out out, string_view fmt, const Args&... args); - template<class Out, class... Args> - Out format_to(Out out, wstring_view fmt, const Args&... args); - template<class Out, class... Args> - Out format_to(Out out, const locale& loc, string_view fmt, const Args&... args); - template<class Out, class... Args> - Out format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args); - - template<class Out> - Out vformat_to(Out out, string_view fmt, - format_args_t<type_identity_t<Out>, char> args); - template<class Out> - Out vformat_to(Out out, wstring_view fmt, - format_args_t<type_identity_t<Out>, wchar_t> args); - template<class Out> - Out vformat_to(Out out, const locale& loc, string_view fmt, - format_args_t<type_identity_t<Out>, char> args); - template<class Out> - Out vformat_to(Out out, const locale& loc, wstring_view fmt, - format_args_t<type_identity_t<Out>, wchar_t> args); - - template<class Out> struct format_to_n_result { - Out out; - iter_difference_t<Out> size; - }; - - template<class Out, class... Args> - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, - string_view fmt, const Args&... args); - template<class Out, class... Args> - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, - wstring_view fmt, const Args&... args); - template<class Out, class... Args> - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, - const locale& loc, string_view fmt, - const Args&... args); - template<class Out, class... Args> - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, - const locale& loc, wstring_view fmt, - const Args&... args); - - template<class... Args> - size_t formatted_size(string_view fmt, const Args&... args); - template<class... Args> - size_t formatted_size(wstring_view fmt, const Args&... args); - template<class... Args> - size_t formatted_size(const locale& loc, string_view fmt, const Args&... args); - template<class... Args> - size_t formatted_size(const locale& loc, wstring_view fmt, const Args&... args); - - // [format.formatter], formatter - template<> struct formatter<char, char>; - template<> struct formatter<char, wchar_t>; - template<> struct formatter<wchar_t, wchar_t>; - - template<> struct formatter<charT*, charT>; - template<> struct formatter<const charT*, charT>; - template<size_t N> struct formatter<const charT[N], charT>; - template<class traits, class Allocator> - struct formatter<basic_string<charT, traits, Allocator>, charT>; - template<class traits> - struct formatter<basic_string_view<charT, traits>, charT>; - - // [format.parse.ctx], class template basic_format_parse_context - template<class charT> - class basic_format_parse_context { - public: - using char_type = charT; - using const_iterator = typename basic_string_view<charT>::const_iterator; - using iterator = const_iterator; - - private: - iterator begin_; // exposition only - iterator end_; // exposition only - enum indexing { unknown, manual, automatic }; // exposition only - indexing indexing_; // exposition only - size_t next_arg_id_; // exposition only - size_t num_args_; // exposition only - - public: - constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, - size_t num_args = 0) noexcept; - basic_format_parse_context(const basic_format_parse_context&) = delete; - basic_format_parse_context& operator=(const basic_format_parse_context&) = delete; - - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr void advance_to(const_iterator it); - - constexpr size_t next_arg_id(); - constexpr void check_arg_id(size_t id); - }; - using format_parse_context = basic_format_parse_context<char>; - using wformat_parse_context = basic_format_parse_context<wchar_t>; - - // [format.arguments], arguments - // [format.arg], class template basic_format_arg - template<class Context> - class basic_format_arg { - public: - class handle; - - private: - using char_type = typename Context::char_type; // exposition only - - variant<monostate, bool, char_type, - int, unsigned int, long long int, unsigned long long int, - float, double, long double, - const char_type*, basic_string_view<char_type>, - const void*, handle> value; // exposition only - - template<class T> explicit basic_format_arg(const T& v) noexcept; // exposition only - explicit basic_format_arg(float n) noexcept; // exposition only - explicit basic_format_arg(double n) noexcept; // exposition only - explicit basic_format_arg(long double n) noexcept; // exposition only - explicit basic_format_arg(const char_type* s); // exposition only - - template<class traits> - explicit basic_format_arg( - basic_string_view<char_type, traits> s) noexcept; // exposition only - - template<class traits, class Allocator> - explicit basic_format_arg( - const basic_string<char_type, traits, Allocator>& s) noexcept; // exposition only - - explicit basic_format_arg(nullptr_t) noexcept; // exposition only - - template<class T> - explicit basic_format_arg(const T* p) noexcept; // exposition only - - public: - basic_format_arg() noexcept; - - explicit operator bool() const noexcept; - }; - - template<class Visitor, class Context> - see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); - - // [format.arg.store], class template format-arg-store - template<class Context, class... Args> - struct format-arg-store { // exposition only - array<basic_format_arg<Context>, sizeof...(Args)> args; - }; - - template<class Context = format_context, class... Args> - format-arg-store<Context, Args...> - make_format_args(const Args&... args); - template<class... Args> - format-arg-store<wformat_context, Args...> - make_wformat_args(const Args&... args); - - // [format.error], class format_error - class format_error : public runtime_error { - public: - explicit format_error(const string& what_arg); - explicit format_error(const char* what_arg); - }; - - // [format.parse.ctx], class template basic_format_parse_context - template<class charT> - class basic_format_parse_context { - public: - using char_type = charT; - using const_iterator = typename basic_string_view<charT>::const_iterator; - using iterator = const_iterator; - - private: - iterator begin_; // exposition only - iterator end_; // exposition only - enum indexing { unknown, manual, automatic }; // exposition only - indexing indexing_; // exposition only - size_t next_arg_id_; // exposition only - size_t num_args_; // exposition only - - public: - constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, - size_t num_args = 0) noexcept; - basic_format_parse_context(const basic_format_parse_context&) = delete; - basic_format_parse_context& operator=(const basic_format_parse_context&) = delete; - - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr void advance_to(const_iterator it); - - constexpr size_t next_arg_id(); - constexpr void check_arg_id(size_t id); - }; - using format_parse_context = basic_format_parse_context<char>; - using wformat_parse_context = basic_format_parse_context<wchar_t>; -} - -*/ - -// Make sure all feature-test macros are available. -#include <version> -// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) - -#include <__config> -#include <__debug> -#include <__format/format_arg.h> -#include <__format/format_args.h> -#include <__format/format_context.h> -#include <__format/format_error.h> -#include <__format/format_parse_context.h> -#include <__format/format_string.h> -#include <__format/parser_std_format_spec.h> -#include <__format/formatter.h> -#include <__variant/monostate.h> -#include <array> -#include <concepts> -#include <string> -#include <string_view> -#include <type_traits> - -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -#include <locale> -#endif - -#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 > 17 - -// TODO FMT Remove this once we require compilers with proper C++20 support. -// If the compiler has no concepts support, the format header will be disabled. -// Without concepts support enable_if needs to be used and that too much effort -// to support compilers with partial C++20 support. -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// TODO FMT Evaluate which templates should be external templates. This -// improves the efficiency of the header. However since the header is still -// under heavy development and not all classes are stable it makes no sense -// to do this optimization now. - -using format_args = basic_format_args<format_context>; -using wformat_args = basic_format_args<wformat_context>; - -template <class _OutIt, class _CharT> -using format_args_t = basic_format_args<basic_format_context<_OutIt, _CharT>>; - -template <class _Context, class... _Args> -struct _LIBCPP_TEMPLATE_VIS __format_arg_store { - // TODO FMT Use a built-in array. - array<basic_format_arg<_Context>, sizeof...(_Args)> __args; -}; - -template <class _Context = format_context, class... _Args> -_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> -make_format_args(const _Args&... __args) { - return {basic_format_arg<_Context>(__args)...}; -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> -make_wformat_args(const _Args&... __args) { - return _VSTD::make_format_args<wformat_context>(__args...); -} - -namespace __format { -template <class _Tp, class _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_char { - _LIBCPP_HIDE_FROM_ABI - auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { - // TODO FMT Implement this function. - return __parse_ctx.begin(); - } - - _LIBCPP_HIDE_FROM_ABI - auto format(_Tp __c, auto& __ctx) -> decltype(__ctx.out()) { - // TODO FMT Implement the parsed formatting arguments. - auto __out_it = __ctx.out(); - *__out_it++ = _CharT(__c); - return __out_it; - } -}; - -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_c_string { - _LIBCPP_HIDE_FROM_ABI - auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { - // TODO FMT Implement this function. - return __parse_ctx.begin(); - } - - _LIBCPP_HIDE_FROM_ABI - auto format(const _CharT* __str, auto& __ctx) -> decltype(__ctx.out()) { - // TODO FMT Implement the parsed formatting arguments. - auto __out_it = __ctx.out(); - while (*__str) - *__out_it++ = *__str++; - return __out_it; - } -}; - -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_string { - _LIBCPP_HIDE_FROM_ABI - auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { - // TODO FMT Implement this function. - return __parse_ctx.begin(); - } - - _LIBCPP_HIDE_FROM_ABI - auto format(basic_string_view<_CharT> __str, auto& __ctx) - -> decltype(__ctx.out()) { - // TODO FMT Implement the parsed formatting arguments. - auto __out_it = __ctx.out(); - for (const auto __c : __str) - *__out_it++ = __c; - return __out_it; - } -}; - -template <class _Tp, class _CharT> -requires(is_arithmetic_v<_Tp> && - !same_as<_Tp, bool>) struct _LIBCPP_HIDE_FROM_ABI - __formatter_arithmetic { - _LIBCPP_HIDE_FROM_ABI - auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { - // TODO FMT Implement - return __parse_ctx.begin(); - } - - _LIBCPP_HIDE_FROM_ABI - auto format(_Tp __value, auto& __ctx) -> decltype(__ctx.out()) { - return __handle_format(__value, __ctx); - } - -private: - template <class _Uv> - _LIBCPP_HIDDEN static string - __convert(_Uv __value) requires(same_as<_CharT, char>) { - return _VSTD::to_string(__value); - } - template <class _Uv> - _LIBCPP_HIDDEN static wstring - __convert(_Uv __value) requires(same_as<_CharT, wchar_t>) { - return _VSTD::to_wstring(__value); - } - - template <class _Uv> - _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx) - -> decltype(__ctx.out()) -#ifndef _LIBCPP_HAS_NO_INT128 - requires(!same_as<_Uv, __int128_t> && !same_as<_Uv, __uint128_t>) -#endif - { - // TODO FMT Implement using formatting arguments - // TODO FMT Improve PoC since using std::to_string is inefficient. - // Note the code doesn't use std::string::iterator since the unit tests - // test with debug iterators and they fail with strings created from - // std::to_string. - auto __str = __convert(__value); - auto __out_it = __ctx.out(); - for (size_t __i = 0, __e = __str.size(); __i != __e; ++__i) - *__out_it++ = __str[__i]; - return __out_it; - } -#ifndef _LIBCPP_HAS_NO_INT128 - template <class _Uv> - _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx) - -> decltype(__ctx.out()) requires(same_as<_Uv, __int128_t> || - same_as<_Uv, __uint128_t>) { - using _To = conditional_t<is_signed_v<_Uv>, long long, unsigned long long>; - // TODO FMT Implement full 128-bit support. - if (__value < numeric_limits<_To>::min() || - __value > numeric_limits<_To>::max()) - __throw_format_error("128-bit value is outside of implemented range"); - - return __handle_format(static_cast<_To>(__value), __ctx); - } -#endif -}; -} // namespace __format - -// These specializations are helper stubs and not proper formatters. -// TODO FMT Implement the proper formatter specializations. - -// [format.formatter.spec]/2.1 The specializations - -template <> -struct _LIBCPP_TEMPLATE_VIS formatter<char, char> - : public __format::__formatter_char<char, char> {}; - -template <> -struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> - : public __format::__formatter_char<char, wchar_t> {}; - -template <> -struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> - : public __format::__formatter_char<wchar_t, wchar_t> {}; - -// [format.formatter.spec]/2.2 For each charT, the string type specializations - -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<_CharT*, _CharT> - : public __format::__formatter_c_string<_CharT> { - using _Base = __format::__formatter_c_string<_CharT>; - - _LIBCPP_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) - -> decltype(__ctx.out()) { - _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have " - "prevented an invalid pointer"); - return _Base::format(__str, __ctx); - } -}; - -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT*, _CharT> - : public __format::__formatter_c_string<_CharT> {}; - -template <class _CharT, size_t _Size> -struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT[_Size], _CharT> - : public __format::__formatter_string<_CharT> { - using _Base = __format::__formatter_string<_CharT>; - - _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) - -> decltype(__ctx.out()) { - return _Base::format(_VSTD::basic_string_view<_CharT>(__str, _Size), __ctx); - } -}; - -template <class _CharT, class _Traits, class _Allocator> -struct _LIBCPP_TEMPLATE_VIS - formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT> - : public __format::__formatter_string<_CharT> { - using _Base = __format::__formatter_string<_CharT>; - - _LIBCPP_HIDE_FROM_ABI auto - format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) - -> decltype(__ctx.out()) { - return _Base::format(_VSTD::basic_string_view<_CharT>(__str), __ctx); - } -}; - -template <class _CharT, class _Traits> -struct _LIBCPP_TEMPLATE_VIS - formatter<basic_string_view<_CharT, _Traits>, _CharT> - : public __format::__formatter_string<_CharT> {}; - -// [format.formatter.spec]/2.3 -// For each charT, for each cv-unqualified arithmetic type ArithmeticT other -// than char, wchar_t, char8_t, char16_t, or char32_t, a specialization - -// Boolean. -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<bool, _CharT> { - _LIBCPP_HIDE_FROM_ABI - auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { - // TODO FMT Implement - return __parse_ctx.begin(); - } - - _LIBCPP_HIDE_FROM_ABI - auto format(bool __b, auto& __ctx) -> decltype(__ctx.out()) { - // TODO FMT Implement using formatting arguments - auto __out_it = __ctx.out(); - *__out_it++ = _CharT('0') + __b; - return __out_it; - } -}; - -// Signed integral types. -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<signed char, _CharT> - : public __format::__formatter_arithmetic<signed char, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<short, _CharT> - : public __format::__formatter_arithmetic<short, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<int, _CharT> - : public __format::__formatter_arithmetic<int, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<long, _CharT> - : public __format::__formatter_arithmetic<long, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<long long, _CharT> - : public __format::__formatter_arithmetic<long long, _CharT> {}; -#ifndef _LIBCPP_HAS_NO_INT128 -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<__int128_t, _CharT> - : public __format::__formatter_arithmetic<__int128_t, _CharT> {}; -#endif - -// Unsigned integral types. -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<unsigned char, _CharT> - : public __format::__formatter_arithmetic<unsigned char, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<unsigned short, _CharT> - : public __format::__formatter_arithmetic<unsigned short, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<unsigned, _CharT> - : public __format::__formatter_arithmetic<unsigned, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long, _CharT> - : public __format::__formatter_arithmetic<unsigned long, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long long, _CharT> - : public __format::__formatter_arithmetic<unsigned long long, _CharT> {}; -#ifndef _LIBCPP_HAS_NO_INT128 -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS formatter<__uint128_t, _CharT> - : public __format::__formatter_arithmetic<__uint128_t, _CharT> {}; -#endif - -// Floating point types. -// TODO FMT There are no replacements for the floating point stubs due to not -// having floating point support in std::to_chars yet. These stubs aren't -// removed since they are useful for developing the real versions. -// Ultimately the stubs should be implemented properly and this code can be -// removed. -#if 0 -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<float, _CharT> - : public __format::__formatter_arithmetic<float, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT - formatter<double, _CharT> - : public __format::__formatter_arithmetic<double, _CharT> {}; -template <class _CharT> -struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT - formatter<long double, _CharT> - : public __format::__formatter_arithmetic<long double, _CharT> {}; -#endif - -namespace __format { - -template <class _CharT, class _ParseCtx, class _Ctx> -_LIBCPP_HIDE_FROM_ABI const _CharT* -__handle_replacement_field(const _CharT* __begin, const _CharT* __end, - _ParseCtx& __parse_ctx, _Ctx& __ctx) { - __format::__parse_number_result __r = - __format::__parse_arg_id(__begin, __end, __parse_ctx); - - switch (*__r.__ptr) { - case _CharT(':'): - // The arg-id has a format-specifier, advance the input to the format-spec. - __parse_ctx.advance_to(__r.__ptr + 1); - break; - case _CharT('}'): - // The arg-id has no format-specifier. - __parse_ctx.advance_to(__r.__ptr); - break; - default: - __throw_format_error( - "The replacement field arg-id should terminate at a ':' or '}'"); - } - - _VSTD::visit_format_arg( - [&](auto __arg) { - if constexpr (same_as<decltype(__arg), monostate>) - __throw_format_error("Argument index out of bounds"); - else { - formatter<decltype(__arg), _CharT> __formatter; - __parse_ctx.advance_to(__formatter.parse(__parse_ctx)); - __ctx.advance_to(__formatter.format(__arg, __ctx)); - } - }, - __ctx.arg(__r.__value)); - - __begin = __parse_ctx.begin(); - if (__begin == __end || *__begin != _CharT('}')) - __throw_format_error("The replacement field misses a terminating '}'"); - - return ++__begin; -} - -template <class _ParseCtx, class _Ctx> -_LIBCPP_HIDE_FROM_ABI typename _Ctx::iterator -__vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) { - using _CharT = typename _ParseCtx::char_type; - static_assert(same_as<typename _Ctx::char_type, _CharT>); - - const _CharT* __begin = __parse_ctx.begin(); - const _CharT* __end = __parse_ctx.end(); - typename _Ctx::iterator __out_it = __ctx.out(); - while (__begin != __end) { - switch (*__begin) { - case _CharT('{'): - ++__begin; - if (__begin == __end) - __throw_format_error("The format string terminates at a '{'"); - - if (*__begin != _CharT('{')) [[likely]] { - __ctx.advance_to(_VSTD::move(__out_it)); - __begin = - __handle_replacement_field(__begin, __end, __parse_ctx, __ctx); - __out_it = __ctx.out(); - - // The output is written and __begin points to the next character. So - // start the next iteration. - continue; - } - // The string is an escape character. - break; - - case _CharT('}'): - ++__begin; - if (__begin == __end || *__begin != _CharT('}')) - __throw_format_error( - "The format string contains an invalid escape sequence"); - - break; - } - - // Copy the character to the output verbatim. - *__out_it++ = *__begin++; - } - return __out_it; -} - -} // namespace __format - -template <class _OutIt, class _CharT> -requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt - __vformat_to(_OutIt __out_it, basic_string_view<_CharT> __fmt, - format_args_t<type_identity_t<_OutIt>, _CharT> __args) { - return __format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, - _VSTD::__format_context_create(_VSTD::move(__out_it), __args)); -} - -template <output_iterator<const char&> _OutIt> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -vformat_to(_OutIt __out_it, string_view __fmt, - format_args_t<type_identity_t<_OutIt>, char> __args) { - return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); -} - -template <output_iterator<const wchar_t&> _OutIt> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -vformat_to(_OutIt __out_it, wstring_view __fmt, - format_args_t<type_identity_t<_OutIt>, wchar_t> __args) { - return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); -} - -template <output_iterator<const char&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -format_to(_OutIt __out_it, string_view __fmt, const _Args&... __args) { - return _VSTD::vformat_to( - _VSTD::move(__out_it), __fmt, - _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...)); -} - -template <output_iterator<const wchar_t&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -format_to(_OutIt __out_it, wstring_view __fmt, const _Args&... __args) { - return _VSTD::vformat_to( - _VSTD::move(__out_it), __fmt, - _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>( - __args...)); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string -vformat(string_view __fmt, format_args __args) { - string __res; - _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); - return __res; -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring -vformat(wstring_view __fmt, wformat_args __args) { - wstring __res; - _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); - return __res; -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string -format(string_view __fmt, const _Args&... __args) { - return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)); -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring -format(wstring_view __fmt, const _Args&... __args) { - return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)); -} - -template <class _OutIt> -struct _LIBCPP_TEMPLATE_VIS format_to_n_result { - _OutIt out; - iter_difference_t<_OutIt> size; -}; - -template <output_iterator<const char&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> -format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, string_view __fmt, - const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - string __str = _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)); - iter_difference_t<_OutIt> __s = __str.size(); - iter_difference_t<_OutIt> __m = - _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); - __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); - return {_VSTD::move(__out_it), __s}; -} - -template <output_iterator<const wchar_t&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> -format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wstring_view __fmt, - const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - wstring __str = _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)); - iter_difference_t<_OutIt> __s = __str.size(); - iter_difference_t<_OutIt> __m = - _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); - __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); - return {_VSTD::move(__out_it), __s}; -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t -formatted_size(string_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)).size(); -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t -formatted_size(wstring_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)).size(); -} - -#ifndef _LIBCPP_HAS_NO_LOCALIZATION - -template <class _OutIt, class _CharT> -requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt - __vformat_to(_OutIt __out_it, locale __loc, basic_string_view<_CharT> __fmt, - format_args_t<type_identity_t<_OutIt>, _CharT> __args) { - return __format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, - _VSTD::__format_context_create(_VSTD::move(__out_it), __args, - _VSTD::move(__loc))); -} - -template <output_iterator<const char&> _OutIt> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -vformat_to(_OutIt __out_it, locale __loc, string_view __fmt, - format_args_t<type_identity_t<_OutIt>, char> __args) { - return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt, - __args); -} - -template <output_iterator<const wchar_t&> _OutIt> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt -vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt, - format_args_t<type_identity_t<_OutIt>, wchar_t> __args) { - return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt, - __args); -} - -template <output_iterator<const char&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( - _OutIt __out_it, locale __loc, string_view __fmt, const _Args&... __args) { - return _VSTD::vformat_to( - _VSTD::move(__out_it), _VSTD::move(__loc), __fmt, - _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...)); -} - -template <output_iterator<const wchar_t&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( - _OutIt __out_it, locale __loc, wstring_view __fmt, const _Args&... __args) { - return _VSTD::vformat_to( - _VSTD::move(__out_it), _VSTD::move(__loc), __fmt, - _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>( - __args...)); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string -vformat(locale __loc, string_view __fmt, format_args __args) { - string __res; - _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt, - __args); - return __res; -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring -vformat(locale __loc, wstring_view __fmt, wformat_args __args) { - wstring __res; - _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt, - __args); - return __res; -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string -format(locale __loc, string_view __fmt, const _Args&... __args) { - return _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_format_args(__args...)); -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring -format(locale __loc, wstring_view __fmt, const _Args&... __args) { - return _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_wformat_args(__args...)); -} - -template <output_iterator<const char&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> -format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, - string_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - string __str = _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_format_args(__args...)); - iter_difference_t<_OutIt> __s = __str.size(); - iter_difference_t<_OutIt> __m = - _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); - __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); - return {_VSTD::move(__out_it), __s}; -} - -template <output_iterator<const wchar_t&> _OutIt, class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> -format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, - wstring_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - wstring __str = _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_wformat_args(__args...)); - iter_difference_t<_OutIt> __s = __str.size(); - iter_difference_t<_OutIt> __m = - _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); - __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); - return {_VSTD::move(__out_it), __s}; -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t -formatted_size(locale __loc, string_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - return _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_format_args(__args...)) - .size(); -} - -template <class... _Args> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t -formatted_size(locale __loc, wstring_view __fmt, const _Args&... __args) { - // TODO FMT Improve PoC: using std::string is inefficient. - return _VSTD::vformat(_VSTD::move(__loc), __fmt, - _VSTD::make_wformat_args(__args...)) - .size(); -} - -#endif // _LIBCPP_HAS_NO_LOCALIZATION - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) -#endif //_LIBCPP_STD_VER > 17 - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) - -#endif // _LIBCPP_FORMAT - - -====================File: include/list==================== -// -*- C++ -*- -//===---------------------------- list ------------------------------------===// -// -// 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_LIST -#define _LIBCPP_LIST - -/* - list synopsis - -namespace std -{ - -template <class T, class Alloc = allocator<T> > -class list -{ -public: - - // types: - typedef T value_type; - typedef Alloc allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef implementation-defined size_type; - typedef implementation-defined difference_type; - typedef reverse_iterator<iterator> reverse_iterator; - typedef reverse_iterator<const_iterator> const_reverse_iterator; - - list() - noexcept(is_nothrow_default_constructible<allocator_type>::value); - explicit list(const allocator_type& a); - explicit list(size_type n); - explicit list(size_type n, const allocator_type& a); // C++14 - list(size_type n, const value_type& value); - list(size_type n, const value_type& value, const allocator_type& a); - template <class Iter> - list(Iter first, Iter last); - template <class Iter> - list(Iter first, Iter last, const allocator_type& a); - list(const list& x); - list(const list&, const allocator_type& a); - list(list&& x) - noexcept(is_nothrow_move_constructible<allocator_type>::value); - list(list&&, const allocator_type& a); - list(initializer_list<value_type>); - list(initializer_list<value_type>, const allocator_type& a); - - ~list(); - - list& operator=(const list& x); - list& operator=(list&& x) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable<allocator_type>::value); - list& operator=(initializer_list<value_type>); - template <class Iter> - void assign(Iter first, Iter last); - void assign(size_type n, const value_type& t); - void assign(initializer_list<value_type>); - - allocator_type get_allocator() const noexcept; - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - template <class... Args> - reference emplace_front(Args&&... args); // reference in C++17 - void pop_front(); - template <class... Args> - reference emplace_back(Args&&... args); // reference in C++17 - void pop_back(); - void push_front(const value_type& x); - void push_front(value_type&& x); - void push_back(const value_type& x); - void push_back(value_type&& x); - template <class... Args> - iterator emplace(const_iterator position, Args&&... args); - iterator insert(const_iterator position, const value_type& x); - iterator insert(const_iterator position, value_type&& x); - iterator insert(const_iterator position, size_type n, const value_type& x); - template <class Iter> - iterator insert(const_iterator position, Iter first, Iter last); - iterator insert(const_iterator position, initializer_list<value_type> il); - - iterator erase(const_iterator position); - iterator erase(const_iterator position, const_iterator last); - - void resize(size_type sz); - void resize(size_type sz, const value_type& c); - - void swap(list&) - noexcept(allocator_traits<allocator_type>::is_always_equal::value); // C++17 - void clear() noexcept; - - void splice(const_iterator position, list& x); - void splice(const_iterator position, list&& x); - void splice(const_iterator position, list& x, const_iterator i); - void splice(const_iterator position, list&& x, const_iterator i); - void splice(const_iterator position, list& x, const_iterator first, - const_iterator last); - void splice(const_iterator position, list&& x, const_iterator first, - const_iterator last); - - size_type remove(const value_type& value); // void before C++20 - template <class Pred> - size_type remove_if(Pred pred); // void before C++20 - size_type unique(); // void before C++20 - template <class BinaryPredicate> - size_type unique(BinaryPredicate binary_pred); // void before C++20 - void merge(list& x); - void merge(list&& x); - template <class Compare> - void merge(list& x, Compare comp); - template <class Compare> - void merge(list&& x, Compare comp); - void sort(); - template <class Compare> - void sort(Compare comp); - void reverse() noexcept; -}; - - -template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> - list(InputIterator, InputIterator, Allocator = Allocator()) - -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 - -template <class T, class Alloc> - bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y); -template <class T, class Alloc> - bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); -template <class T, class Alloc> - bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); -template <class T, class Alloc> - bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); -template <class T, class Alloc> - bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); -template <class T, class Alloc> - bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); - -template <class T, class Alloc> - void swap(list<T,Alloc>& x, list<T,Alloc>& y) - noexcept(noexcept(x.swap(y))); - -template <class T, class Allocator, class U> - typename list<T, Allocator>::size_type - erase(list<T, Allocator>& c, const U& value); // C++20 -template <class T, class Allocator, class Predicate> - typename list<T, Allocator>::size_type - erase_if(list<T, Allocator>& c, Predicate pred); // C++20 - -} // std - -*/ - -#include <__config> -#include <__debug> -#include <__utility/forward.h> -#include <algorithm> -#include <initializer_list> -#include <iterator> -#include <limits> -#include <memory> -#include <type_traits> -#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 _Tp, class _VoidPtr> struct __list_node; -template <class _Tp, class _VoidPtr> struct __list_node_base; - -template <class _Tp, class _VoidPtr> -struct __list_node_pointer_traits { - typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type - __node_pointer; - typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type - __base_pointer; - -#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB) - typedef __base_pointer __link_pointer; -#else - typedef typename conditional< - is_pointer<_VoidPtr>::value, - __base_pointer, - __node_pointer - >::type __link_pointer; -#endif - - typedef typename conditional< - is_same<__link_pointer, __node_pointer>::value, - __base_pointer, - __node_pointer - >::type __non_link_pointer; - - static _LIBCPP_INLINE_VISIBILITY - __link_pointer __unsafe_link_pointer_cast(__link_pointer __p) { - return __p; - } - - static _LIBCPP_INLINE_VISIBILITY - __link_pointer __unsafe_link_pointer_cast(__non_link_pointer __p) { - return static_cast<__link_pointer>(static_cast<_VoidPtr>(__p)); - } - -}; - -template <class _Tp, class _VoidPtr> -struct __list_node_base -{ - typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; - typedef typename _NodeTraits::__node_pointer __node_pointer; - typedef typename _NodeTraits::__base_pointer __base_pointer; - typedef typename _NodeTraits::__link_pointer __link_pointer; - - __link_pointer __prev_; - __link_pointer __next_; - - _LIBCPP_INLINE_VISIBILITY - __list_node_base() : __prev_(_NodeTraits::__unsafe_link_pointer_cast(__self())), - __next_(_NodeTraits::__unsafe_link_pointer_cast(__self())) {} - - _LIBCPP_INLINE_VISIBILITY - __base_pointer __self() { - return pointer_traits<__base_pointer>::pointer_to(*this); - } - - _LIBCPP_INLINE_VISIBILITY - __node_pointer __as_node() { - return static_cast<__node_pointer>(__self()); - } -}; - -template <class _Tp, class _VoidPtr> -struct _LIBCPP_STANDALONE_DEBUG __list_node - : public __list_node_base<_Tp, _VoidPtr> -{ - _Tp __value_; - - typedef __list_node_base<_Tp, _VoidPtr> __base; - typedef typename __base::__link_pointer __link_pointer; - - _LIBCPP_INLINE_VISIBILITY - __link_pointer __as_link() { - return static_cast<__link_pointer>(__base::__self()); - } -}; - -template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS list; -template <class _Tp, class _Alloc> class __list_imp; -template <class _Tp, class _VoidPtr> class _LIBCPP_TEMPLATE_VIS __list_const_iterator; - -template <class _Tp, class _VoidPtr> -class _LIBCPP_TEMPLATE_VIS __list_iterator -{ - typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; - typedef typename _NodeTraits::__link_pointer __link_pointer; - - __link_pointer __ptr_; - -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_INLINE_VISIBILITY - explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT - : __ptr_(__p) - { - __get_db()->__insert_ic(this, __c); - } -#else - _LIBCPP_INLINE_VISIBILITY - explicit __list_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} -#endif - - - - template<class, class> friend class list; - template<class, class> friend class __list_imp; - template<class, class> friend class __list_const_iterator; -public: - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef value_type& reference; - typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer; - typedef typename pointer_traits<pointer>::difference_type difference_type; - - _LIBCPP_INLINE_VISIBILITY - __list_iterator() _NOEXCEPT : __ptr_(nullptr) - { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif - } - -#if _LIBCPP_DEBUG_LEVEL == 2 - - _LIBCPP_INLINE_VISIBILITY - __list_iterator(const __list_iterator& __p) - : __ptr_(__p.__ptr_) - { - __get_db()->__iterator_copy(this, &__p); - } - - _LIBCPP_INLINE_VISIBILITY - ~__list_iterator() - { - __get_db()->__erase_i(this); - } - - _LIBCPP_INLINE_VISIBILITY - __list_iterator& operator=(const __list_iterator& __p) - { - if (this != &__p) - { - __get_db()->__iterator_copy(this, &__p); - __ptr_ = __p.__ptr_; - } - return *this; - } - -#endif // _LIBCPP_DEBUG_LEVEL == 2 - - _LIBCPP_INLINE_VISIBILITY - reference operator*() const - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to dereference a non-dereferenceable list::iterator"); -#endif - return __ptr_->__as_node()->__value_; - } - _LIBCPP_INLINE_VISIBILITY - pointer operator->() const - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to dereference a non-dereferenceable list::iterator"); -#endif - return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_); - } - - _LIBCPP_INLINE_VISIBILITY - __list_iterator& operator++() - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment a non-incrementable list::iterator"); -#endif - __ptr_ = __ptr_->__next_; - return *this; - } - _LIBCPP_INLINE_VISIBILITY - __list_iterator operator++(int) {__list_iterator __t(*this); ++(*this); return __t;} - - _LIBCPP_INLINE_VISIBILITY - __list_iterator& operator--() - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), - "Attempted to decrement a non-decrementable list::iterator"); -#endif - __ptr_ = __ptr_->__prev_; - return *this; - } - _LIBCPP_INLINE_VISIBILITY - __list_iterator operator--(int) {__list_iterator __t(*this); --(*this); return __t;} - - friend _LIBCPP_INLINE_VISIBILITY - bool operator==(const __list_iterator& __x, const __list_iterator& __y) - { - return __x.__ptr_ == __y.__ptr_; - } - friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(const __list_iterator& __x, const __list_iterator& __y) - {return !(__x == __y);} -}; - -template <class _Tp, class _VoidPtr> -class _LIBCPP_TEMPLATE_VIS __list_const_iterator -{ - typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; - typedef typename _NodeTraits::__link_pointer __link_pointer; - - __link_pointer __ptr_; - -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_INLINE_VISIBILITY - explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT - : __ptr_(__p) - { - __get_db()->__insert_ic(this, __c); - } -#else - _LIBCPP_INLINE_VISIBILITY - explicit __list_const_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} -#endif - - template<class, class> friend class list; - template<class, class> friend class __list_imp; -public: - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef const value_type& reference; - typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer; - typedef typename pointer_traits<pointer>::difference_type difference_type; - - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator() _NOEXCEPT : __ptr_(nullptr) - { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif - } - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT - : __ptr_(__p.__ptr_) - { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__iterator_copy(this, &__p); -#endif - } - -#if _LIBCPP_DEBUG_LEVEL == 2 - - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator(const __list_const_iterator& __p) - : __ptr_(__p.__ptr_) - { - __get_db()->__iterator_copy(this, &__p); - } - - _LIBCPP_INLINE_VISIBILITY - ~__list_const_iterator() - { - __get_db()->__erase_i(this); - } - - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator& operator=(const __list_const_iterator& __p) - { - if (this != &__p) - { - __get_db()->__iterator_copy(this, &__p); - __ptr_ = __p.__ptr_; - } - return *this; - } - -#endif // _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_INLINE_VISIBILITY - reference operator*() const - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to dereference a non-dereferenceable list::const_iterator"); -#endif - return __ptr_->__as_node()->__value_; - } - _LIBCPP_INLINE_VISIBILITY - pointer operator->() const - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to dereference a non-dereferenceable list::const_iterator"); -#endif - return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_); - } - - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator& operator++() - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment a non-incrementable list::const_iterator"); -#endif - __ptr_ = __ptr_->__next_; - return *this; - } - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator operator++(int) {__list_const_iterator __t(*this); ++(*this); return __t;} - - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator& operator--() - { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), - "Attempted to decrement a non-decrementable list::const_iterator"); -#endif - __ptr_ = __ptr_->__prev_; - return *this; - } - _LIBCPP_INLINE_VISIBILITY - __list_const_iterator operator--(int) {__list_const_iterator __t(*this); --(*this); return __t;} - - friend _LIBCPP_INLINE_VISIBILITY - bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y) - { - return __x.__ptr_ == __y.__ptr_; - } - friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y) - {return !(__x == __y);} -}; - -template <class _Tp, class _Alloc> -class __list_imp -{ - __list_imp(const __list_imp&); - __list_imp& operator=(const __list_imp&); -public: - typedef _Alloc allocator_type; - typedef allocator_traits<allocator_type> __alloc_traits; - typedef typename __alloc_traits::size_type size_type; -protected: - typedef _Tp value_type; - typedef typename __alloc_traits::void_pointer __void_pointer; - typedef __list_iterator<value_type, __void_pointer> iterator; - typedef __list_const_iterator<value_type, __void_pointer> const_iterator; - typedef __list_node_base<value_type, __void_pointer> __node_base; - typedef __list_node<value_type, __void_pointer> __node; - typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; - typedef allocator_traits<__node_allocator> __node_alloc_traits; - typedef typename __node_alloc_traits::pointer __node_pointer; - typedef typename __node_alloc_traits::pointer __node_const_pointer; - typedef __list_node_pointer_traits<value_type, __void_pointer> __node_pointer_traits; - typedef typename __node_pointer_traits::__link_pointer __link_pointer; - typedef __link_pointer __link_const_pointer; - typedef typename __alloc_traits::pointer pointer; - typedef typename __alloc_traits::const_pointer const_pointer; - typedef typename __alloc_traits::difference_type difference_type; - - typedef typename __rebind_alloc_helper<__alloc_traits, __node_base>::type __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"); - - __node_base __end_; - __compressed_pair<size_type, __node_allocator> __size_alloc_; - - _LIBCPP_INLINE_VISIBILITY - __link_pointer __end_as_link() const _NOEXCEPT { - return __node_pointer_traits::__unsafe_link_pointer_cast( - const_cast<__node_base&>(__end_).__self()); - } - - _LIBCPP_INLINE_VISIBILITY - size_type& __sz() _NOEXCEPT {return __size_alloc_.first();} - _LIBCPP_INLINE_VISIBILITY - const size_type& __sz() const _NOEXCEPT - {return __size_alloc_.first();} - _LIBCPP_INLINE_VISIBILITY - __node_allocator& __node_alloc() _NOEXCEPT - {return __size_alloc_.second();} - _LIBCPP_INLINE_VISIBILITY - const __node_allocator& __node_alloc() const _NOEXCEPT - {return __size_alloc_.second();} - - _LIBCPP_INLINE_VISIBILITY - size_type __node_alloc_max_size() const _NOEXCEPT { - return __node_alloc_traits::max_size(__node_alloc()); - } - _LIBCPP_INLINE_VISIBILITY - static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT; - - _LIBCPP_INLINE_VISIBILITY - __list_imp() - _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value); - _LIBCPP_INLINE_VISIBILITY - __list_imp(const allocator_type& __a); - _LIBCPP_INLINE_VISIBILITY - __list_imp(const __node_allocator& __a); -#ifndef _LIBCPP_CXX03_LANG - __list_imp(__node_allocator&& __a) _NOEXCEPT; -#endif - ~__list_imp(); - void clear() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - bool empty() const _NOEXCEPT {return __sz() == 0;} - - _LIBCPP_INLINE_VISIBILITY - iterator begin() _NOEXCEPT - { -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__end_.__next_, this); -#else - return iterator(__end_.__next_); -#endif - } - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const _NOEXCEPT - { -#if _LIBCPP_DEBUG_LEVEL == 2 - return const_iterator(__end_.__next_, this); -#else - return const_iterator(__end_.__next_); -#endif - } - _LIBCPP_INLINE_VISIBILITY - iterator end() _NOEXCEPT - { -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__end_as_link(), this); -#else - return iterator(__end_as_link()); -#endif - } - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const _NOEXCEPT - { -#if _LIBCPP_DEBUG_LEVEL == 2 - return const_iterator(__end_as_link(), this); -#else - return const_iterator(__end_as_link()); -#endif - } - - void 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); -#endif - - _LIBCPP_INLINE_VISIBILITY - void __copy_assign_alloc(const __list_imp& __c) - {__copy_assign_alloc(__c, integral_constant<bool, - __node_alloc_traits::propagate_on_container_copy_assignment::value>());} - - _LIBCPP_INLINE_VISIBILITY - void __move_assign_alloc(__list_imp& __c) - _NOEXCEPT_( - !__node_alloc_traits::propagate_on_container_move_assignment::value || - is_nothrow_move_assignable<__node_allocator>::value) - {__move_assign_alloc(__c, integral_constant<bool, - __node_alloc_traits::propagate_on_container_move_assignment::value>());} - -private: - _LIBCPP_INLINE_VISIBILITY - void __copy_assign_alloc(const __list_imp& __c, true_type) - { - if (__node_alloc() != __c.__node_alloc()) - clear(); - __node_alloc() = __c.__node_alloc(); - } - - _LIBCPP_INLINE_VISIBILITY - void __copy_assign_alloc(const __list_imp&, false_type) - {} - - _LIBCPP_INLINE_VISIBILITY - void __move_assign_alloc(__list_imp& __c, true_type) - _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) - { - __node_alloc() = _VSTD::move(__c.__node_alloc()); - } - - _LIBCPP_INLINE_VISIBILITY - void __move_assign_alloc(__list_imp&, false_type) - _NOEXCEPT - {} - - _LIBCPP_INLINE_VISIBILITY - void __invalidate_all_iterators() { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__invalidate_all(this); -#endif - } -}; - -// Unlink nodes [__f, __l] -template <class _Tp, class _Alloc> -inline -void -__list_imp<_Tp, _Alloc>::__unlink_nodes(__link_pointer __f, __link_pointer __l) - _NOEXCEPT -{ - __f->__prev_->__next_ = __l->__next_; - __l->__next_->__prev_ = __f->__prev_; -} - -template <class _Tp, class _Alloc> -inline -__list_imp<_Tp, _Alloc>::__list_imp() - _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) - : __size_alloc_(0, __default_init_tag()) -{ -} - -template <class _Tp, class _Alloc> -inline -__list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a) - : __size_alloc_(0, __node_allocator(__a)) -{ -} - -template <class _Tp, class _Alloc> -inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a) - : __size_alloc_(0, __a) {} - -#ifndef _LIBCPP_CXX03_LANG -template <class _Tp, class _Alloc> -inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT - : __size_alloc_(0, _VSTD::move(__a)) {} -#endif - -template <class _Tp, class _Alloc> -__list_imp<_Tp, _Alloc>::~__list_imp() { - clear(); -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__erase_c(this); -#endif -} - -template <class _Tp, class _Alloc> -void -__list_imp<_Tp, _Alloc>::clear() _NOEXCEPT -{ - if (!empty()) - { - __node_allocator& __na = __node_alloc(); - __link_pointer __f = __end_.__next_; - __link_pointer __l = __end_as_link(); - __unlink_nodes(__f, __l->__prev_); - __sz() = 0; - while (__f != __l) - { - __node_pointer __np = __f->__as_node(); - __f = __f->__next_; - __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); - __node_alloc_traits::deallocate(__na, __np, 1); - } - __invalidate_all_iterators(); - } -} - -template <class _Tp, class _Alloc> -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) -#endif -{ - _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value || - this->__node_alloc() == __c.__node_alloc(), - "list::swap: Either propagate_on_container_swap must be true" - " or the allocators must compare equal"); - using _VSTD::swap; - _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc()); - swap(__sz(), __c.__sz()); - swap(__end_, __c.__end_); - if (__sz() == 0) - __end_.__next_ = __end_.__prev_ = __end_as_link(); - else - __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_as_link(); - if (__c.__sz() == 0) - __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_as_link(); - else - __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link(); - -#if _LIBCPP_DEBUG_LEVEL == 2 - __libcpp_db* __db = __get_db(); - __c_node* __cn1 = __db->__find_c_and_lock(this); - __c_node* __cn2 = __db->__find_c(&__c); - _VSTD::swap(__cn1->beg_, __cn2->beg_); - _VSTD::swap(__cn1->end_, __cn2->end_); - _VSTD::swap(__cn1->cap_, __cn2->cap_); - for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;) - { - --__p; - const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_); - if (__i->__ptr_ == __c.__end_as_link()) - { - __cn2->__add(*__p); - if (--__cn1->end_ != __p) - _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*)); - } - else - (*__p)->__c_ = __cn1; - } - for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;) - { - --__p; - const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_); - if (__i->__ptr_ == __end_as_link()) - { - __cn1->__add(*__p); - if (--__cn2->end_ != __p) - _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); - } - else - (*__p)->__c_ = __cn2; - } - __db->unlock(); -#endif -} - -template <class _Tp, class _Alloc /*= allocator<_Tp>*/> -class _LIBCPP_TEMPLATE_VIS list - : private __list_imp<_Tp, _Alloc> -{ - typedef __list_imp<_Tp, _Alloc> base; - typedef typename base::__node __node; - typedef typename base::__node_allocator __node_allocator; - typedef typename base::__node_pointer __node_pointer; - typedef typename base::__node_alloc_traits __node_alloc_traits; - typedef typename base::__node_base __node_base; - typedef typename base::__node_base_pointer __node_base_pointer; - typedef typename base::__link_pointer __link_pointer; - -public: - typedef _Tp value_type; - typedef _Alloc allocator_type; - static_assert((is_same<value_type, typename allocator_type::value_type>::value), - "Invalid allocator::value_type"); - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename base::pointer pointer; - typedef typename base::const_pointer const_pointer; - typedef typename base::size_type size_type; - typedef typename base::difference_type difference_type; - typedef typename base::iterator iterator; - typedef typename base::const_iterator const_iterator; - typedef _VSTD::reverse_iterator<iterator> reverse_iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; -#if _LIBCPP_STD_VER > 17 - typedef size_type __remove_return_type; -#else - typedef void __remove_return_type; -#endif - - _LIBCPP_INLINE_VISIBILITY - list() - _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) - { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - } - _LIBCPP_INLINE_VISIBILITY - explicit list(const allocator_type& __a) : base(__a) - { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - } - explicit list(size_type __n); -#if _LIBCPP_STD_VER > 11 - explicit list(size_type __n, const allocator_type& __a); -#endif - list(size_type __n, const value_type& __x); - list(size_type __n, const value_type& __x, const allocator_type& __a); - template <class _InpIter> - list(_InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); - template <class _InpIter> - list(_InpIter __f, _InpIter __l, const allocator_type& __a, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); - - list(const list& __c); - list(const list& __c, const __identity_t<allocator_type>& __a); - _LIBCPP_INLINE_VISIBILITY - list& operator=(const list& __c); -#ifndef _LIBCPP_CXX03_LANG - list(initializer_list<value_type> __il); - list(initializer_list<value_type> __il, const allocator_type& __a); - - _LIBCPP_INLINE_VISIBILITY - list(list&& __c) - _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value); - _LIBCPP_INLINE_VISIBILITY - list(list&& __c, const __identity_t<allocator_type>& __a); - _LIBCPP_INLINE_VISIBILITY - list& operator=(list&& __c) - _NOEXCEPT_( - __node_alloc_traits::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable<__node_allocator>::value); - - _LIBCPP_INLINE_VISIBILITY - list& operator=(initializer_list<value_type> __il) - {assign(__il.begin(), __il.end()); return *this;} - - _LIBCPP_INLINE_VISIBILITY - void assign(initializer_list<value_type> __il) - {assign(__il.begin(), __il.end());} -#endif // _LIBCPP_CXX03_LANG - - template <class _InpIter> - void assign(_InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); - void assign(size_type __n, const value_type& __x); - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const _NOEXCEPT; - - _LIBCPP_INLINE_VISIBILITY - size_type size() const _NOEXCEPT {return base::__sz();} - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - bool empty() const _NOEXCEPT {return base::empty();} - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const _NOEXCEPT - { - return _VSTD::min<size_type>( - base::__node_alloc_max_size(), - numeric_limits<difference_type >::max()); - } - - _LIBCPP_INLINE_VISIBILITY - iterator begin() _NOEXCEPT {return base::begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const _NOEXCEPT {return base::begin();} - _LIBCPP_INLINE_VISIBILITY - iterator end() _NOEXCEPT {return base::end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const _NOEXCEPT {return base::end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator cbegin() const _NOEXCEPT {return base::begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator cend() const _NOEXCEPT {return base::end();} - - _LIBCPP_INLINE_VISIBILITY - reverse_iterator rbegin() _NOEXCEPT - {return reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator rbegin() const _NOEXCEPT - {return const_reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY - reverse_iterator rend() _NOEXCEPT - {return reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator rend() const _NOEXCEPT - {return const_reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator crbegin() const _NOEXCEPT - {return const_reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator crend() const _NOEXCEPT - {return const_reverse_iterator(begin());} - - _LIBCPP_INLINE_VISIBILITY - reference front() - { - _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); - return base::__end_.__next_->__as_node()->__value_; - } - _LIBCPP_INLINE_VISIBILITY - const_reference front() const - { - _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); - return base::__end_.__next_->__as_node()->__value_; - } - _LIBCPP_INLINE_VISIBILITY - reference back() - { - _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); - return base::__end_.__prev_->__as_node()->__value_; - } - _LIBCPP_INLINE_VISIBILITY - const_reference back() const - { - _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); - return base::__end_.__prev_->__as_node()->__value_; - } - -#ifndef _LIBCPP_CXX03_LANG - void push_front(value_type&& __x); - void push_back(value_type&& __x); - - template <class... _Args> -#if _LIBCPP_STD_VER > 14 - reference emplace_front(_Args&&... __args); -#else - void emplace_front(_Args&&... __args); -#endif - template <class... _Args> -#if _LIBCPP_STD_VER > 14 - reference emplace_back(_Args&&... __args); -#else - void emplace_back(_Args&&... __args); -#endif - template <class... _Args> - iterator emplace(const_iterator __p, _Args&&... __args); - - iterator insert(const_iterator __p, value_type&& __x); - - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __p, initializer_list<value_type> __il) - {return insert(__p, __il.begin(), __il.end());} -#endif // _LIBCPP_CXX03_LANG - - void push_front(const value_type& __x); - void push_back(const value_type& __x); - -#ifndef _LIBCPP_CXX03_LANG - template <class _Arg> - _LIBCPP_INLINE_VISIBILITY - void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } -#else - _LIBCPP_INLINE_VISIBILITY - void __emplace_back(value_type const& __arg) { push_back(__arg); } -#endif - - iterator insert(const_iterator __p, const value_type& __x); - iterator insert(const_iterator __p, size_type __n, const value_type& __x); - template <class _InpIter> - iterator insert(const_iterator __p, _InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); - - _LIBCPP_INLINE_VISIBILITY - void swap(list& __c) -#if _LIBCPP_STD_VER >= 14 - _NOEXCEPT -#else - _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value) -#endif - {base::swap(__c);} - _LIBCPP_INLINE_VISIBILITY - void clear() _NOEXCEPT {base::clear();} - - void pop_front(); - void pop_back(); - - iterator erase(const_iterator __p); - iterator erase(const_iterator __f, const_iterator __l); - - void resize(size_type __n); - void resize(size_type __n, const value_type& __x); - - void splice(const_iterator __p, list& __c); -#ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - void splice(const_iterator __p, list&& __c) {splice(__p, __c);} - _LIBCPP_INLINE_VISIBILITY - void splice(const_iterator __p, list&& __c, const_iterator __i) - {splice(__p, __c, __i);} - _LIBCPP_INLINE_VISIBILITY - void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l) - {splice(__p, __c, __f, __l);} -#endif - void splice(const_iterator __p, list& __c, const_iterator __i); - void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l); - - __remove_return_type remove(const value_type& __x); - template <class _Pred> __remove_return_type remove_if(_Pred __pred); - _LIBCPP_INLINE_VISIBILITY - __remove_return_type unique() { return unique(__equal_to<value_type>()); } - template <class _BinaryPred> - __remove_return_type unique(_BinaryPred __binary_pred); - _LIBCPP_INLINE_VISIBILITY - void merge(list& __c); -#ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - void merge(list&& __c) {merge(__c);} - - template <class _Comp> - _LIBCPP_INLINE_VISIBILITY - void merge(list&& __c, _Comp __comp) {merge(__c, __comp);} -#endif - template <class _Comp> - void merge(list& __c, _Comp __comp); - - _LIBCPP_INLINE_VISIBILITY - void sort(); - template <class _Comp> - _LIBCPP_INLINE_VISIBILITY - void sort(_Comp __comp); - - void reverse() _NOEXCEPT; - - bool __invariants() const; - - typedef __allocator_destructor<__node_allocator> __node_destructor; - typedef unique_ptr<__node, __node_destructor> __hold_pointer; - - _LIBCPP_INLINE_VISIBILITY - __hold_pointer __allocate_node(__node_allocator& __na) { - __node_pointer __p = __node_alloc_traits::allocate(__na, 1); - __p->__prev_ = nullptr; - return __hold_pointer(__p, __node_destructor(__na, 1)); - } - -#if _LIBCPP_DEBUG_LEVEL == 2 - - bool __dereferenceable(const const_iterator* __i) const; - bool __decrementable(const const_iterator* __i) const; - bool __addable(const const_iterator* __i, ptrdiff_t __n) const; - bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; - -#endif // _LIBCPP_DEBUG_LEVEL == 2 - -private: - _LIBCPP_INLINE_VISIBILITY - static void __link_nodes (__link_pointer __p, __link_pointer __f, __link_pointer __l); - _LIBCPP_INLINE_VISIBILITY - void __link_nodes_at_front(__link_pointer __f, __link_pointer __l); - _LIBCPP_INLINE_VISIBILITY - void __link_nodes_at_back (__link_pointer __f, __link_pointer __l); - iterator __iterator(size_type __n); - template <class _Comp> - static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp); - - void __move_assign(list& __c, true_type) - _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value); - void __move_assign(list& __c, false_type); -}; - -#if _LIBCPP_STD_VER >= 17 -template<class _InputIterator, - class _Alloc = allocator<__iter_value_type<_InputIterator>>, - class = enable_if_t<__is_allocator<_Alloc>::value> - > -list(_InputIterator, _InputIterator) - -> list<__iter_value_type<_InputIterator>, _Alloc>; - -template<class _InputIterator, - class _Alloc, - class = enable_if_t<__is_allocator<_Alloc>::value> - > -list(_InputIterator, _InputIterator, _Alloc) - -> list<__iter_value_type<_InputIterator>, _Alloc>; -#endif - -// Link in nodes [__f, __l] just prior to __p -template <class _Tp, class _Alloc> -inline -void -list<_Tp, _Alloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l) -{ - __p->__prev_->__next_ = __f; - __f->__prev_ = __p->__prev_; - __p->__prev_ = __l; - __l->__next_ = __p; -} - -// Link in nodes [__f, __l] at the front of the list -template <class _Tp, class _Alloc> -inline -void -list<_Tp, _Alloc>::__link_nodes_at_front(__link_pointer __f, __link_pointer __l) -{ - __f->__prev_ = base::__end_as_link(); - __l->__next_ = base::__end_.__next_; - __l->__next_->__prev_ = __l; - base::__end_.__next_ = __f; -} - -// Link in nodes [__f, __l] at the back of the list -template <class _Tp, class _Alloc> -inline -void -list<_Tp, _Alloc>::__link_nodes_at_back(__link_pointer __f, __link_pointer __l) -{ - __l->__next_ = base::__end_as_link(); - __f->__prev_ = base::__end_.__prev_; - __f->__prev_->__next_ = __f; - base::__end_.__prev_ = __l; -} - - -template <class _Tp, class _Alloc> -inline -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::__iterator(size_type __n) -{ - return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n) - : _VSTD::prev(end(), base::__sz() - __n); -} - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(size_type __n) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __n > 0; --__n) -#ifndef _LIBCPP_CXX03_LANG - emplace_back(); -#else - push_back(value_type()); -#endif -} - -#if _LIBCPP_STD_VER > 11 -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __n > 0; --__n) - emplace_back(); -} -#endif - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(size_type __n, const value_type& __x) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __n > 0; --__n) - push_back(__x); -} - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a) - : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __n > 0; --__n) - push_back(__x); -} - -template <class _Tp, class _Alloc> -template <class _InpIter> -list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __f != __l; ++__f) - __emplace_back(*__f); -} - -template <class _Tp, class _Alloc> -template <class _InpIter> -list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) - : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (; __f != __l; ++__f) - __emplace_back(*__f); -} - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(const list& __c) - : base(__node_alloc_traits::select_on_container_copy_construction( - __c.__node_alloc())) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i) - push_back(*__i); -} - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(const list& __c, const __identity_t<allocator_type>& __a) - : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i) - push_back(*__i); -} - -#ifndef _LIBCPP_CXX03_LANG - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a) - : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (typename initializer_list<value_type>::const_iterator __i = __il.begin(), - __e = __il.end(); __i != __e; ++__i) - push_back(*__i); -} - -template <class _Tp, class _Alloc> -list<_Tp, _Alloc>::list(initializer_list<value_type> __il) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - for (typename initializer_list<value_type>::const_iterator __i = __il.begin(), - __e = __il.end(); __i != __e; ++__i) - push_back(*__i); -} - -template <class _Tp, class _Alloc> -inline list<_Tp, _Alloc>::list(list&& __c) - _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value) - : base(_VSTD::move(__c.__node_alloc())) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - splice(end(), __c); -} - -template <class _Tp, class _Alloc> -inline -list<_Tp, _Alloc>::list(list&& __c, const __identity_t<allocator_type>& __a) - : base(__a) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_c(this); -#endif - if (__a == __c.get_allocator()) - splice(end(), __c); - else - { - typedef move_iterator<iterator> _Ip; - assign(_Ip(__c.begin()), _Ip(__c.end())); - } -} - -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) -{ - __move_assign(__c, integral_constant<bool, - __node_alloc_traits::propagate_on_container_move_assignment::value>()); - return *this; -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::__move_assign(list& __c, false_type) -{ - if (base::__node_alloc() != __c.__node_alloc()) - { - typedef move_iterator<iterator> _Ip; - assign(_Ip(__c.begin()), _Ip(__c.end())); - } - else - __move_assign(__c, true_type()); -} - -template <class _Tp, class _Alloc> -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); -} - -#endif // _LIBCPP_CXX03_LANG - -template <class _Tp, class _Alloc> -inline -list<_Tp, _Alloc>& -list<_Tp, _Alloc>::operator=(const list& __c) -{ - if (this != &__c) - { - base::__copy_assign_alloc(__c); - assign(__c.begin(), __c.end()); - } - return *this; -} - -template <class _Tp, class _Alloc> -template <class _InpIter> -void -list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) -{ - iterator __i = begin(); - iterator __e = end(); - for (; __f != __l && __i != __e; ++__f, (void) ++__i) - *__i = *__f; - if (__i == __e) - insert(__e, __f, __l); - else - erase(__i, __e); -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__invalidate_all(this); -#endif -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x) -{ - iterator __i = begin(); - iterator __e = end(); - for (; __n > 0 && __i != __e; --__n, (void) ++__i) - *__i = __x; - if (__i == __e) - insert(__e, __n, __x); - else - erase(__i, __e); -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__invalidate_all(this); -#endif -} - -template <class _Tp, class _Alloc> -inline -_Alloc -list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT -{ - return allocator_type(base::__node_alloc()); -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::insert(iterator, x) called with an iterator not" - " referring to this list"); -#endif - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link()); - ++base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__hold.release()->__as_link(), this); -#else - return iterator(__hold.release()->__as_link()); -#endif -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::insert(iterator, n, x) called with an iterator not" - " referring to this list"); - iterator __r(__p.__ptr_, this); -#else - iterator __r(__p.__ptr_); -#endif - if (__n > 0) - { - size_type __ds = 0; - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - ++__ds; -#if _LIBCPP_DEBUG_LEVEL == 2 - __r = iterator(__hold->__as_link(), this); -#else - __r = iterator(__hold->__as_link()); -#endif - __hold.release(); - iterator __e = __r; -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) - { - __hold.reset(__node_alloc_traits::allocate(__na, 1)); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __e.__ptr_->__next_ = __hold->__as_link(); - __hold->__prev_ = __e.__ptr_; - __hold.release(); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - while (true) - { - __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __link_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); - if (__prev == 0) - break; -#if _LIBCPP_DEBUG_LEVEL == 2 - __e = iterator(__prev, this); -#else - __e = iterator(__prev); -#endif - } - throw; - } -#endif // _LIBCPP_NO_EXCEPTIONS - __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_); - base::__sz() += __ds; - } - return __r; -} - -template <class _Tp, class _Alloc> -template <class _InpIter> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l, - typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::insert(iterator, range) called with an iterator not" - " referring to this list"); - iterator __r(__p.__ptr_, this); -#else - iterator __r(__p.__ptr_); -#endif - if (__f != __l) - { - size_type __ds = 0; - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); - ++__ds; -#if _LIBCPP_DEBUG_LEVEL == 2 - __r = iterator(__hold.get()->__as_link(), this); -#else - __r = iterator(__hold.get()->__as_link()); -#endif - __hold.release(); - iterator __e = __r; -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds) - { - __hold.reset(__node_alloc_traits::allocate(__na, 1)); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); - __e.__ptr_->__next_ = __hold.get()->__as_link(); - __hold->__prev_ = __e.__ptr_; - __hold.release(); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - while (true) - { - __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __link_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); - if (__prev == 0) - break; -#if _LIBCPP_DEBUG_LEVEL == 2 - __e = iterator(__prev, this); -#else - __e = iterator(__prev); -#endif - } - throw; - } -#endif // _LIBCPP_NO_EXCEPTIONS - __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_); - base::__sz() += __ds; - } - return __r; -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::push_front(const value_type& __x) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_pointer __nl = __hold->__as_link(); - __link_nodes_at_front(__nl, __nl); - ++base::__sz(); - __hold.release(); -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::push_back(const value_type& __x) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); - ++base::__sz(); - __hold.release(); -} - -#ifndef _LIBCPP_CXX03_LANG - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::push_front(value_type&& __x) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); - __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); - ++base::__sz(); - __hold.release(); -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::push_back(value_type&& __x) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); - __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); - ++base::__sz(); - __hold.release(); -} - -template <class _Tp, class _Alloc> -template <class... _Args> -#if _LIBCPP_STD_VER > 14 -typename list<_Tp, _Alloc>::reference -#else -void -#endif -list<_Tp, _Alloc>::emplace_front(_Args&&... __args) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); - __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); - ++base::__sz(); -#if _LIBCPP_STD_VER > 14 - return __hold.release()->__value_; -#else - __hold.release(); -#endif -} - -template <class _Tp, class _Alloc> -template <class... _Args> -#if _LIBCPP_STD_VER > 14 -typename list<_Tp, _Alloc>::reference -#else -void -#endif -list<_Tp, _Alloc>::emplace_back(_Args&&... __args) -{ - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); - __link_pointer __nl = __hold->__as_link(); - __link_nodes_at_back(__nl, __nl); - ++base::__sz(); -#if _LIBCPP_STD_VER > 14 - return __hold.release()->__value_; -#else - __hold.release(); -#endif -} - -template <class _Tp, class _Alloc> -template <class... _Args> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::emplace(iterator, args...) called with an iterator not" - " referring to this list"); -#endif - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); - __link_pointer __nl = __hold.get()->__as_link(); - __link_nodes(__p.__ptr_, __nl, __nl); - ++base::__sz(); - __hold.release(); -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__nl, this); -#else - return iterator(__nl); -#endif -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::insert(iterator, x) called with an iterator not" - " referring to this list"); -#endif - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); - __link_pointer __nl = __hold->__as_link(); - __link_nodes(__p.__ptr_, __nl, __nl); - ++base::__sz(); - __hold.release(); -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__nl, this); -#else - return iterator(__nl); -#endif -} - -#endif // _LIBCPP_CXX03_LANG - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::pop_front() -{ - _LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list"); - __node_allocator& __na = base::__node_alloc(); - __link_pointer __n = base::__end_.__next_; - base::__unlink_nodes(__n, __n); - --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - __c_node* __c = __get_db()->__find_c_and_lock(this); - for (__i_node** __p = __c->end_; __p != __c->beg_; ) - { - --__p; - iterator* __i = static_cast<iterator*>((*__p)->__i_); - if (__i->__ptr_ == __n) - { - (*__p)->__c_ = nullptr; - if (--__c->end_ != __p) - _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); - } - } - __get_db()->unlock(); -#endif - __node_pointer __np = __n->__as_node(); - __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); - __node_alloc_traits::deallocate(__na, __np, 1); -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::pop_back() -{ - _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list"); - __node_allocator& __na = base::__node_alloc(); - __link_pointer __n = base::__end_.__prev_; - base::__unlink_nodes(__n, __n); - --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - __c_node* __c = __get_db()->__find_c_and_lock(this); - for (__i_node** __p = __c->end_; __p != __c->beg_; ) - { - --__p; - iterator* __i = static_cast<iterator*>((*__p)->__i_); - if (__i->__ptr_ == __n) - { - (*__p)->__c_ = nullptr; - if (--__c->end_ != __p) - _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); - } - } - __get_db()->unlock(); -#endif - __node_pointer __np = __n->__as_node(); - __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); - __node_alloc_traits::deallocate(__na, __np, 1); -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::erase(const_iterator __p) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::erase(iterator) called with an iterator not" - " referring to this list"); -#endif - _LIBCPP_ASSERT(__p != end(), - "list::erase(iterator) called with a non-dereferenceable iterator"); - __node_allocator& __na = base::__node_alloc(); - __link_pointer __n = __p.__ptr_; - __link_pointer __r = __n->__next_; - base::__unlink_nodes(__n, __n); - --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - __c_node* __c = __get_db()->__find_c_and_lock(this); - for (__i_node** __ip = __c->end_; __ip != __c->beg_; ) - { - --__ip; - iterator* __i = static_cast<iterator*>((*__ip)->__i_); - if (__i->__ptr_ == __n) - { - (*__ip)->__c_ = nullptr; - if (--__c->end_ != __ip) - _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*)); - } - } - __get_db()->unlock(); -#endif - __node_pointer __np = __n->__as_node(); - __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); - __node_alloc_traits::deallocate(__na, __np, 1); -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__r, this); -#else - return iterator(__r); -#endif -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this, - "list::erase(iterator, iterator) called with an iterator not" - " referring to this list"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == this, - "list::erase(iterator, iterator) called with an iterator not" - " referring to this list"); -#endif - if (__f != __l) - { - __node_allocator& __na = base::__node_alloc(); - base::__unlink_nodes(__f.__ptr_, __l.__ptr_->__prev_); - while (__f != __l) - { - __link_pointer __n = __f.__ptr_; - ++__f; - --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - __c_node* __c = __get_db()->__find_c_and_lock(this); - for (__i_node** __p = __c->end_; __p != __c->beg_; ) - { - --__p; - iterator* __i = static_cast<iterator*>((*__p)->__i_); - if (__i->__ptr_ == __n) - { - (*__p)->__c_ = nullptr; - if (--__c->end_ != __p) - _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); - } - } - __get_db()->unlock(); -#endif - __node_pointer __np = __n->__as_node(); - __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); - __node_alloc_traits::deallocate(__na, __np, 1); - } - } -#if _LIBCPP_DEBUG_LEVEL == 2 - return iterator(__l.__ptr_, this); -#else - return iterator(__l.__ptr_); -#endif -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::resize(size_type __n) -{ - if (__n < base::__sz()) - erase(__iterator(__n), end()); - else if (__n > base::__sz()) - { - __n -= base::__sz(); - size_type __ds = 0; - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); - ++__ds; -#if _LIBCPP_DEBUG_LEVEL == 2 - iterator __r = iterator(__hold.release()->__as_link(), this); -#else - iterator __r = iterator(__hold.release()->__as_link()); -#endif - iterator __e = __r; -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) - { - __hold.reset(__node_alloc_traits::allocate(__na, 1)); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); - __e.__ptr_->__next_ = __hold.get()->__as_link(); - __hold->__prev_ = __e.__ptr_; - __hold.release(); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - while (true) - { - __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __link_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); - if (__prev == 0) - break; -#if _LIBCPP_DEBUG_LEVEL == 2 - __e = iterator(__prev, this); -#else - __e = iterator(__prev); -#endif - } - throw; - } -#endif // _LIBCPP_NO_EXCEPTIONS - __link_nodes_at_back(__r.__ptr_, __e.__ptr_); - base::__sz() += __ds; - } -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x) -{ - if (__n < base::__sz()) - erase(__iterator(__n), end()); - else if (__n > base::__sz()) - { - __n -= base::__sz(); - size_type __ds = 0; - __node_allocator& __na = base::__node_alloc(); - __hold_pointer __hold = __allocate_node(__na); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - ++__ds; - __link_pointer __nl = __hold.release()->__as_link(); -#if _LIBCPP_DEBUG_LEVEL == 2 - iterator __r = iterator(__nl, this); -#else - iterator __r = iterator(__nl); -#endif - iterator __e = __r; -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) - { - __hold.reset(__node_alloc_traits::allocate(__na, 1)); - __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __e.__ptr_->__next_ = __hold.get()->__as_link(); - __hold->__prev_ = __e.__ptr_; - __hold.release(); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - while (true) - { - __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __link_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); - if (__prev == 0) - break; -#if _LIBCPP_DEBUG_LEVEL == 2 - __e = iterator(__prev, this); -#else - __e = iterator(__prev); -#endif - } - throw; - } -#endif // _LIBCPP_NO_EXCEPTIONS - __link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_); - base::__sz() += __ds; - } -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::splice(const_iterator __p, list& __c) -{ - _LIBCPP_ASSERT(this != &__c, - "list::splice(iterator, list) called with this == &list"); -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::splice(iterator, list) called with an iterator not" - " referring to this list"); -#endif - if (!__c.empty()) - { - __link_pointer __f = __c.__end_.__next_; - __link_pointer __l = __c.__end_.__prev_; - base::__unlink_nodes(__f, __l); - __link_nodes(__p.__ptr_, __f, __l); - base::__sz() += __c.__sz(); - __c.__sz() = 0; -#if _LIBCPP_DEBUG_LEVEL == 2 - if (&__c != this) { - __libcpp_db* __db = __get_db(); - __c_node* __cn1 = __db->__find_c_and_lock(this); - __c_node* __cn2 = __db->__find_c(&__c); - for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) - { - --__ip; - iterator* __i = static_cast<iterator*>((*__ip)->__i_); - if (__i->__ptr_ != __c.__end_as_link()) - { - __cn1->__add(*__ip); - (*__ip)->__c_ = __cn1; - if (--__cn2->end_ != __ip) - memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); - } - } - __db->unlock(); - } -#endif - } -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::splice(iterator, list, iterator) called with the first iterator" - " not referring to this list"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c, - "list::splice(iterator, list, iterator) called with the second iterator" - " not referring to the list argument"); - _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i), - "list::splice(iterator, list, iterator) called with the second iterator" - " not dereferenceable"); -#endif - if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_) - { - __link_pointer __f = __i.__ptr_; - base::__unlink_nodes(__f, __f); - __link_nodes(__p.__ptr_, __f, __f); - --__c.__sz(); - ++base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 - if (&__c != this) { - __libcpp_db* __db = __get_db(); - __c_node* __cn1 = __db->__find_c_and_lock(this); - __c_node* __cn2 = __db->__find_c(&__c); - for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) - { - --__ip; - iterator* __j = static_cast<iterator*>((*__ip)->__i_); - if (__j->__ptr_ == __f) - { - __cn1->__add(*__ip); - (*__ip)->__c_ = __cn1; - if (--__cn2->end_ != __ip) - _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); - } - } - __db->unlock(); - } -#endif - } -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l) -{ -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "list::splice(iterator, list, iterator, iterator) called with first iterator not" - " referring to this list"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c, - "list::splice(iterator, list, iterator, iterator) called with second iterator not" - " referring to the list argument"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == &__c, - "list::splice(iterator, list, iterator, iterator) called with third iterator not" - " referring to the list argument"); - if (this == &__c) - { - for (const_iterator __i = __f; __i != __l; ++__i) - _LIBCPP_ASSERT(__i != __p, - "list::splice(iterator, list, iterator, iterator)" - " called with the first iterator within the range" - " of the second and third iterators"); - } -#endif - if (__f != __l) - { - __link_pointer __first = __f.__ptr_; - --__l; - __link_pointer __last = __l.__ptr_; - if (this != &__c) - { - size_type __s = _VSTD::distance(__f, __l) + 1; - __c.__sz() -= __s; - base::__sz() += __s; - } - base::__unlink_nodes(__first, __last); - __link_nodes(__p.__ptr_, __first, __last); -#if _LIBCPP_DEBUG_LEVEL == 2 - if (&__c != this) { - __libcpp_db* __db = __get_db(); - __c_node* __cn1 = __db->__find_c_and_lock(this); - __c_node* __cn2 = __db->__find_c(&__c); - for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) - { - --__ip; - iterator* __j = static_cast<iterator*>((*__ip)->__i_); - for (__link_pointer __k = __f.__ptr_; - __k != __l.__ptr_; __k = __k->__next_) - { - if (__j->__ptr_ == __k) - { - __cn1->__add(*__ip); - (*__ip)->__c_ = __cn1; - if (--__cn2->end_ != __ip) - _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); - } - } - } - __db->unlock(); - } -#endif - } -} - -template <class _Tp, class _Alloc> -typename list<_Tp, _Alloc>::__remove_return_type -list<_Tp, _Alloc>::remove(const value_type& __x) -{ - list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing - for (const_iterator __i = begin(), __e = end(); __i != __e;) - { - if (*__i == __x) - { - const_iterator __j = _VSTD::next(__i); - for (; __j != __e && *__j == __x; ++__j) - ; - __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); - __i = __j; - if (__i != __e) - ++__i; - } - else - ++__i; - } - - return (__remove_return_type) __deleted_nodes.size(); -} - -template <class _Tp, class _Alloc> -template <class _Pred> -typename list<_Tp, _Alloc>::__remove_return_type -list<_Tp, _Alloc>::remove_if(_Pred __pred) -{ - list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing - for (iterator __i = begin(), __e = end(); __i != __e;) - { - if (__pred(*__i)) - { - iterator __j = _VSTD::next(__i); - for (; __j != __e && __pred(*__j); ++__j) - ; - __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); - __i = __j; - if (__i != __e) - ++__i; - } - else - ++__i; - } - - return (__remove_return_type) __deleted_nodes.size(); -} - -template <class _Tp, class _Alloc> -template <class _BinaryPred> -typename list<_Tp, _Alloc>::__remove_return_type -list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred) -{ - list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing - for (iterator __i = begin(), __e = end(); __i != __e;) - { - iterator __j = _VSTD::next(__i); - for (; __j != __e && __binary_pred(*__i, *__j); ++__j) - ; - if (++__i != __j) { - __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); - __i = __j; - } - } - - return (__remove_return_type) __deleted_nodes.size(); -} - -template <class _Tp, class _Alloc> -inline -void -list<_Tp, _Alloc>::merge(list& __c) -{ - merge(__c, __less<value_type>()); -} - -template <class _Tp, class _Alloc> -template <class _Comp> -void -list<_Tp, _Alloc>::merge(list& __c, _Comp __comp) -{ - if (this != _VSTD::addressof(__c)) - { - iterator __f1 = begin(); - iterator __e1 = end(); - iterator __f2 = __c.begin(); - iterator __e2 = __c.end(); - while (__f1 != __e1 && __f2 != __e2) - { - if (__comp(*__f2, *__f1)) - { - size_type __ds = 1; - iterator __m2 = _VSTD::next(__f2); - for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, (void) ++__ds) - ; - base::__sz() += __ds; - __c.__sz() -= __ds; - __link_pointer __f = __f2.__ptr_; - __link_pointer __l = __m2.__ptr_->__prev_; - __f2 = __m2; - base::__unlink_nodes(__f, __l); - __m2 = _VSTD::next(__f1); - __link_nodes(__f1.__ptr_, __f, __l); - __f1 = __m2; - } - else - ++__f1; - } - splice(__e1, __c); -#if _LIBCPP_DEBUG_LEVEL == 2 - __libcpp_db* __db = __get_db(); - __c_node* __cn1 = __db->__find_c_and_lock(this); - __c_node* __cn2 = __db->__find_c(&__c); - for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;) - { - --__p; - iterator* __i = static_cast<iterator*>((*__p)->__i_); - if (__i->__ptr_ != __c.__end_as_link()) - { - __cn1->__add(*__p); - (*__p)->__c_ = __cn1; - if (--__cn2->end_ != __p) - _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); - } - } - __db->unlock(); -#endif - } -} - -template <class _Tp, class _Alloc> -inline -void -list<_Tp, _Alloc>::sort() -{ - sort(__less<value_type>()); -} - -template <class _Tp, class _Alloc> -template <class _Comp> -inline -void -list<_Tp, _Alloc>::sort(_Comp __comp) -{ - __sort(begin(), end(), base::__sz(), __comp); -} - -template <class _Tp, class _Alloc> -template <class _Comp> -typename list<_Tp, _Alloc>::iterator -list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp) -{ - switch (__n) - { - case 0: - case 1: - return __f1; - case 2: - if (__comp(*--__e2, *__f1)) - { - __link_pointer __f = __e2.__ptr_; - base::__unlink_nodes(__f, __f); - __link_nodes(__f1.__ptr_, __f, __f); - return __e2; - } - return __f1; - } - size_type __n2 = __n / 2; - iterator __e1 = _VSTD::next(__f1, __n2); - iterator __r = __f1 = __sort(__f1, __e1, __n2, __comp); - iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp); - if (__comp(*__f2, *__f1)) - { - iterator __m2 = _VSTD::next(__f2); - for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2) - ; - __link_pointer __f = __f2.__ptr_; - __link_pointer __l = __m2.__ptr_->__prev_; - __r = __f2; - __e1 = __f2 = __m2; - base::__unlink_nodes(__f, __l); - __m2 = _VSTD::next(__f1); - __link_nodes(__f1.__ptr_, __f, __l); - __f1 = __m2; - } - else - ++__f1; - while (__f1 != __e1 && __f2 != __e2) - { - if (__comp(*__f2, *__f1)) - { - iterator __m2 = _VSTD::next(__f2); - for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2) - ; - __link_pointer __f = __f2.__ptr_; - __link_pointer __l = __m2.__ptr_->__prev_; - if (__e1 == __f2) - __e1 = __m2; - __f2 = __m2; - base::__unlink_nodes(__f, __l); - __m2 = _VSTD::next(__f1); - __link_nodes(__f1.__ptr_, __f, __l); - __f1 = __m2; - } - else - ++__f1; - } - return __r; -} - -template <class _Tp, class _Alloc> -void -list<_Tp, _Alloc>::reverse() _NOEXCEPT -{ - if (base::__sz() > 1) - { - iterator __e = end(); - for (iterator __i = begin(); __i.__ptr_ != __e.__ptr_;) - { - _VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_); - __i.__ptr_ = __i.__ptr_->__prev_; - } - _VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_); - } -} - -template <class _Tp, class _Alloc> -bool -list<_Tp, _Alloc>::__invariants() const -{ - return size() == _VSTD::distance(begin(), end()); -} - -#if _LIBCPP_DEBUG_LEVEL == 2 - -template <class _Tp, class _Alloc> -bool -list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const -{ - return __i->__ptr_ != this->__end_as_link(); -} - -template <class _Tp, class _Alloc> -bool -list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const -{ - return !empty() && __i->__ptr_ != base::__end_.__next_; -} - -template <class _Tp, class _Alloc> -bool -list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const -{ - return false; -} - -template <class _Tp, class _Alloc> -bool -list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const -{ - return false; -} - -#endif // _LIBCPP_DEBUG_LEVEL == 2 - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return !(__x == __y); -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return __y < __x; -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return !(__x < __y); -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) -{ - return !(__y < __x); -} - -template <class _Tp, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) - _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) -{ - __x.swap(__y); -} - -#if _LIBCPP_STD_VER > 17 -template <class _Tp, class _Allocator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type -erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) { - return __c.remove_if(__pred); -} - -template <class _Tp, class _Allocator, class _Up> -inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type -erase(list<_Tp, _Allocator>& __c, const _Up& __v) { - return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; }); -} -#endif - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP_LIST - - -====================File: include/version==================== -// -*- C++ -*- -//===--------------------------- version ----------------------------------===// -// -// 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_VERSIONH -#define _LIBCPP_VERSIONH - -/* - version synopsis - -Macro name Value Headers -__cpp_lib_addressof_constexpr 201603L <memory> -__cpp_lib_allocator_traits_is_always_equal 201411L <deque> <forward_list> <list> - <map> <memory> <scoped_allocator> - <set> <string> <unordered_map> - <unordered_set> <vector> -__cpp_lib_any 201606L <any> -__cpp_lib_apply 201603L <tuple> -__cpp_lib_array_constexpr 201811L <array> <iterator> - 201603L // C++17 -__cpp_lib_as_const 201510L <utility> -__cpp_lib_assume_aligned 201811L <memory> -__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_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_front 201907L <functional> -__cpp_lib_bit_cast 201806L <bit> -__cpp_lib_bitops 201907L <bit> -__cpp_lib_bool_constant 201505L <type_traits> -__cpp_lib_bounded_array_traits 201902L <type_traits> -__cpp_lib_boyer_moore_searcher 201603L <functional> -__cpp_lib_byte 201603L <cstddef> -__cpp_lib_char8_t 201907L <atomic> <filesystem> <istream> - <limits> <locale> <ostream> - <string> <string_view> -__cpp_lib_chrono 201611L <chrono> -__cpp_lib_chrono_udls 201304L <chrono> -__cpp_lib_clamp 201603L <algorithm> -__cpp_lib_complex_udls 201309L <complex> -__cpp_lib_concepts 202002L <concepts> -__cpp_lib_constexpr_algorithms 201806L <algorithm> -__cpp_lib_constexpr_complex 201711L <complex> -__cpp_lib_constexpr_dynamic_alloc 201907L <memory> -__cpp_lib_constexpr_functional 201907L <functional> -__cpp_lib_constexpr_iterator 201811L <iterator> -__cpp_lib_constexpr_memory 201811L <memory> -__cpp_lib_constexpr_numeric 201911L <numeric> -__cpp_lib_constexpr_string 201811L <string> -__cpp_lib_constexpr_string_view 201811L <string_view> -__cpp_lib_constexpr_tuple 201811L <tuple> -__cpp_lib_constexpr_utility 201811L <utility> -__cpp_lib_constexpr_vector 201907L <vector> -__cpp_lib_coroutine 201902L <coroutine> -__cpp_lib_destroying_delete 201806L <new> -__cpp_lib_enable_shared_from_this 201603L <memory> -__cpp_lib_endian 201907L <bit> -__cpp_lib_erase_if 202002L <deque> <forward_list> <list> - <map> <set> <string> - <unordered_map> <unordered_set> <vector> -__cpp_lib_exchange_function 201304L <utility> -__cpp_lib_execution 201902L <execution> - 201603L // C++17 -__cpp_lib_filesystem 201703L <filesystem> -__cpp_lib_format 201907L <format> -__cpp_lib_gcd_lcm 201606L <numeric> -__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> -__cpp_lib_has_unique_object_representations 201606L <type_traits> -__cpp_lib_hypot 201603L <cmath> -__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector> -__cpp_lib_int_pow2 202002L <bit> -__cpp_lib_integer_comparison_functions 202002L <utility> -__cpp_lib_integer_sequence 201304L <utility> -__cpp_lib_integral_constant_callable 201304L <type_traits> -__cpp_lib_interpolate 201902L <cmath> <numeric> -__cpp_lib_invoke 201411L <functional> -__cpp_lib_is_aggregate 201703L <type_traits> -__cpp_lib_is_constant_evaluated 201811L <type_traits> -__cpp_lib_is_final 201402L <type_traits> -__cpp_lib_is_invocable 201703L <type_traits> -__cpp_lib_is_layout_compatible 201907L <type_traits> -__cpp_lib_is_nothrow_convertible 201806L <type_traits> -__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_jthread 201911L <stop_token> <thread> -__cpp_lib_latch 201907L <latch> -__cpp_lib_launder 201606L <new> -__cpp_lib_list_remove_return_type 201806L <forward_list> <list> -__cpp_lib_logical_traits 201510L <type_traits> -__cpp_lib_make_from_tuple 201606L <tuple> -__cpp_lib_make_reverse_iterator 201402L <iterator> -__cpp_lib_make_unique 201304L <memory> -__cpp_lib_map_try_emplace 201411L <map> -__cpp_lib_math_constants 201907L <numbers> -__cpp_lib_math_special_functions 201603L <cmath> -__cpp_lib_memory_resource 201603L <memory_resource> -__cpp_lib_node_extract 201606L <map> <set> <unordered_map> - <unordered_set> -__cpp_lib_nonmember_container_access 201411L <array> <deque> <forward_list> - <iterator> <list> <map> - <regex> <set> <string> - <unordered_map> <unordered_set> <vector> -__cpp_lib_not_fn 201603L <functional> -__cpp_lib_null_iterators 201304L <iterator> -__cpp_lib_optional 201606L <optional> -__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric> -__cpp_lib_polymorphic_allocator 201902L <memory> -__cpp_lib_quoted_string_io 201304L <iomanip> -__cpp_lib_ranges 201811L <algorithm> <functional> <iterator> - <memory> <ranges> -__cpp_lib_raw_memory_algorithms 201606L <memory> -__cpp_lib_remove_cvref 201711L <type_traits> -__cpp_lib_result_of_sfinae 201210L <functional> <type_traits> -__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm> -__cpp_lib_sample 201603L <algorithm> -__cpp_lib_scoped_lock 201703L <mutex> -__cpp_lib_semaphore 201907L <semaphore> -__cpp_lib_shared_mutex 201505L <shared_mutex> -__cpp_lib_shared_ptr_arrays 201611L <memory> -__cpp_lib_shared_ptr_weak_type 201606L <memory> -__cpp_lib_shared_timed_mutex 201402L <shared_mutex> -__cpp_lib_shift 201806L <algorithm> -__cpp_lib_smart_ptr_for_overwrite 202002L <memory> -__cpp_lib_source_location 201907L <source_location> -__cpp_lib_span 202002L <span> -__cpp_lib_ssize 201902L <iterator> -__cpp_lib_stacktrace 202011L <stacktrace> -__cpp_lib_starts_ends_with 201711L <string> <string_view> -__cpp_lib_stdatomic_h 202011L <stdatomic.h> -__cpp_lib_string_contains 202011L <string> <string_view> -__cpp_lib_string_udls 201304L <string> -__cpp_lib_string_view 201803L <string> <string_view> - 201606L // C++17 -__cpp_lib_syncbuf 201803L <syncstream> -__cpp_lib_three_way_comparison 201907L <compare> -__cpp_lib_to_address 201711L <memory> -__cpp_lib_to_array 201907L <array> -__cpp_lib_to_chars 201611L <utility> -__cpp_lib_to_underlying 202102L <utility> -__cpp_lib_transformation_trait_aliases 201304L <type_traits> -__cpp_lib_transparent_operators 201510L <functional> <memory> - 201210L // C++14 -__cpp_lib_tuple_element_t 201402L <tuple> -__cpp_lib_tuples_by_type 201304L <tuple> <utility> -__cpp_lib_type_trait_variable_templates 201510L <type_traits> -__cpp_lib_uncaught_exceptions 201411L <exception> -__cpp_lib_unordered_map_try_emplace 201411L <unordered_map> -__cpp_lib_unwrap_ref 201811L <functional> -__cpp_lib_variant 202102L <variant> -__cpp_lib_void_t 201411L <type_traits> - -*/ - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -// clang-format off - -#if _LIBCPP_STD_VER > 11 -# define __cpp_lib_chrono_udls 201304L -# define __cpp_lib_complex_udls 201309L -# define __cpp_lib_exchange_function 201304L -# define __cpp_lib_generic_associative_lookup 201304L -# define __cpp_lib_integer_sequence 201304L -# define __cpp_lib_integral_constant_callable 201304L -# define __cpp_lib_is_final 201402L -# define __cpp_lib_is_null_pointer 201309L -# define __cpp_lib_make_reverse_iterator 201402L -# define __cpp_lib_make_unique 201304L -# define __cpp_lib_null_iterators 201304L -# define __cpp_lib_quoted_string_io 201304L -# define __cpp_lib_result_of_sfinae 201210L -# define __cpp_lib_robust_nonmodifying_seq_ops 201304L -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex) -# define __cpp_lib_shared_timed_mutex 201402L -# endif -# define __cpp_lib_string_udls 201304L -# define __cpp_lib_transformation_trait_aliases 201304L -# define __cpp_lib_transparent_operators 201210L -# define __cpp_lib_tuple_element_t 201402L -# define __cpp_lib_tuples_by_type 201304L -#endif - -#if _LIBCPP_STD_VER > 14 -# define __cpp_lib_addressof_constexpr 201603L -# define __cpp_lib_allocator_traits_is_always_equal 201411L -# define __cpp_lib_any 201606L -# define __cpp_lib_apply 201603L -# if defined(_MSC_VER) && _MSC_VER >= 1926 -# define __cpp_lib_array_constexpr 201803L -# else -# define __cpp_lib_array_constexpr 201603L -# endif -# define __cpp_lib_as_const 201510L -# if !defined(_LIBCPP_HAS_NO_THREADS) -# define __cpp_lib_atomic_is_always_lock_free 201603L -# endif -# define __cpp_lib_bool_constant 201505L -// # define __cpp_lib_boyer_moore_searcher 201603L -# define __cpp_lib_byte 201603L -# define __cpp_lib_chrono 201611L -# define __cpp_lib_clamp 201603L -# define __cpp_lib_enable_shared_from_this 201603L -// # define __cpp_lib_execution 201603L -# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem) -# define __cpp_lib_filesystem 201703L -# endif -# define __cpp_lib_gcd_lcm 201606L -// # define __cpp_lib_hardware_interference_size 201703L -# define __cpp_lib_has_unique_object_representations 201606L -# define __cpp_lib_hypot 201603L -# define __cpp_lib_incomplete_container_elements 201505L -# define __cpp_lib_invoke 201411L -# define __cpp_lib_is_aggregate 201703L -# define __cpp_lib_is_invocable 201703L -# define __cpp_lib_is_swappable 201603L -# define __cpp_lib_launder 201606L -# define __cpp_lib_logical_traits 201510L -# define __cpp_lib_make_from_tuple 201606L -# define __cpp_lib_map_try_emplace 201411L -// # define __cpp_lib_math_special_functions 201603L -// # define __cpp_lib_memory_resource 201603L -# define __cpp_lib_node_extract 201606L -# define __cpp_lib_nonmember_container_access 201411L -# define __cpp_lib_not_fn 201603L -# define __cpp_lib_optional 201606L -// # define __cpp_lib_parallel_algorithm 201603L -# define __cpp_lib_raw_memory_algorithms 201606L -# define __cpp_lib_sample 201603L -# define __cpp_lib_scoped_lock 201703L -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex) -# define __cpp_lib_shared_mutex 201505L -# endif -# define __cpp_lib_shared_ptr_arrays 201611L -# define __cpp_lib_shared_ptr_weak_type 201606L -# if defined(_MSC_VER) && _MSC_VER >= 1926 -# define __cpp_lib_string_view 201803L -# else -# define __cpp_lib_string_view 201606L -# endif -// # define __cpp_lib_to_chars 201611L -# undef __cpp_lib_transparent_operators -# define __cpp_lib_transparent_operators 201510L -# define __cpp_lib_type_trait_variable_templates 201510L -# define __cpp_lib_uncaught_exceptions 201411L -# define __cpp_lib_unordered_map_try_emplace 201411L -# define __cpp_lib_variant 202102L -# define __cpp_lib_void_t 201411L -#endif - -#if _LIBCPP_STD_VER > 17 -# undef __cpp_lib_array_constexpr -# define __cpp_lib_array_constexpr 201811L -// # define __cpp_lib_assume_aligned 201811L -# if !defined(_LIBCPP_HAS_NO_THREADS) -# define __cpp_lib_atomic_flag_test 201907L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) -// # define __cpp_lib_atomic_float 201711L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) -# define __cpp_lib_atomic_lock_free_type_aliases 201907L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) -// # define __cpp_lib_atomic_ref 201806L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) -// # define __cpp_lib_atomic_shared_ptr 201711L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) -# define __cpp_lib_atomic_value_initialization 201911L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait) -# define __cpp_lib_atomic_wait 201907L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier) -# define __cpp_lib_barrier 201907L -# endif -# define __cpp_lib_bind_front 201907L -# define __cpp_lib_bit_cast 201806L -// # define __cpp_lib_bitops 201907L -# define __cpp_lib_bounded_array_traits 201902L -# if !defined(_LIBCPP_HAS_NO_CHAR8_T) -# define __cpp_lib_char8_t 201907L -# endif -# define __cpp_lib_concepts 202002L -# define __cpp_lib_constexpr_algorithms 201806L -// # define __cpp_lib_constexpr_complex 201711L -# define __cpp_lib_constexpr_dynamic_alloc 201907L -# define __cpp_lib_constexpr_functional 201907L -# define __cpp_lib_constexpr_iterator 201811L -# define __cpp_lib_constexpr_memory 201811L -# define __cpp_lib_constexpr_numeric 201911L -# define __cpp_lib_constexpr_string 201811L -# define __cpp_lib_constexpr_string_view 201811L -# define __cpp_lib_constexpr_tuple 201811L -# define __cpp_lib_constexpr_utility 201811L -// # define __cpp_lib_constexpr_vector 201907L -// # define __cpp_lib_coroutine 201902L -# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L -# define __cpp_lib_destroying_delete 201806L -# endif -# define __cpp_lib_endian 201907L -# define __cpp_lib_erase_if 202002L -# undef __cpp_lib_execution -// # define __cpp_lib_execution 201902L -# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) -// # define __cpp_lib_format 201907L -# endif -# define __cpp_lib_generic_unordered_lookup 201811L -# define __cpp_lib_int_pow2 202002L -# if !defined(_LIBCPP_HAS_NO_CONCEPTS) -# define __cpp_lib_integer_comparison_functions 202002L -# endif -# define __cpp_lib_interpolate 201902L -# define __cpp_lib_is_constant_evaluated 201811L -// # define __cpp_lib_is_layout_compatible 201907L -# define __cpp_lib_is_nothrow_convertible 201806L -// # define __cpp_lib_is_pointer_interconvertible 201907L -# if !defined(_LIBCPP_HAS_NO_THREADS) -// # define __cpp_lib_jthread 201911L -# endif -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch) -# define __cpp_lib_latch 201907L -# endif -# define __cpp_lib_list_remove_return_type 201806L -# if !defined(_LIBCPP_HAS_NO_CONCEPTS) -# define __cpp_lib_math_constants 201907L -# endif -// # define __cpp_lib_polymorphic_allocator 201902L -// # define __cpp_lib_ranges 201811L -# define __cpp_lib_remove_cvref 201711L -# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore) -# define __cpp_lib_semaphore 201907L -# endif -# define __cpp_lib_shift 201806L -// # define __cpp_lib_smart_ptr_for_overwrite 202002L -// # define __cpp_lib_source_location 201907L -# define __cpp_lib_span 202002L -# define __cpp_lib_ssize 201902L -# define __cpp_lib_starts_ends_with 201711L -# undef __cpp_lib_string_view -# define __cpp_lib_string_view 201803L -// # define __cpp_lib_syncbuf 201803L -// # define __cpp_lib_three_way_comparison 201907L -# define __cpp_lib_to_address 201711L -# define __cpp_lib_to_array 201907L -# define __cpp_lib_unwrap_ref 201811L -#endif - -#if _LIBCPP_STD_VER > 20 -# define __cpp_lib_is_scoped_enum 202011L -// # define __cpp_lib_stacktrace 202011L -// # define __cpp_lib_stdatomic_h 202011L -# define __cpp_lib_string_contains 202011L -# define __cpp_lib_to_underlying 202102L -#endif - -// clang-format on - -#endif // _LIBCPP_VERSIONH - - +#endif // _LIBCPP_EXCEPTION + + +====================File: include/experimental/list==================== +// -*- C++ -*- +//===--------------------------- list ------------------------------------===// +// +// 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_EXPERIMENTAL_LIST +#define _LIBCPP_EXPERIMENTAL_LIST +/* + experimental/list synopsis + +// C++1z +namespace std { +namespace experimental { +inline namespace fundamentals_v1 { +namespace pmr { + + template <class T> + using list = std::list<T,polymorphic_allocator<T>>; + +} // namespace pmr +} // namespace fundamentals_v1 +} // namespace experimental +} // namespace std + + */ + +#include <experimental/__config> +#include <list> +#include <experimental/memory_resource> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR + +template <class _ValueT> +using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>; + +_LIBCPP_END_NAMESPACE_LFTS_PMR + +#endif /* _LIBCPP_EXPERIMENTAL_LIST */ + + +====================File: include/format==================== +// -*- C++ -*- +//===--------------------------- format -----------------------------------===// +// +// 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_FORMAT +#define _LIBCPP_FORMAT + +/* + +namespace std { + // [format.context], class template basic_format_context + template<class Out, class charT> + class basic_format_context { + basic_format_args<basic_format_context> args_; // exposition only + Out out_; // exposition only + + public: + using iterator = Out; + using char_type = charT; + template<class T> using formatter_type = formatter<T, charT>; + + basic_format_arg<basic_format_context> arg(size_t id) const; + std::locale locale(); + + iterator out(); + void advance_to(iterator it); + }; + using format_context = basic_format_context<unspecified, char>; + using wformat_context = basic_format_context<unspecified, wchar_t>; + + // [format.args], class template basic_format_args + template<class Context> + class basic_format_args { + size_t size_; // exposition only + const basic_format_arg<Context>* data_; // exposition only + + public: + basic_format_args() noexcept; + + template<class... Args> + basic_format_args(const format-arg-store<Context, Args...>& store) noexcept; + + basic_format_arg<Context> get(size_t i) const noexcept; + }; + using format_args = basic_format_args<format_context>; + using wformat_args = basic_format_args<wformat_context>; + + + template<class Out, class charT> + using format_args_t = basic_format_args<basic_format_context<Out, charT>>; + + // [format.functions], formatting functions + template<class... Args> + string format(string_view fmt, const Args&... args); + template<class... Args> + wstring format(wstring_view fmt, const Args&... args); + template<class... Args> + string format(const locale& loc, string_view fmt, const Args&... args); + template<class... Args> + wstring format(const locale& loc, wstring_view fmt, const Args&... args); + + string vformat(string_view fmt, format_args args); + wstring vformat(wstring_view fmt, wformat_args args); + string vformat(const locale& loc, string_view fmt, format_args args); + wstring vformat(const locale& loc, wstring_view fmt, wformat_args args); + + template<class Out, class... Args> + Out format_to(Out out, string_view fmt, const Args&... args); + template<class Out, class... Args> + Out format_to(Out out, wstring_view fmt, const Args&... args); + template<class Out, class... Args> + Out format_to(Out out, const locale& loc, string_view fmt, const Args&... args); + template<class Out, class... Args> + Out format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args); + + template<class Out> + Out vformat_to(Out out, string_view fmt, + format_args_t<type_identity_t<Out>, char> args); + template<class Out> + Out vformat_to(Out out, wstring_view fmt, + format_args_t<type_identity_t<Out>, wchar_t> args); + template<class Out> + Out vformat_to(Out out, const locale& loc, string_view fmt, + format_args_t<type_identity_t<Out>, char> args); + template<class Out> + Out vformat_to(Out out, const locale& loc, wstring_view fmt, + format_args_t<type_identity_t<Out>, wchar_t> args); + + template<class Out> struct format_to_n_result { + Out out; + iter_difference_t<Out> size; + }; + + template<class Out, class... Args> + format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, + string_view fmt, const Args&... args); + template<class Out, class... Args> + format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, + wstring_view fmt, const Args&... args); + template<class Out, class... Args> + format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, + const locale& loc, string_view fmt, + const Args&... args); + template<class Out, class... Args> + format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, + const locale& loc, wstring_view fmt, + const Args&... args); + + template<class... Args> + size_t formatted_size(string_view fmt, const Args&... args); + template<class... Args> + size_t formatted_size(wstring_view fmt, const Args&... args); + template<class... Args> + size_t formatted_size(const locale& loc, string_view fmt, const Args&... args); + template<class... Args> + size_t formatted_size(const locale& loc, wstring_view fmt, const Args&... args); + + // [format.formatter], formatter + template<> struct formatter<char, char>; + template<> struct formatter<char, wchar_t>; + template<> struct formatter<wchar_t, wchar_t>; + + template<> struct formatter<charT*, charT>; + template<> struct formatter<const charT*, charT>; + template<size_t N> struct formatter<const charT[N], charT>; + template<class traits, class Allocator> + struct formatter<basic_string<charT, traits, Allocator>, charT>; + template<class traits> + struct formatter<basic_string_view<charT, traits>, charT>; + + // [format.parse.ctx], class template basic_format_parse_context + template<class charT> + class basic_format_parse_context { + public: + using char_type = charT; + using const_iterator = typename basic_string_view<charT>::const_iterator; + using iterator = const_iterator; + + private: + iterator begin_; // exposition only + iterator end_; // exposition only + enum indexing { unknown, manual, automatic }; // exposition only + indexing indexing_; // exposition only + size_t next_arg_id_; // exposition only + size_t num_args_; // exposition only + + public: + constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, + size_t num_args = 0) noexcept; + basic_format_parse_context(const basic_format_parse_context&) = delete; + basic_format_parse_context& operator=(const basic_format_parse_context&) = delete; + + constexpr const_iterator begin() const noexcept; + constexpr const_iterator end() const noexcept; + constexpr void advance_to(const_iterator it); + + constexpr size_t next_arg_id(); + constexpr void check_arg_id(size_t id); + }; + using format_parse_context = basic_format_parse_context<char>; + using wformat_parse_context = basic_format_parse_context<wchar_t>; + + // [format.arguments], arguments + // [format.arg], class template basic_format_arg + template<class Context> + class basic_format_arg { + public: + class handle; + + private: + using char_type = typename Context::char_type; // exposition only + + variant<monostate, bool, char_type, + int, unsigned int, long long int, unsigned long long int, + float, double, long double, + const char_type*, basic_string_view<char_type>, + const void*, handle> value; // exposition only + + template<class T> explicit basic_format_arg(const T& v) noexcept; // exposition only + explicit basic_format_arg(float n) noexcept; // exposition only + explicit basic_format_arg(double n) noexcept; // exposition only + explicit basic_format_arg(long double n) noexcept; // exposition only + explicit basic_format_arg(const char_type* s); // exposition only + + template<class traits> + explicit basic_format_arg( + basic_string_view<char_type, traits> s) noexcept; // exposition only + + template<class traits, class Allocator> + explicit basic_format_arg( + const basic_string<char_type, traits, Allocator>& s) noexcept; // exposition only + + explicit basic_format_arg(nullptr_t) noexcept; // exposition only + + template<class T> + explicit basic_format_arg(const T* p) noexcept; // exposition only + + public: + basic_format_arg() noexcept; + + explicit operator bool() const noexcept; + }; + + template<class Visitor, class Context> + see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); + + // [format.arg.store], class template format-arg-store + template<class Context, class... Args> + struct format-arg-store { // exposition only + array<basic_format_arg<Context>, sizeof...(Args)> args; + }; + + template<class Context = format_context, class... Args> + format-arg-store<Context, Args...> + make_format_args(const Args&... args); + template<class... Args> + format-arg-store<wformat_context, Args...> + make_wformat_args(const Args&... args); + + // [format.error], class format_error + class format_error : public runtime_error { + public: + explicit format_error(const string& what_arg); + explicit format_error(const char* what_arg); + }; + + // [format.parse.ctx], class template basic_format_parse_context + template<class charT> + class basic_format_parse_context { + public: + using char_type = charT; + using const_iterator = typename basic_string_view<charT>::const_iterator; + using iterator = const_iterator; + + private: + iterator begin_; // exposition only + iterator end_; // exposition only + enum indexing { unknown, manual, automatic }; // exposition only + indexing indexing_; // exposition only + size_t next_arg_id_; // exposition only + size_t num_args_; // exposition only + + public: + constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, + size_t num_args = 0) noexcept; + basic_format_parse_context(const basic_format_parse_context&) = delete; + basic_format_parse_context& operator=(const basic_format_parse_context&) = delete; + + constexpr const_iterator begin() const noexcept; + constexpr const_iterator end() const noexcept; + constexpr void advance_to(const_iterator it); + + constexpr size_t next_arg_id(); + constexpr void check_arg_id(size_t id); + }; + using format_parse_context = basic_format_parse_context<char>; + using wformat_parse_context = basic_format_parse_context<wchar_t>; +} + +*/ + +// Make sure all feature-test macros are available. +#include <version> +// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES. +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) + +#include <__config> +#include <__debug> +#include <__format/format_arg.h> +#include <__format/format_args.h> +#include <__format/format_context.h> +#include <__format/format_error.h> +#include <__format/format_parse_context.h> +#include <__format/format_string.h> +#include <__format/parser_std_format_spec.h> +#include <__format/formatter.h> +#include <__variant/monostate.h> +#include <array> +#include <concepts> +#include <string> +#include <string_view> +#include <type_traits> + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#include <locale> +#endif + +#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 > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// TODO FMT Evaluate which templates should be external templates. This +// improves the efficiency of the header. However since the header is still +// under heavy development and not all classes are stable it makes no sense +// to do this optimization now. + +using format_args = basic_format_args<format_context>; +using wformat_args = basic_format_args<wformat_context>; + +template <class _OutIt, class _CharT> +using format_args_t = basic_format_args<basic_format_context<_OutIt, _CharT>>; + +template <class _Context, class... _Args> +struct _LIBCPP_TEMPLATE_VIS __format_arg_store { + // TODO FMT Use a built-in array. + array<basic_format_arg<_Context>, sizeof...(_Args)> __args; +}; + +template <class _Context = format_context, class... _Args> +_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> +make_format_args(const _Args&... __args) { + return {basic_format_arg<_Context>(__args)...}; +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> +make_wformat_args(const _Args&... __args) { + return _VSTD::make_format_args<wformat_context>(__args...); +} + +namespace __format { +template <class _Tp, class _CharT> +struct _LIBCPP_TEMPLATE_VIS __formatter_char { + _LIBCPP_HIDE_FROM_ABI + auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { + // TODO FMT Implement this function. + return __parse_ctx.begin(); + } + + _LIBCPP_HIDE_FROM_ABI + auto format(_Tp __c, auto& __ctx) -> decltype(__ctx.out()) { + // TODO FMT Implement the parsed formatting arguments. + auto __out_it = __ctx.out(); + *__out_it++ = _CharT(__c); + return __out_it; + } +}; + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __formatter_c_string { + _LIBCPP_HIDE_FROM_ABI + auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { + // TODO FMT Implement this function. + return __parse_ctx.begin(); + } + + _LIBCPP_HIDE_FROM_ABI + auto format(const _CharT* __str, auto& __ctx) -> decltype(__ctx.out()) { + // TODO FMT Implement the parsed formatting arguments. + auto __out_it = __ctx.out(); + while (*__str) + *__out_it++ = *__str++; + return __out_it; + } +}; + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __formatter_string { + _LIBCPP_HIDE_FROM_ABI + auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { + // TODO FMT Implement this function. + return __parse_ctx.begin(); + } + + _LIBCPP_HIDE_FROM_ABI + auto format(basic_string_view<_CharT> __str, auto& __ctx) + -> decltype(__ctx.out()) { + // TODO FMT Implement the parsed formatting arguments. + auto __out_it = __ctx.out(); + for (const auto __c : __str) + *__out_it++ = __c; + return __out_it; + } +}; + +template <class _Tp, class _CharT> +requires(is_arithmetic_v<_Tp> && + !same_as<_Tp, bool>) struct _LIBCPP_HIDE_FROM_ABI + __formatter_arithmetic { + _LIBCPP_HIDE_FROM_ABI + auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { + // TODO FMT Implement + return __parse_ctx.begin(); + } + + _LIBCPP_HIDE_FROM_ABI + auto format(_Tp __value, auto& __ctx) -> decltype(__ctx.out()) { + return __handle_format(__value, __ctx); + } + +private: + template <class _Uv> + _LIBCPP_HIDDEN static string + __convert(_Uv __value) requires(same_as<_CharT, char>) { + return _VSTD::to_string(__value); + } + template <class _Uv> + _LIBCPP_HIDDEN static wstring + __convert(_Uv __value) requires(same_as<_CharT, wchar_t>) { + return _VSTD::to_wstring(__value); + } + + template <class _Uv> + _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx) + -> decltype(__ctx.out()) +#ifndef _LIBCPP_HAS_NO_INT128 + requires(!same_as<_Uv, __int128_t> && !same_as<_Uv, __uint128_t>) +#endif + { + // TODO FMT Implement using formatting arguments + // TODO FMT Improve PoC since using std::to_string is inefficient. + // Note the code doesn't use std::string::iterator since the unit tests + // test with debug iterators and they fail with strings created from + // std::to_string. + auto __str = __convert(__value); + auto __out_it = __ctx.out(); + for (size_t __i = 0, __e = __str.size(); __i != __e; ++__i) + *__out_it++ = __str[__i]; + return __out_it; + } +#ifndef _LIBCPP_HAS_NO_INT128 + template <class _Uv> + _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx) + -> decltype(__ctx.out()) requires(same_as<_Uv, __int128_t> || + same_as<_Uv, __uint128_t>) { + using _To = conditional_t<is_signed_v<_Uv>, long long, unsigned long long>; + // TODO FMT Implement full 128-bit support. + if (__value < numeric_limits<_To>::min() || + __value > numeric_limits<_To>::max()) + __throw_format_error("128-bit value is outside of implemented range"); + + return __handle_format(static_cast<_To>(__value), __ctx); + } +#endif +}; +} // namespace __format + +// These specializations are helper stubs and not proper formatters. +// TODO FMT Implement the proper formatter specializations. + +// [format.formatter.spec]/2.1 The specializations + +template <> +struct _LIBCPP_TEMPLATE_VIS formatter<char, char> + : public __format::__formatter_char<char, char> {}; + +template <> +struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> + : public __format::__formatter_char<char, wchar_t> {}; + +template <> +struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> + : public __format::__formatter_char<wchar_t, wchar_t> {}; + +// [format.formatter.spec]/2.2 For each charT, the string type specializations + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<_CharT*, _CharT> + : public __format::__formatter_c_string<_CharT> { + using _Base = __format::__formatter_c_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) + -> decltype(__ctx.out()) { + _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have " + "prevented an invalid pointer"); + return _Base::format(__str, __ctx); + } +}; + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT*, _CharT> + : public __format::__formatter_c_string<_CharT> {}; + +template <class _CharT, size_t _Size> +struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT[_Size], _CharT> + : public __format::__formatter_string<_CharT> { + using _Base = __format::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) + -> decltype(__ctx.out()) { + return _Base::format(_VSTD::basic_string_view<_CharT>(__str, _Size), __ctx); + } +}; + +template <class _CharT, class _Traits, class _Allocator> +struct _LIBCPP_TEMPLATE_VIS + formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT> + : public __format::__formatter_string<_CharT> { + using _Base = __format::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto + format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) + -> decltype(__ctx.out()) { + return _Base::format(_VSTD::basic_string_view<_CharT>(__str), __ctx); + } +}; + +template <class _CharT, class _Traits> +struct _LIBCPP_TEMPLATE_VIS + formatter<basic_string_view<_CharT, _Traits>, _CharT> + : public __format::__formatter_string<_CharT> {}; + +// [format.formatter.spec]/2.3 +// For each charT, for each cv-unqualified arithmetic type ArithmeticT other +// than char, wchar_t, char8_t, char16_t, or char32_t, a specialization + +// Boolean. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<bool, _CharT> { + _LIBCPP_HIDE_FROM_ABI + auto parse(auto& __parse_ctx) -> decltype(__parse_ctx.begin()) { + // TODO FMT Implement + return __parse_ctx.begin(); + } + + _LIBCPP_HIDE_FROM_ABI + auto format(bool __b, auto& __ctx) -> decltype(__ctx.out()) { + // TODO FMT Implement using formatting arguments + auto __out_it = __ctx.out(); + *__out_it++ = _CharT('0') + __b; + return __out_it; + } +}; + +// Signed integral types. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<signed char, _CharT> + : public __format::__formatter_arithmetic<signed char, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<short, _CharT> + : public __format::__formatter_arithmetic<short, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<int, _CharT> + : public __format::__formatter_arithmetic<int, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<long, _CharT> + : public __format::__formatter_arithmetic<long, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<long long, _CharT> + : public __format::__formatter_arithmetic<long long, _CharT> {}; +#ifndef _LIBCPP_HAS_NO_INT128 +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<__int128_t, _CharT> + : public __format::__formatter_arithmetic<__int128_t, _CharT> {}; +#endif + +// Unsigned integral types. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<unsigned char, _CharT> + : public __format::__formatter_arithmetic<unsigned char, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<unsigned short, _CharT> + : public __format::__formatter_arithmetic<unsigned short, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<unsigned, _CharT> + : public __format::__formatter_arithmetic<unsigned, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long, _CharT> + : public __format::__formatter_arithmetic<unsigned long, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long long, _CharT> + : public __format::__formatter_arithmetic<unsigned long long, _CharT> {}; +#ifndef _LIBCPP_HAS_NO_INT128 +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS formatter<__uint128_t, _CharT> + : public __format::__formatter_arithmetic<__uint128_t, _CharT> {}; +#endif + +// Floating point types. +// TODO FMT There are no replacements for the floating point stubs due to not +// having floating point support in std::to_chars yet. These stubs aren't +// removed since they are useful for developing the real versions. +// Ultimately the stubs should be implemented properly and this code can be +// removed. +#if 0 +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<float, _CharT> + : public __format::__formatter_arithmetic<float, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<double, _CharT> + : public __format::__formatter_arithmetic<double, _CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<long double, _CharT> + : public __format::__formatter_arithmetic<long double, _CharT> {}; +#endif + +namespace __format { + +template <class _CharT, class _ParseCtx, class _Ctx> +_LIBCPP_HIDE_FROM_ABI const _CharT* +__handle_replacement_field(const _CharT* __begin, const _CharT* __end, + _ParseCtx& __parse_ctx, _Ctx& __ctx) { + __format::__parse_number_result __r = + __format::__parse_arg_id(__begin, __end, __parse_ctx); + + switch (*__r.__ptr) { + case _CharT(':'): + // The arg-id has a format-specifier, advance the input to the format-spec. + __parse_ctx.advance_to(__r.__ptr + 1); + break; + case _CharT('}'): + // The arg-id has no format-specifier. + __parse_ctx.advance_to(__r.__ptr); + break; + default: + __throw_format_error( + "The replacement field arg-id should terminate at a ':' or '}'"); + } + + _VSTD::visit_format_arg( + [&](auto __arg) { + if constexpr (same_as<decltype(__arg), monostate>) + __throw_format_error("Argument index out of bounds"); + else { + formatter<decltype(__arg), _CharT> __formatter; + __parse_ctx.advance_to(__formatter.parse(__parse_ctx)); + __ctx.advance_to(__formatter.format(__arg, __ctx)); + } + }, + __ctx.arg(__r.__value)); + + __begin = __parse_ctx.begin(); + if (__begin == __end || *__begin != _CharT('}')) + __throw_format_error("The replacement field misses a terminating '}'"); + + return ++__begin; +} + +template <class _ParseCtx, class _Ctx> +_LIBCPP_HIDE_FROM_ABI typename _Ctx::iterator +__vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) { + using _CharT = typename _ParseCtx::char_type; + static_assert(same_as<typename _Ctx::char_type, _CharT>); + + const _CharT* __begin = __parse_ctx.begin(); + const _CharT* __end = __parse_ctx.end(); + typename _Ctx::iterator __out_it = __ctx.out(); + while (__begin != __end) { + switch (*__begin) { + case _CharT('{'): + ++__begin; + if (__begin == __end) + __throw_format_error("The format string terminates at a '{'"); + + if (*__begin != _CharT('{')) [[likely]] { + __ctx.advance_to(_VSTD::move(__out_it)); + __begin = + __handle_replacement_field(__begin, __end, __parse_ctx, __ctx); + __out_it = __ctx.out(); + + // The output is written and __begin points to the next character. So + // start the next iteration. + continue; + } + // The string is an escape character. + break; + + case _CharT('}'): + ++__begin; + if (__begin == __end || *__begin != _CharT('}')) + __throw_format_error( + "The format string contains an invalid escape sequence"); + + break; + } + + // Copy the character to the output verbatim. + *__out_it++ = *__begin++; + } + return __out_it; +} + +} // namespace __format + +template <class _OutIt, class _CharT> +requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt + __vformat_to(_OutIt __out_it, basic_string_view<_CharT> __fmt, + format_args_t<type_identity_t<_OutIt>, _CharT> __args) { + return __format::__vformat_to( + basic_format_parse_context{__fmt, __args.__size()}, + _VSTD::__format_context_create(_VSTD::move(__out_it), __args)); +} + +template <output_iterator<const char&> _OutIt> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +vformat_to(_OutIt __out_it, string_view __fmt, + format_args_t<type_identity_t<_OutIt>, char> __args) { + return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); +} + +template <output_iterator<const wchar_t&> _OutIt> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +vformat_to(_OutIt __out_it, wstring_view __fmt, + format_args_t<type_identity_t<_OutIt>, wchar_t> __args) { + return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); +} + +template <output_iterator<const char&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +format_to(_OutIt __out_it, string_view __fmt, const _Args&... __args) { + return _VSTD::vformat_to( + _VSTD::move(__out_it), __fmt, + _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...)); +} + +template <output_iterator<const wchar_t&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +format_to(_OutIt __out_it, wstring_view __fmt, const _Args&... __args) { + return _VSTD::vformat_to( + _VSTD::move(__out_it), __fmt, + _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>( + __args...)); +} + +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string +vformat(string_view __fmt, format_args __args) { + string __res; + _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); + return __res; +} + +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring +vformat(wstring_view __fmt, wformat_args __args) { + wstring __res; + _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); + return __res; +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string +format(string_view __fmt, const _Args&... __args) { + return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)); +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring +format(wstring_view __fmt, const _Args&... __args) { + return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)); +} + +template <class _OutIt> +struct _LIBCPP_TEMPLATE_VIS format_to_n_result { + _OutIt out; + iter_difference_t<_OutIt> size; +}; + +template <output_iterator<const char&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> +format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, string_view __fmt, + const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + string __str = _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)); + iter_difference_t<_OutIt> __s = __str.size(); + iter_difference_t<_OutIt> __m = + _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); + __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); + return {_VSTD::move(__out_it), __s}; +} + +template <output_iterator<const wchar_t&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> +format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wstring_view __fmt, + const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + wstring __str = _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)); + iter_difference_t<_OutIt> __s = __str.size(); + iter_difference_t<_OutIt> __m = + _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); + __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); + return {_VSTD::move(__out_it), __s}; +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +formatted_size(string_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)).size(); +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +formatted_size(wstring_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)).size(); +} + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + +template <class _OutIt, class _CharT> +requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt + __vformat_to(_OutIt __out_it, locale __loc, basic_string_view<_CharT> __fmt, + format_args_t<type_identity_t<_OutIt>, _CharT> __args) { + return __format::__vformat_to( + basic_format_parse_context{__fmt, __args.__size()}, + _VSTD::__format_context_create(_VSTD::move(__out_it), __args, + _VSTD::move(__loc))); +} + +template <output_iterator<const char&> _OutIt> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +vformat_to(_OutIt __out_it, locale __loc, string_view __fmt, + format_args_t<type_identity_t<_OutIt>, char> __args) { + return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt, + __args); +} + +template <output_iterator<const wchar_t&> _OutIt> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt, + format_args_t<type_identity_t<_OutIt>, wchar_t> __args) { + return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt, + __args); +} + +template <output_iterator<const char&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( + _OutIt __out_it, locale __loc, string_view __fmt, const _Args&... __args) { + return _VSTD::vformat_to( + _VSTD::move(__out_it), _VSTD::move(__loc), __fmt, + _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...)); +} + +template <output_iterator<const wchar_t&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( + _OutIt __out_it, locale __loc, wstring_view __fmt, const _Args&... __args) { + return _VSTD::vformat_to( + _VSTD::move(__out_it), _VSTD::move(__loc), __fmt, + _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>( + __args...)); +} + +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string +vformat(locale __loc, string_view __fmt, format_args __args) { + string __res; + _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt, + __args); + return __res; +} + +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring +vformat(locale __loc, wstring_view __fmt, wformat_args __args) { + wstring __res; + _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt, + __args); + return __res; +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string +format(locale __loc, string_view __fmt, const _Args&... __args) { + return _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_format_args(__args...)); +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring +format(locale __loc, wstring_view __fmt, const _Args&... __args) { + return _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_wformat_args(__args...)); +} + +template <output_iterator<const char&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> +format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, + string_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + string __str = _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_format_args(__args...)); + iter_difference_t<_OutIt> __s = __str.size(); + iter_difference_t<_OutIt> __m = + _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); + __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); + return {_VSTD::move(__out_it), __s}; +} + +template <output_iterator<const wchar_t&> _OutIt, class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> +format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, + wstring_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + wstring __str = _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_wformat_args(__args...)); + iter_difference_t<_OutIt> __s = __str.size(); + iter_difference_t<_OutIt> __m = + _VSTD::clamp(__n, iter_difference_t<_OutIt>(0), __s); + __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); + return {_VSTD::move(__out_it), __s}; +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +formatted_size(locale __loc, string_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + return _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_format_args(__args...)) + .size(); +} + +template <class... _Args> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +formatted_size(locale __loc, wstring_view __fmt, const _Args&... __args) { + // TODO FMT Improve PoC: using std::string is inefficient. + return _VSTD::vformat(_VSTD::move(__loc), __fmt, + _VSTD::make_wformat_args(__args...)) + .size(); +} + +#endif // _LIBCPP_HAS_NO_LOCALIZATION + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) + +#endif // _LIBCPP_FORMAT + + +====================File: include/list==================== +// -*- C++ -*- +//===---------------------------- list ------------------------------------===// +// +// 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_LIST +#define _LIBCPP_LIST + +/* + list synopsis + +namespace std +{ + +template <class T, class Alloc = allocator<T> > +class list +{ +public: + + // types: + typedef T value_type; + typedef Alloc allocator_type; + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + typedef typename allocator_type::pointer pointer; + typedef typename allocator_type::const_pointer const_pointer; + typedef implementation-defined iterator; + typedef implementation-defined const_iterator; + typedef implementation-defined size_type; + typedef implementation-defined difference_type; + typedef reverse_iterator<iterator> reverse_iterator; + typedef reverse_iterator<const_iterator> const_reverse_iterator; + + list() + noexcept(is_nothrow_default_constructible<allocator_type>::value); + explicit list(const allocator_type& a); + explicit list(size_type n); + explicit list(size_type n, const allocator_type& a); // C++14 + list(size_type n, const value_type& value); + list(size_type n, const value_type& value, const allocator_type& a); + template <class Iter> + list(Iter first, Iter last); + template <class Iter> + list(Iter first, Iter last, const allocator_type& a); + list(const list& x); + list(const list&, const allocator_type& a); + list(list&& x) + noexcept(is_nothrow_move_constructible<allocator_type>::value); + list(list&&, const allocator_type& a); + list(initializer_list<value_type>); + list(initializer_list<value_type>, const allocator_type& a); + + ~list(); + + list& operator=(const list& x); + list& operator=(list&& x) + noexcept( + allocator_type::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<allocator_type>::value); + list& operator=(initializer_list<value_type>); + template <class Iter> + void assign(Iter first, Iter last); + void assign(size_type n, const value_type& t); + void assign(initializer_list<value_type>); + + allocator_type get_allocator() const noexcept; + + iterator begin() noexcept; + const_iterator begin() const noexcept; + iterator end() noexcept; + const_iterator end() const noexcept; + reverse_iterator rbegin() noexcept; + const_reverse_iterator rbegin() const noexcept; + reverse_iterator rend() noexcept; + const_reverse_iterator rend() const noexcept; + const_iterator cbegin() const noexcept; + const_iterator cend() const noexcept; + const_reverse_iterator crbegin() const noexcept; + const_reverse_iterator crend() const noexcept; + + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + + bool empty() const noexcept; + size_type size() const noexcept; + size_type max_size() const noexcept; + + template <class... Args> + reference emplace_front(Args&&... args); // reference in C++17 + void pop_front(); + template <class... Args> + reference emplace_back(Args&&... args); // reference in C++17 + void pop_back(); + void push_front(const value_type& x); + void push_front(value_type&& x); + void push_back(const value_type& x); + void push_back(value_type&& x); + template <class... Args> + iterator emplace(const_iterator position, Args&&... args); + iterator insert(const_iterator position, const value_type& x); + iterator insert(const_iterator position, value_type&& x); + iterator insert(const_iterator position, size_type n, const value_type& x); + template <class Iter> + iterator insert(const_iterator position, Iter first, Iter last); + iterator insert(const_iterator position, initializer_list<value_type> il); + + iterator erase(const_iterator position); + iterator erase(const_iterator position, const_iterator last); + + void resize(size_type sz); + void resize(size_type sz, const value_type& c); + + void swap(list&) + noexcept(allocator_traits<allocator_type>::is_always_equal::value); // C++17 + void clear() noexcept; + + void splice(const_iterator position, list& x); + void splice(const_iterator position, list&& x); + void splice(const_iterator position, list& x, const_iterator i); + void splice(const_iterator position, list&& x, const_iterator i); + void splice(const_iterator position, list& x, const_iterator first, + const_iterator last); + void splice(const_iterator position, list&& x, const_iterator first, + const_iterator last); + + size_type remove(const value_type& value); // void before C++20 + template <class Pred> + size_type remove_if(Pred pred); // void before C++20 + size_type unique(); // void before C++20 + template <class BinaryPredicate> + size_type unique(BinaryPredicate binary_pred); // void before C++20 + void merge(list& x); + void merge(list&& x); + template <class Compare> + void merge(list& x, Compare comp); + template <class Compare> + void merge(list&& x, Compare comp); + void sort(); + template <class Compare> + void sort(Compare comp); + void reverse() noexcept; +}; + + +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + list(InputIterator, InputIterator, Allocator = Allocator()) + -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 + +template <class T, class Alloc> + bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y); +template <class T, class Alloc> + bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); +template <class T, class Alloc> + bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); +template <class T, class Alloc> + bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); +template <class T, class Alloc> + bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); +template <class T, class Alloc> + bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); + +template <class T, class Alloc> + void swap(list<T,Alloc>& x, list<T,Alloc>& y) + noexcept(noexcept(x.swap(y))); + +template <class T, class Allocator, class U> + typename list<T, Allocator>::size_type + erase(list<T, Allocator>& c, const U& value); // C++20 +template <class T, class Allocator, class Predicate> + typename list<T, Allocator>::size_type + erase_if(list<T, Allocator>& c, Predicate pred); // C++20 + +} // std + +*/ + +#include <__config> +#include <__debug> +#include <__utility/forward.h> +#include <algorithm> +#include <initializer_list> +#include <iterator> +#include <limits> +#include <memory> +#include <type_traits> +#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 _Tp, class _VoidPtr> struct __list_node; +template <class _Tp, class _VoidPtr> struct __list_node_base; + +template <class _Tp, class _VoidPtr> +struct __list_node_pointer_traits { + typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type + __node_pointer; + typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type + __base_pointer; + +#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB) + typedef __base_pointer __link_pointer; +#else + typedef typename conditional< + is_pointer<_VoidPtr>::value, + __base_pointer, + __node_pointer + >::type __link_pointer; +#endif + + typedef typename conditional< + is_same<__link_pointer, __node_pointer>::value, + __base_pointer, + __node_pointer + >::type __non_link_pointer; + + static _LIBCPP_INLINE_VISIBILITY + __link_pointer __unsafe_link_pointer_cast(__link_pointer __p) { + return __p; + } + + static _LIBCPP_INLINE_VISIBILITY + __link_pointer __unsafe_link_pointer_cast(__non_link_pointer __p) { + return static_cast<__link_pointer>(static_cast<_VoidPtr>(__p)); + } + +}; + +template <class _Tp, class _VoidPtr> +struct __list_node_base +{ + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__node_pointer __node_pointer; + typedef typename _NodeTraits::__base_pointer __base_pointer; + typedef typename _NodeTraits::__link_pointer __link_pointer; + + __link_pointer __prev_; + __link_pointer __next_; + + _LIBCPP_INLINE_VISIBILITY + __list_node_base() : __prev_(_NodeTraits::__unsafe_link_pointer_cast(__self())), + __next_(_NodeTraits::__unsafe_link_pointer_cast(__self())) {} + + _LIBCPP_INLINE_VISIBILITY + __base_pointer __self() { + return pointer_traits<__base_pointer>::pointer_to(*this); + } + + _LIBCPP_INLINE_VISIBILITY + __node_pointer __as_node() { + return static_cast<__node_pointer>(__self()); + } +}; + +template <class _Tp, class _VoidPtr> +struct _LIBCPP_STANDALONE_DEBUG __list_node + : public __list_node_base<_Tp, _VoidPtr> +{ + _Tp __value_; + + typedef __list_node_base<_Tp, _VoidPtr> __base; + typedef typename __base::__link_pointer __link_pointer; + + _LIBCPP_INLINE_VISIBILITY + __link_pointer __as_link() { + return static_cast<__link_pointer>(__base::__self()); + } +}; + +template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS list; +template <class _Tp, class _Alloc> class __list_imp; +template <class _Tp, class _VoidPtr> class _LIBCPP_TEMPLATE_VIS __list_const_iterator; + +template <class _Tp, class _VoidPtr> +class _LIBCPP_TEMPLATE_VIS __list_iterator +{ + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__link_pointer __link_pointer; + + __link_pointer __ptr_; + +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_INLINE_VISIBILITY + explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT + : __ptr_(__p) + { + __get_db()->__insert_ic(this, __c); + } +#else + _LIBCPP_INLINE_VISIBILITY + explicit __list_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} +#endif + + + + template<class, class> friend class list; + template<class, class> friend class __list_imp; + template<class, class> friend class __list_const_iterator; +public: + typedef bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef value_type& reference; + typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer; + typedef typename pointer_traits<pointer>::difference_type difference_type; + + _LIBCPP_INLINE_VISIBILITY + __list_iterator() _NOEXCEPT : __ptr_(nullptr) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_i(this); +#endif + } + +#if _LIBCPP_DEBUG_LEVEL == 2 + + _LIBCPP_INLINE_VISIBILITY + __list_iterator(const __list_iterator& __p) + : __ptr_(__p.__ptr_) + { + __get_db()->__iterator_copy(this, &__p); + } + + _LIBCPP_INLINE_VISIBILITY + ~__list_iterator() + { + __get_db()->__erase_i(this); + } + + _LIBCPP_INLINE_VISIBILITY + __list_iterator& operator=(const __list_iterator& __p) + { + if (this != &__p) + { + __get_db()->__iterator_copy(this, &__p); + __ptr_ = __p.__ptr_; + } + return *this; + } + +#endif // _LIBCPP_DEBUG_LEVEL == 2 + + _LIBCPP_INLINE_VISIBILITY + reference operator*() const + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable list::iterator"); +#endif + return __ptr_->__as_node()->__value_; + } + _LIBCPP_INLINE_VISIBILITY + pointer operator->() const + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable list::iterator"); +#endif + return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_); + } + + _LIBCPP_INLINE_VISIBILITY + __list_iterator& operator++() + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to increment a non-incrementable list::iterator"); +#endif + __ptr_ = __ptr_->__next_; + return *this; + } + _LIBCPP_INLINE_VISIBILITY + __list_iterator operator++(int) {__list_iterator __t(*this); ++(*this); return __t;} + + _LIBCPP_INLINE_VISIBILITY + __list_iterator& operator--() + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), + "Attempted to decrement a non-decrementable list::iterator"); +#endif + __ptr_ = __ptr_->__prev_; + return *this; + } + _LIBCPP_INLINE_VISIBILITY + __list_iterator operator--(int) {__list_iterator __t(*this); --(*this); return __t;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const __list_iterator& __x, const __list_iterator& __y) + { + return __x.__ptr_ == __y.__ptr_; + } + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const __list_iterator& __x, const __list_iterator& __y) + {return !(__x == __y);} +}; + +template <class _Tp, class _VoidPtr> +class _LIBCPP_TEMPLATE_VIS __list_const_iterator +{ + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__link_pointer __link_pointer; + + __link_pointer __ptr_; + +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_INLINE_VISIBILITY + explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT + : __ptr_(__p) + { + __get_db()->__insert_ic(this, __c); + } +#else + _LIBCPP_INLINE_VISIBILITY + explicit __list_const_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} +#endif + + template<class, class> friend class list; + template<class, class> friend class __list_imp; +public: + typedef bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef const value_type& reference; + typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer; + typedef typename pointer_traits<pointer>::difference_type difference_type; + + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator() _NOEXCEPT : __ptr_(nullptr) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_i(this); +#endif + } + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT + : __ptr_(__p.__ptr_) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__iterator_copy(this, &__p); +#endif + } + +#if _LIBCPP_DEBUG_LEVEL == 2 + + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator(const __list_const_iterator& __p) + : __ptr_(__p.__ptr_) + { + __get_db()->__iterator_copy(this, &__p); + } + + _LIBCPP_INLINE_VISIBILITY + ~__list_const_iterator() + { + __get_db()->__erase_i(this); + } + + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator& operator=(const __list_const_iterator& __p) + { + if (this != &__p) + { + __get_db()->__iterator_copy(this, &__p); + __ptr_ = __p.__ptr_; + } + return *this; + } + +#endif // _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_INLINE_VISIBILITY + reference operator*() const + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable list::const_iterator"); +#endif + return __ptr_->__as_node()->__value_; + } + _LIBCPP_INLINE_VISIBILITY + pointer operator->() const + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable list::const_iterator"); +#endif + return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_); + } + + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator& operator++() + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to increment a non-incrementable list::const_iterator"); +#endif + __ptr_ = __ptr_->__next_; + return *this; + } + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator operator++(int) {__list_const_iterator __t(*this); ++(*this); return __t;} + + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator& operator--() + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), + "Attempted to decrement a non-decrementable list::const_iterator"); +#endif + __ptr_ = __ptr_->__prev_; + return *this; + } + _LIBCPP_INLINE_VISIBILITY + __list_const_iterator operator--(int) {__list_const_iterator __t(*this); --(*this); return __t;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y) + { + return __x.__ptr_ == __y.__ptr_; + } + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y) + {return !(__x == __y);} +}; + +template <class _Tp, class _Alloc> +class __list_imp +{ + __list_imp(const __list_imp&); + __list_imp& operator=(const __list_imp&); +public: + typedef _Alloc allocator_type; + typedef allocator_traits<allocator_type> __alloc_traits; + typedef typename __alloc_traits::size_type size_type; +protected: + typedef _Tp value_type; + typedef typename __alloc_traits::void_pointer __void_pointer; + typedef __list_iterator<value_type, __void_pointer> iterator; + typedef __list_const_iterator<value_type, __void_pointer> const_iterator; + typedef __list_node_base<value_type, __void_pointer> __node_base; + typedef __list_node<value_type, __void_pointer> __node; + typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; + typedef allocator_traits<__node_allocator> __node_alloc_traits; + typedef typename __node_alloc_traits::pointer __node_pointer; + typedef typename __node_alloc_traits::pointer __node_const_pointer; + typedef __list_node_pointer_traits<value_type, __void_pointer> __node_pointer_traits; + typedef typename __node_pointer_traits::__link_pointer __link_pointer; + typedef __link_pointer __link_const_pointer; + typedef typename __alloc_traits::pointer pointer; + typedef typename __alloc_traits::const_pointer const_pointer; + typedef typename __alloc_traits::difference_type difference_type; + + typedef typename __rebind_alloc_helper<__alloc_traits, __node_base>::type __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"); + + __node_base __end_; + __compressed_pair<size_type, __node_allocator> __size_alloc_; + + _LIBCPP_INLINE_VISIBILITY + __link_pointer __end_as_link() const _NOEXCEPT { + return __node_pointer_traits::__unsafe_link_pointer_cast( + const_cast<__node_base&>(__end_).__self()); + } + + _LIBCPP_INLINE_VISIBILITY + size_type& __sz() _NOEXCEPT {return __size_alloc_.first();} + _LIBCPP_INLINE_VISIBILITY + const size_type& __sz() const _NOEXCEPT + {return __size_alloc_.first();} + _LIBCPP_INLINE_VISIBILITY + __node_allocator& __node_alloc() _NOEXCEPT + {return __size_alloc_.second();} + _LIBCPP_INLINE_VISIBILITY + const __node_allocator& __node_alloc() const _NOEXCEPT + {return __size_alloc_.second();} + + _LIBCPP_INLINE_VISIBILITY + size_type __node_alloc_max_size() const _NOEXCEPT { + return __node_alloc_traits::max_size(__node_alloc()); + } + _LIBCPP_INLINE_VISIBILITY + static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + __list_imp() + _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value); + _LIBCPP_INLINE_VISIBILITY + __list_imp(const allocator_type& __a); + _LIBCPP_INLINE_VISIBILITY + __list_imp(const __node_allocator& __a); +#ifndef _LIBCPP_CXX03_LANG + __list_imp(__node_allocator&& __a) _NOEXCEPT; +#endif + ~__list_imp(); + void clear() _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY + bool empty() const _NOEXCEPT {return __sz() == 0;} + + _LIBCPP_INLINE_VISIBILITY + iterator begin() _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__end_.__next_, this); +#else + return iterator(__end_.__next_); +#endif + } + _LIBCPP_INLINE_VISIBILITY + const_iterator begin() const _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + return const_iterator(__end_.__next_, this); +#else + return const_iterator(__end_.__next_); +#endif + } + _LIBCPP_INLINE_VISIBILITY + iterator end() _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__end_as_link(), this); +#else + return iterator(__end_as_link()); +#endif + } + _LIBCPP_INLINE_VISIBILITY + const_iterator end() const _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + return const_iterator(__end_as_link(), this); +#else + return const_iterator(__end_as_link()); +#endif + } + + void 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); +#endif + + _LIBCPP_INLINE_VISIBILITY + void __copy_assign_alloc(const __list_imp& __c) + {__copy_assign_alloc(__c, integral_constant<bool, + __node_alloc_traits::propagate_on_container_copy_assignment::value>());} + + _LIBCPP_INLINE_VISIBILITY + void __move_assign_alloc(__list_imp& __c) + _NOEXCEPT_( + !__node_alloc_traits::propagate_on_container_move_assignment::value || + is_nothrow_move_assignable<__node_allocator>::value) + {__move_assign_alloc(__c, integral_constant<bool, + __node_alloc_traits::propagate_on_container_move_assignment::value>());} + +private: + _LIBCPP_INLINE_VISIBILITY + void __copy_assign_alloc(const __list_imp& __c, true_type) + { + if (__node_alloc() != __c.__node_alloc()) + clear(); + __node_alloc() = __c.__node_alloc(); + } + + _LIBCPP_INLINE_VISIBILITY + void __copy_assign_alloc(const __list_imp&, false_type) + {} + + _LIBCPP_INLINE_VISIBILITY + void __move_assign_alloc(__list_imp& __c, true_type) + _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) + { + __node_alloc() = _VSTD::move(__c.__node_alloc()); + } + + _LIBCPP_INLINE_VISIBILITY + void __move_assign_alloc(__list_imp&, false_type) + _NOEXCEPT + {} + + _LIBCPP_INLINE_VISIBILITY + void __invalidate_all_iterators() { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__invalidate_all(this); +#endif + } +}; + +// Unlink nodes [__f, __l] +template <class _Tp, class _Alloc> +inline +void +__list_imp<_Tp, _Alloc>::__unlink_nodes(__link_pointer __f, __link_pointer __l) + _NOEXCEPT +{ + __f->__prev_->__next_ = __l->__next_; + __l->__next_->__prev_ = __f->__prev_; +} + +template <class _Tp, class _Alloc> +inline +__list_imp<_Tp, _Alloc>::__list_imp() + _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) + : __size_alloc_(0, __default_init_tag()) +{ +} + +template <class _Tp, class _Alloc> +inline +__list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a) + : __size_alloc_(0, __node_allocator(__a)) +{ +} + +template <class _Tp, class _Alloc> +inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a) + : __size_alloc_(0, __a) {} + +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp, class _Alloc> +inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT + : __size_alloc_(0, _VSTD::move(__a)) {} +#endif + +template <class _Tp, class _Alloc> +__list_imp<_Tp, _Alloc>::~__list_imp() { + clear(); +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__erase_c(this); +#endif +} + +template <class _Tp, class _Alloc> +void +__list_imp<_Tp, _Alloc>::clear() _NOEXCEPT +{ + if (!empty()) + { + __node_allocator& __na = __node_alloc(); + __link_pointer __f = __end_.__next_; + __link_pointer __l = __end_as_link(); + __unlink_nodes(__f, __l->__prev_); + __sz() = 0; + while (__f != __l) + { + __node_pointer __np = __f->__as_node(); + __f = __f->__next_; + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); + } + __invalidate_all_iterators(); + } +} + +template <class _Tp, class _Alloc> +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) +#endif +{ + _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value || + this->__node_alloc() == __c.__node_alloc(), + "list::swap: Either propagate_on_container_swap must be true" + " or the allocators must compare equal"); + using _VSTD::swap; + _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc()); + swap(__sz(), __c.__sz()); + swap(__end_, __c.__end_); + if (__sz() == 0) + __end_.__next_ = __end_.__prev_ = __end_as_link(); + else + __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_as_link(); + if (__c.__sz() == 0) + __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_as_link(); + else + __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link(); + +#if _LIBCPP_DEBUG_LEVEL == 2 + __libcpp_db* __db = __get_db(); + __c_node* __cn1 = __db->__find_c_and_lock(this); + __c_node* __cn2 = __db->__find_c(&__c); + _VSTD::swap(__cn1->beg_, __cn2->beg_); + _VSTD::swap(__cn1->end_, __cn2->end_); + _VSTD::swap(__cn1->cap_, __cn2->cap_); + for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;) + { + --__p; + const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_); + if (__i->__ptr_ == __c.__end_as_link()) + { + __cn2->__add(*__p); + if (--__cn1->end_ != __p) + _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*)); + } + else + (*__p)->__c_ = __cn1; + } + for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;) + { + --__p; + const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_); + if (__i->__ptr_ == __end_as_link()) + { + __cn1->__add(*__p); + if (--__cn2->end_ != __p) + _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); + } + else + (*__p)->__c_ = __cn2; + } + __db->unlock(); +#endif +} + +template <class _Tp, class _Alloc /*= allocator<_Tp>*/> +class _LIBCPP_TEMPLATE_VIS list + : private __list_imp<_Tp, _Alloc> +{ + typedef __list_imp<_Tp, _Alloc> base; + typedef typename base::__node __node; + typedef typename base::__node_allocator __node_allocator; + typedef typename base::__node_pointer __node_pointer; + typedef typename base::__node_alloc_traits __node_alloc_traits; + typedef typename base::__node_base __node_base; + typedef typename base::__node_base_pointer __node_base_pointer; + typedef typename base::__link_pointer __link_pointer; + +public: + typedef _Tp value_type; + typedef _Alloc allocator_type; + static_assert((is_same<value_type, typename allocator_type::value_type>::value), + "Invalid allocator::value_type"); + typedef value_type& reference; + typedef const value_type& const_reference; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; +#if _LIBCPP_STD_VER > 17 + typedef size_type __remove_return_type; +#else + typedef void __remove_return_type; +#endif + + _LIBCPP_INLINE_VISIBILITY + list() + _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + } + _LIBCPP_INLINE_VISIBILITY + explicit list(const allocator_type& __a) : base(__a) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + } + explicit list(size_type __n); +#if _LIBCPP_STD_VER > 11 + explicit list(size_type __n, const allocator_type& __a); +#endif + list(size_type __n, const value_type& __x); + list(size_type __n, const value_type& __x, const allocator_type& __a); + template <class _InpIter> + list(_InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); + template <class _InpIter> + list(_InpIter __f, _InpIter __l, const allocator_type& __a, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); + + list(const list& __c); + list(const list& __c, const __identity_t<allocator_type>& __a); + _LIBCPP_INLINE_VISIBILITY + list& operator=(const list& __c); +#ifndef _LIBCPP_CXX03_LANG + list(initializer_list<value_type> __il); + list(initializer_list<value_type> __il, const allocator_type& __a); + + _LIBCPP_INLINE_VISIBILITY + list(list&& __c) + _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value); + _LIBCPP_INLINE_VISIBILITY + list(list&& __c, const __identity_t<allocator_type>& __a); + _LIBCPP_INLINE_VISIBILITY + list& operator=(list&& __c) + _NOEXCEPT_( + __node_alloc_traits::propagate_on_container_move_assignment::value && + is_nothrow_move_assignable<__node_allocator>::value); + + _LIBCPP_INLINE_VISIBILITY + list& operator=(initializer_list<value_type> __il) + {assign(__il.begin(), __il.end()); return *this;} + + _LIBCPP_INLINE_VISIBILITY + void assign(initializer_list<value_type> __il) + {assign(__il.begin(), __il.end());} +#endif // _LIBCPP_CXX03_LANG + + template <class _InpIter> + void assign(_InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); + void assign(size_type __n, const value_type& __x); + + _LIBCPP_INLINE_VISIBILITY + allocator_type get_allocator() const _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + size_type size() const _NOEXCEPT {return base::__sz();} + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY + bool empty() const _NOEXCEPT {return base::empty();} + _LIBCPP_INLINE_VISIBILITY + size_type max_size() const _NOEXCEPT + { + return _VSTD::min<size_type>( + base::__node_alloc_max_size(), + numeric_limits<difference_type >::max()); + } + + _LIBCPP_INLINE_VISIBILITY + iterator begin() _NOEXCEPT {return base::begin();} + _LIBCPP_INLINE_VISIBILITY + const_iterator begin() const _NOEXCEPT {return base::begin();} + _LIBCPP_INLINE_VISIBILITY + iterator end() _NOEXCEPT {return base::end();} + _LIBCPP_INLINE_VISIBILITY + const_iterator end() const _NOEXCEPT {return base::end();} + _LIBCPP_INLINE_VISIBILITY + const_iterator cbegin() const _NOEXCEPT {return base::begin();} + _LIBCPP_INLINE_VISIBILITY + const_iterator cend() const _NOEXCEPT {return base::end();} + + _LIBCPP_INLINE_VISIBILITY + reverse_iterator rbegin() _NOEXCEPT + {return reverse_iterator(end());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator rbegin() const _NOEXCEPT + {return const_reverse_iterator(end());} + _LIBCPP_INLINE_VISIBILITY + reverse_iterator rend() _NOEXCEPT + {return reverse_iterator(begin());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator rend() const _NOEXCEPT + {return const_reverse_iterator(begin());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator crbegin() const _NOEXCEPT + {return const_reverse_iterator(end());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator crend() const _NOEXCEPT + {return const_reverse_iterator(begin());} + + _LIBCPP_INLINE_VISIBILITY + reference front() + { + _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); + return base::__end_.__next_->__as_node()->__value_; + } + _LIBCPP_INLINE_VISIBILITY + const_reference front() const + { + _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); + return base::__end_.__next_->__as_node()->__value_; + } + _LIBCPP_INLINE_VISIBILITY + reference back() + { + _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); + return base::__end_.__prev_->__as_node()->__value_; + } + _LIBCPP_INLINE_VISIBILITY + const_reference back() const + { + _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); + return base::__end_.__prev_->__as_node()->__value_; + } + +#ifndef _LIBCPP_CXX03_LANG + void push_front(value_type&& __x); + void push_back(value_type&& __x); + + template <class... _Args> +#if _LIBCPP_STD_VER > 14 + reference emplace_front(_Args&&... __args); +#else + void emplace_front(_Args&&... __args); +#endif + template <class... _Args> +#if _LIBCPP_STD_VER > 14 + reference emplace_back(_Args&&... __args); +#else + void emplace_back(_Args&&... __args); +#endif + template <class... _Args> + iterator emplace(const_iterator __p, _Args&&... __args); + + iterator insert(const_iterator __p, value_type&& __x); + + _LIBCPP_INLINE_VISIBILITY + iterator insert(const_iterator __p, initializer_list<value_type> __il) + {return insert(__p, __il.begin(), __il.end());} +#endif // _LIBCPP_CXX03_LANG + + void push_front(const value_type& __x); + void push_back(const value_type& __x); + +#ifndef _LIBCPP_CXX03_LANG + template <class _Arg> + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } +#else + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(value_type const& __arg) { push_back(__arg); } +#endif + + iterator insert(const_iterator __p, const value_type& __x); + iterator insert(const_iterator __p, size_type __n, const value_type& __x); + template <class _InpIter> + iterator insert(const_iterator __p, _InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0); + + _LIBCPP_INLINE_VISIBILITY + void swap(list& __c) +#if _LIBCPP_STD_VER >= 14 + _NOEXCEPT +#else + _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || + __is_nothrow_swappable<__node_allocator>::value) +#endif + {base::swap(__c);} + _LIBCPP_INLINE_VISIBILITY + void clear() _NOEXCEPT {base::clear();} + + void pop_front(); + void pop_back(); + + iterator erase(const_iterator __p); + iterator erase(const_iterator __f, const_iterator __l); + + void resize(size_type __n); + void resize(size_type __n, const value_type& __x); + + void splice(const_iterator __p, list& __c); +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + void splice(const_iterator __p, list&& __c) {splice(__p, __c);} + _LIBCPP_INLINE_VISIBILITY + void splice(const_iterator __p, list&& __c, const_iterator __i) + {splice(__p, __c, __i);} + _LIBCPP_INLINE_VISIBILITY + void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l) + {splice(__p, __c, __f, __l);} +#endif + void splice(const_iterator __p, list& __c, const_iterator __i); + void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l); + + __remove_return_type remove(const value_type& __x); + template <class _Pred> __remove_return_type remove_if(_Pred __pred); + _LIBCPP_INLINE_VISIBILITY + __remove_return_type unique() { return unique(__equal_to<value_type>()); } + template <class _BinaryPred> + __remove_return_type unique(_BinaryPred __binary_pred); + _LIBCPP_INLINE_VISIBILITY + void merge(list& __c); +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + void merge(list&& __c) {merge(__c);} + + template <class _Comp> + _LIBCPP_INLINE_VISIBILITY + void merge(list&& __c, _Comp __comp) {merge(__c, __comp);} +#endif + template <class _Comp> + void merge(list& __c, _Comp __comp); + + _LIBCPP_INLINE_VISIBILITY + void sort(); + template <class _Comp> + _LIBCPP_INLINE_VISIBILITY + void sort(_Comp __comp); + + void reverse() _NOEXCEPT; + + bool __invariants() const; + + typedef __allocator_destructor<__node_allocator> __node_destructor; + typedef unique_ptr<__node, __node_destructor> __hold_pointer; + + _LIBCPP_INLINE_VISIBILITY + __hold_pointer __allocate_node(__node_allocator& __na) { + __node_pointer __p = __node_alloc_traits::allocate(__na, 1); + __p->__prev_ = nullptr; + return __hold_pointer(__p, __node_destructor(__na, 1)); + } + +#if _LIBCPP_DEBUG_LEVEL == 2 + + bool __dereferenceable(const const_iterator* __i) const; + bool __decrementable(const const_iterator* __i) const; + bool __addable(const const_iterator* __i, ptrdiff_t __n) const; + bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; + +#endif // _LIBCPP_DEBUG_LEVEL == 2 + +private: + _LIBCPP_INLINE_VISIBILITY + static void __link_nodes (__link_pointer __p, __link_pointer __f, __link_pointer __l); + _LIBCPP_INLINE_VISIBILITY + void __link_nodes_at_front(__link_pointer __f, __link_pointer __l); + _LIBCPP_INLINE_VISIBILITY + void __link_nodes_at_back (__link_pointer __f, __link_pointer __l); + iterator __iterator(size_type __n); + template <class _Comp> + static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp); + + void __move_assign(list& __c, true_type) + _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value); + void __move_assign(list& __c, false_type); +}; + +#if _LIBCPP_STD_VER >= 17 +template<class _InputIterator, + class _Alloc = allocator<__iter_value_type<_InputIterator>>, + class = enable_if_t<__is_allocator<_Alloc>::value> + > +list(_InputIterator, _InputIterator) + -> list<__iter_value_type<_InputIterator>, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = enable_if_t<__is_allocator<_Alloc>::value> + > +list(_InputIterator, _InputIterator, _Alloc) + -> list<__iter_value_type<_InputIterator>, _Alloc>; +#endif + +// Link in nodes [__f, __l] just prior to __p +template <class _Tp, class _Alloc> +inline +void +list<_Tp, _Alloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l) +{ + __p->__prev_->__next_ = __f; + __f->__prev_ = __p->__prev_; + __p->__prev_ = __l; + __l->__next_ = __p; +} + +// Link in nodes [__f, __l] at the front of the list +template <class _Tp, class _Alloc> +inline +void +list<_Tp, _Alloc>::__link_nodes_at_front(__link_pointer __f, __link_pointer __l) +{ + __f->__prev_ = base::__end_as_link(); + __l->__next_ = base::__end_.__next_; + __l->__next_->__prev_ = __l; + base::__end_.__next_ = __f; +} + +// Link in nodes [__f, __l] at the back of the list +template <class _Tp, class _Alloc> +inline +void +list<_Tp, _Alloc>::__link_nodes_at_back(__link_pointer __f, __link_pointer __l) +{ + __l->__next_ = base::__end_as_link(); + __f->__prev_ = base::__end_.__prev_; + __f->__prev_->__next_ = __f; + base::__end_.__prev_ = __l; +} + + +template <class _Tp, class _Alloc> +inline +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::__iterator(size_type __n) +{ + return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n) + : _VSTD::prev(end(), base::__sz() - __n); +} + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(size_type __n) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __n > 0; --__n) +#ifndef _LIBCPP_CXX03_LANG + emplace_back(); +#else + push_back(value_type()); +#endif +} + +#if _LIBCPP_STD_VER > 11 +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __n > 0; --__n) + emplace_back(); +} +#endif + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(size_type __n, const value_type& __x) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __n > 0; --__n) + push_back(__x); +} + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a) + : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __n > 0; --__n) + push_back(__x); +} + +template <class _Tp, class _Alloc> +template <class _InpIter> +list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __f != __l; ++__f) + __emplace_back(*__f); +} + +template <class _Tp, class _Alloc> +template <class _InpIter> +list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) + : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (; __f != __l; ++__f) + __emplace_back(*__f); +} + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(const list& __c) + : base(__node_alloc_traits::select_on_container_copy_construction( + __c.__node_alloc())) { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i) + push_back(*__i); +} + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(const list& __c, const __identity_t<allocator_type>& __a) + : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i) + push_back(*__i); +} + +#ifndef _LIBCPP_CXX03_LANG + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a) + : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (typename initializer_list<value_type>::const_iterator __i = __il.begin(), + __e = __il.end(); __i != __e; ++__i) + push_back(*__i); +} + +template <class _Tp, class _Alloc> +list<_Tp, _Alloc>::list(initializer_list<value_type> __il) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + for (typename initializer_list<value_type>::const_iterator __i = __il.begin(), + __e = __il.end(); __i != __e; ++__i) + push_back(*__i); +} + +template <class _Tp, class _Alloc> +inline list<_Tp, _Alloc>::list(list&& __c) + _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value) + : base(_VSTD::move(__c.__node_alloc())) { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + splice(end(), __c); +} + +template <class _Tp, class _Alloc> +inline +list<_Tp, _Alloc>::list(list&& __c, const __identity_t<allocator_type>& __a) + : base(__a) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_c(this); +#endif + if (__a == __c.get_allocator()) + splice(end(), __c); + else + { + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); + } +} + +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) +{ + __move_assign(__c, integral_constant<bool, + __node_alloc_traits::propagate_on_container_move_assignment::value>()); + return *this; +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::__move_assign(list& __c, false_type) +{ + if (base::__node_alloc() != __c.__node_alloc()) + { + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); + } + else + __move_assign(__c, true_type()); +} + +template <class _Tp, class _Alloc> +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); +} + +#endif // _LIBCPP_CXX03_LANG + +template <class _Tp, class _Alloc> +inline +list<_Tp, _Alloc>& +list<_Tp, _Alloc>::operator=(const list& __c) +{ + if (this != &__c) + { + base::__copy_assign_alloc(__c); + assign(__c.begin(), __c.end()); + } + return *this; +} + +template <class _Tp, class _Alloc> +template <class _InpIter> +void +list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) +{ + iterator __i = begin(); + iterator __e = end(); + for (; __f != __l && __i != __e; ++__f, (void) ++__i) + *__i = *__f; + if (__i == __e) + insert(__e, __f, __l); + else + erase(__i, __e); +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__invalidate_all(this); +#endif +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x) +{ + iterator __i = begin(); + iterator __e = end(); + for (; __n > 0 && __i != __e; --__n, (void) ++__i) + *__i = __x; + if (__i == __e) + insert(__e, __n, __x); + else + erase(__i, __e); +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__invalidate_all(this); +#endif +} + +template <class _Tp, class _Alloc> +inline +_Alloc +list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT +{ + return allocator_type(base::__node_alloc()); +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::insert(iterator, x) called with an iterator not" + " referring to this list"); +#endif + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link()); + ++base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__hold.release()->__as_link(), this); +#else + return iterator(__hold.release()->__as_link()); +#endif +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::insert(iterator, n, x) called with an iterator not" + " referring to this list"); + iterator __r(__p.__ptr_, this); +#else + iterator __r(__p.__ptr_); +#endif + if (__n > 0) + { + size_type __ds = 0; + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + ++__ds; +#if _LIBCPP_DEBUG_LEVEL == 2 + __r = iterator(__hold->__as_link(), this); +#else + __r = iterator(__hold->__as_link()); +#endif + __hold.release(); + iterator __e = __r; +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) + { + __hold.reset(__node_alloc_traits::allocate(__na, 1)); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + __e.__ptr_->__next_ = __hold->__as_link(); + __hold->__prev_ = __e.__ptr_; + __hold.release(); + } +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + while (true) + { + __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); + if (__prev == 0) + break; +#if _LIBCPP_DEBUG_LEVEL == 2 + __e = iterator(__prev, this); +#else + __e = iterator(__prev); +#endif + } + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_); + base::__sz() += __ds; + } + return __r; +} + +template <class _Tp, class _Alloc> +template <class _InpIter> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l, + typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::insert(iterator, range) called with an iterator not" + " referring to this list"); + iterator __r(__p.__ptr_, this); +#else + iterator __r(__p.__ptr_); +#endif + if (__f != __l) + { + size_type __ds = 0; + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); + ++__ds; +#if _LIBCPP_DEBUG_LEVEL == 2 + __r = iterator(__hold.get()->__as_link(), this); +#else + __r = iterator(__hold.get()->__as_link()); +#endif + __hold.release(); + iterator __e = __r; +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds) + { + __hold.reset(__node_alloc_traits::allocate(__na, 1)); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); + __e.__ptr_->__next_ = __hold.get()->__as_link(); + __hold->__prev_ = __e.__ptr_; + __hold.release(); + } +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + while (true) + { + __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); + if (__prev == 0) + break; +#if _LIBCPP_DEBUG_LEVEL == 2 + __e = iterator(__prev, this); +#else + __e = iterator(__prev); +#endif + } + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_); + base::__sz() += __ds; + } + return __r; +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::push_front(const value_type& __x) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + __link_pointer __nl = __hold->__as_link(); + __link_nodes_at_front(__nl, __nl); + ++base::__sz(); + __hold.release(); +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::push_back(const value_type& __x) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); + ++base::__sz(); + __hold.release(); +} + +#ifndef _LIBCPP_CXX03_LANG + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::push_front(value_type&& __x) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); + __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); + ++base::__sz(); + __hold.release(); +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::push_back(value_type&& __x) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); + __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); + ++base::__sz(); + __hold.release(); +} + +template <class _Tp, class _Alloc> +template <class... _Args> +#if _LIBCPP_STD_VER > 14 +typename list<_Tp, _Alloc>::reference +#else +void +#endif +list<_Tp, _Alloc>::emplace_front(_Args&&... __args) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); + __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); + ++base::__sz(); +#if _LIBCPP_STD_VER > 14 + return __hold.release()->__value_; +#else + __hold.release(); +#endif +} + +template <class _Tp, class _Alloc> +template <class... _Args> +#if _LIBCPP_STD_VER > 14 +typename list<_Tp, _Alloc>::reference +#else +void +#endif +list<_Tp, _Alloc>::emplace_back(_Args&&... __args) +{ + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); + __link_pointer __nl = __hold->__as_link(); + __link_nodes_at_back(__nl, __nl); + ++base::__sz(); +#if _LIBCPP_STD_VER > 14 + return __hold.release()->__value_; +#else + __hold.release(); +#endif +} + +template <class _Tp, class _Alloc> +template <class... _Args> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::emplace(iterator, args...) called with an iterator not" + " referring to this list"); +#endif + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); + __link_pointer __nl = __hold.get()->__as_link(); + __link_nodes(__p.__ptr_, __nl, __nl); + ++base::__sz(); + __hold.release(); +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__nl, this); +#else + return iterator(__nl); +#endif +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::insert(iterator, x) called with an iterator not" + " referring to this list"); +#endif + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); + __link_pointer __nl = __hold->__as_link(); + __link_nodes(__p.__ptr_, __nl, __nl); + ++base::__sz(); + __hold.release(); +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__nl, this); +#else + return iterator(__nl); +#endif +} + +#endif // _LIBCPP_CXX03_LANG + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::pop_front() +{ + _LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list"); + __node_allocator& __na = base::__node_alloc(); + __link_pointer __n = base::__end_.__next_; + base::__unlink_nodes(__n, __n); + --base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + __c_node* __c = __get_db()->__find_c_and_lock(this); + for (__i_node** __p = __c->end_; __p != __c->beg_; ) + { + --__p; + iterator* __i = static_cast<iterator*>((*__p)->__i_); + if (__i->__ptr_ == __n) + { + (*__p)->__c_ = nullptr; + if (--__c->end_ != __p) + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + } + } + __get_db()->unlock(); +#endif + __node_pointer __np = __n->__as_node(); + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::pop_back() +{ + _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list"); + __node_allocator& __na = base::__node_alloc(); + __link_pointer __n = base::__end_.__prev_; + base::__unlink_nodes(__n, __n); + --base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + __c_node* __c = __get_db()->__find_c_and_lock(this); + for (__i_node** __p = __c->end_; __p != __c->beg_; ) + { + --__p; + iterator* __i = static_cast<iterator*>((*__p)->__i_); + if (__i->__ptr_ == __n) + { + (*__p)->__c_ = nullptr; + if (--__c->end_ != __p) + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + } + } + __get_db()->unlock(); +#endif + __node_pointer __np = __n->__as_node(); + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::erase(const_iterator __p) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::erase(iterator) called with an iterator not" + " referring to this list"); +#endif + _LIBCPP_ASSERT(__p != end(), + "list::erase(iterator) called with a non-dereferenceable iterator"); + __node_allocator& __na = base::__node_alloc(); + __link_pointer __n = __p.__ptr_; + __link_pointer __r = __n->__next_; + base::__unlink_nodes(__n, __n); + --base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + __c_node* __c = __get_db()->__find_c_and_lock(this); + for (__i_node** __ip = __c->end_; __ip != __c->beg_; ) + { + --__ip; + iterator* __i = static_cast<iterator*>((*__ip)->__i_); + if (__i->__ptr_ == __n) + { + (*__ip)->__c_ = nullptr; + if (--__c->end_ != __ip) + _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*)); + } + } + __get_db()->unlock(); +#endif + __node_pointer __np = __n->__as_node(); + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__r, this); +#else + return iterator(__r); +#endif +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this, + "list::erase(iterator, iterator) called with an iterator not" + " referring to this list"); + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == this, + "list::erase(iterator, iterator) called with an iterator not" + " referring to this list"); +#endif + if (__f != __l) + { + __node_allocator& __na = base::__node_alloc(); + base::__unlink_nodes(__f.__ptr_, __l.__ptr_->__prev_); + while (__f != __l) + { + __link_pointer __n = __f.__ptr_; + ++__f; + --base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + __c_node* __c = __get_db()->__find_c_and_lock(this); + for (__i_node** __p = __c->end_; __p != __c->beg_; ) + { + --__p; + iterator* __i = static_cast<iterator*>((*__p)->__i_); + if (__i->__ptr_ == __n) + { + (*__p)->__c_ = nullptr; + if (--__c->end_ != __p) + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + } + } + __get_db()->unlock(); +#endif + __node_pointer __np = __n->__as_node(); + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); + } + } +#if _LIBCPP_DEBUG_LEVEL == 2 + return iterator(__l.__ptr_, this); +#else + return iterator(__l.__ptr_); +#endif +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::resize(size_type __n) +{ + if (__n < base::__sz()) + erase(__iterator(__n), end()); + else if (__n > base::__sz()) + { + __n -= base::__sz(); + size_type __ds = 0; + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); + ++__ds; +#if _LIBCPP_DEBUG_LEVEL == 2 + iterator __r = iterator(__hold.release()->__as_link(), this); +#else + iterator __r = iterator(__hold.release()->__as_link()); +#endif + iterator __e = __r; +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) + { + __hold.reset(__node_alloc_traits::allocate(__na, 1)); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); + __e.__ptr_->__next_ = __hold.get()->__as_link(); + __hold->__prev_ = __e.__ptr_; + __hold.release(); + } +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + while (true) + { + __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); + if (__prev == 0) + break; +#if _LIBCPP_DEBUG_LEVEL == 2 + __e = iterator(__prev, this); +#else + __e = iterator(__prev); +#endif + } + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + __link_nodes_at_back(__r.__ptr_, __e.__ptr_); + base::__sz() += __ds; + } +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x) +{ + if (__n < base::__sz()) + erase(__iterator(__n), end()); + else if (__n > base::__sz()) + { + __n -= base::__sz(); + size_type __ds = 0; + __node_allocator& __na = base::__node_alloc(); + __hold_pointer __hold = __allocate_node(__na); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + ++__ds; + __link_pointer __nl = __hold.release()->__as_link(); +#if _LIBCPP_DEBUG_LEVEL == 2 + iterator __r = iterator(__nl, this); +#else + iterator __r = iterator(__nl); +#endif + iterator __e = __r; +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + for (--__n; __n != 0; --__n, (void) ++__e, ++__ds) + { + __hold.reset(__node_alloc_traits::allocate(__na, 1)); + __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); + __e.__ptr_->__next_ = __hold.get()->__as_link(); + __hold->__prev_ = __e.__ptr_; + __hold.release(); + } +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + while (true) + { + __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); + if (__prev == 0) + break; +#if _LIBCPP_DEBUG_LEVEL == 2 + __e = iterator(__prev, this); +#else + __e = iterator(__prev); +#endif + } + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + __link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_); + base::__sz() += __ds; + } +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::splice(const_iterator __p, list& __c) +{ + _LIBCPP_ASSERT(this != &__c, + "list::splice(iterator, list) called with this == &list"); +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::splice(iterator, list) called with an iterator not" + " referring to this list"); +#endif + if (!__c.empty()) + { + __link_pointer __f = __c.__end_.__next_; + __link_pointer __l = __c.__end_.__prev_; + base::__unlink_nodes(__f, __l); + __link_nodes(__p.__ptr_, __f, __l); + base::__sz() += __c.__sz(); + __c.__sz() = 0; +#if _LIBCPP_DEBUG_LEVEL == 2 + if (&__c != this) { + __libcpp_db* __db = __get_db(); + __c_node* __cn1 = __db->__find_c_and_lock(this); + __c_node* __cn2 = __db->__find_c(&__c); + for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) + { + --__ip; + iterator* __i = static_cast<iterator*>((*__ip)->__i_); + if (__i->__ptr_ != __c.__end_as_link()) + { + __cn1->__add(*__ip); + (*__ip)->__c_ = __cn1; + if (--__cn2->end_ != __ip) + memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + } + } + __db->unlock(); + } +#endif + } +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::splice(iterator, list, iterator) called with the first iterator" + " not referring to this list"); + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c, + "list::splice(iterator, list, iterator) called with the second iterator" + " not referring to the list argument"); + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i), + "list::splice(iterator, list, iterator) called with the second iterator" + " not dereferenceable"); +#endif + if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_) + { + __link_pointer __f = __i.__ptr_; + base::__unlink_nodes(__f, __f); + __link_nodes(__p.__ptr_, __f, __f); + --__c.__sz(); + ++base::__sz(); +#if _LIBCPP_DEBUG_LEVEL == 2 + if (&__c != this) { + __libcpp_db* __db = __get_db(); + __c_node* __cn1 = __db->__find_c_and_lock(this); + __c_node* __cn2 = __db->__find_c(&__c); + for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) + { + --__ip; + iterator* __j = static_cast<iterator*>((*__ip)->__i_); + if (__j->__ptr_ == __f) + { + __cn1->__add(*__ip); + (*__ip)->__c_ = __cn1; + if (--__cn2->end_ != __ip) + _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + } + } + __db->unlock(); + } +#endif + } +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l) +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "list::splice(iterator, list, iterator, iterator) called with first iterator not" + " referring to this list"); + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c, + "list::splice(iterator, list, iterator, iterator) called with second iterator not" + " referring to the list argument"); + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == &__c, + "list::splice(iterator, list, iterator, iterator) called with third iterator not" + " referring to the list argument"); + if (this == &__c) + { + for (const_iterator __i = __f; __i != __l; ++__i) + _LIBCPP_ASSERT(__i != __p, + "list::splice(iterator, list, iterator, iterator)" + " called with the first iterator within the range" + " of the second and third iterators"); + } +#endif + if (__f != __l) + { + __link_pointer __first = __f.__ptr_; + --__l; + __link_pointer __last = __l.__ptr_; + if (this != &__c) + { + size_type __s = _VSTD::distance(__f, __l) + 1; + __c.__sz() -= __s; + base::__sz() += __s; + } + base::__unlink_nodes(__first, __last); + __link_nodes(__p.__ptr_, __first, __last); +#if _LIBCPP_DEBUG_LEVEL == 2 + if (&__c != this) { + __libcpp_db* __db = __get_db(); + __c_node* __cn1 = __db->__find_c_and_lock(this); + __c_node* __cn2 = __db->__find_c(&__c); + for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) + { + --__ip; + iterator* __j = static_cast<iterator*>((*__ip)->__i_); + for (__link_pointer __k = __f.__ptr_; + __k != __l.__ptr_; __k = __k->__next_) + { + if (__j->__ptr_ == __k) + { + __cn1->__add(*__ip); + (*__ip)->__c_ = __cn1; + if (--__cn2->end_ != __ip) + _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + } + } + } + __db->unlock(); + } +#endif + } +} + +template <class _Tp, class _Alloc> +typename list<_Tp, _Alloc>::__remove_return_type +list<_Tp, _Alloc>::remove(const value_type& __x) +{ + list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing + for (const_iterator __i = begin(), __e = end(); __i != __e;) + { + if (*__i == __x) + { + const_iterator __j = _VSTD::next(__i); + for (; __j != __e && *__j == __x; ++__j) + ; + __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); + __i = __j; + if (__i != __e) + ++__i; + } + else + ++__i; + } + + return (__remove_return_type) __deleted_nodes.size(); +} + +template <class _Tp, class _Alloc> +template <class _Pred> +typename list<_Tp, _Alloc>::__remove_return_type +list<_Tp, _Alloc>::remove_if(_Pred __pred) +{ + list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing + for (iterator __i = begin(), __e = end(); __i != __e;) + { + if (__pred(*__i)) + { + iterator __j = _VSTD::next(__i); + for (; __j != __e && __pred(*__j); ++__j) + ; + __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); + __i = __j; + if (__i != __e) + ++__i; + } + else + ++__i; + } + + return (__remove_return_type) __deleted_nodes.size(); +} + +template <class _Tp, class _Alloc> +template <class _BinaryPred> +typename list<_Tp, _Alloc>::__remove_return_type +list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred) +{ + list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing + for (iterator __i = begin(), __e = end(); __i != __e;) + { + iterator __j = _VSTD::next(__i); + for (; __j != __e && __binary_pred(*__i, *__j); ++__j) + ; + if (++__i != __j) { + __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); + __i = __j; + } + } + + return (__remove_return_type) __deleted_nodes.size(); +} + +template <class _Tp, class _Alloc> +inline +void +list<_Tp, _Alloc>::merge(list& __c) +{ + merge(__c, __less<value_type>()); +} + +template <class _Tp, class _Alloc> +template <class _Comp> +void +list<_Tp, _Alloc>::merge(list& __c, _Comp __comp) +{ + if (this != _VSTD::addressof(__c)) + { + iterator __f1 = begin(); + iterator __e1 = end(); + iterator __f2 = __c.begin(); + iterator __e2 = __c.end(); + while (__f1 != __e1 && __f2 != __e2) + { + if (__comp(*__f2, *__f1)) + { + size_type __ds = 1; + iterator __m2 = _VSTD::next(__f2); + for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, (void) ++__ds) + ; + base::__sz() += __ds; + __c.__sz() -= __ds; + __link_pointer __f = __f2.__ptr_; + __link_pointer __l = __m2.__ptr_->__prev_; + __f2 = __m2; + base::__unlink_nodes(__f, __l); + __m2 = _VSTD::next(__f1); + __link_nodes(__f1.__ptr_, __f, __l); + __f1 = __m2; + } + else + ++__f1; + } + splice(__e1, __c); +#if _LIBCPP_DEBUG_LEVEL == 2 + __libcpp_db* __db = __get_db(); + __c_node* __cn1 = __db->__find_c_and_lock(this); + __c_node* __cn2 = __db->__find_c(&__c); + for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;) + { + --__p; + iterator* __i = static_cast<iterator*>((*__p)->__i_); + if (__i->__ptr_ != __c.__end_as_link()) + { + __cn1->__add(*__p); + (*__p)->__c_ = __cn1; + if (--__cn2->end_ != __p) + _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); + } + } + __db->unlock(); +#endif + } +} + +template <class _Tp, class _Alloc> +inline +void +list<_Tp, _Alloc>::sort() +{ + sort(__less<value_type>()); +} + +template <class _Tp, class _Alloc> +template <class _Comp> +inline +void +list<_Tp, _Alloc>::sort(_Comp __comp) +{ + __sort(begin(), end(), base::__sz(), __comp); +} + +template <class _Tp, class _Alloc> +template <class _Comp> +typename list<_Tp, _Alloc>::iterator +list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp) +{ + switch (__n) + { + case 0: + case 1: + return __f1; + case 2: + if (__comp(*--__e2, *__f1)) + { + __link_pointer __f = __e2.__ptr_; + base::__unlink_nodes(__f, __f); + __link_nodes(__f1.__ptr_, __f, __f); + return __e2; + } + return __f1; + } + size_type __n2 = __n / 2; + iterator __e1 = _VSTD::next(__f1, __n2); + iterator __r = __f1 = __sort(__f1, __e1, __n2, __comp); + iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp); + if (__comp(*__f2, *__f1)) + { + iterator __m2 = _VSTD::next(__f2); + for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2) + ; + __link_pointer __f = __f2.__ptr_; + __link_pointer __l = __m2.__ptr_->__prev_; + __r = __f2; + __e1 = __f2 = __m2; + base::__unlink_nodes(__f, __l); + __m2 = _VSTD::next(__f1); + __link_nodes(__f1.__ptr_, __f, __l); + __f1 = __m2; + } + else + ++__f1; + while (__f1 != __e1 && __f2 != __e2) + { + if (__comp(*__f2, *__f1)) + { + iterator __m2 = _VSTD::next(__f2); + for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2) + ; + __link_pointer __f = __f2.__ptr_; + __link_pointer __l = __m2.__ptr_->__prev_; + if (__e1 == __f2) + __e1 = __m2; + __f2 = __m2; + base::__unlink_nodes(__f, __l); + __m2 = _VSTD::next(__f1); + __link_nodes(__f1.__ptr_, __f, __l); + __f1 = __m2; + } + else + ++__f1; + } + return __r; +} + +template <class _Tp, class _Alloc> +void +list<_Tp, _Alloc>::reverse() _NOEXCEPT +{ + if (base::__sz() > 1) + { + iterator __e = end(); + for (iterator __i = begin(); __i.__ptr_ != __e.__ptr_;) + { + _VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_); + __i.__ptr_ = __i.__ptr_->__prev_; + } + _VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_); + } +} + +template <class _Tp, class _Alloc> +bool +list<_Tp, _Alloc>::__invariants() const +{ + return size() == _VSTD::distance(begin(), end()); +} + +#if _LIBCPP_DEBUG_LEVEL == 2 + +template <class _Tp, class _Alloc> +bool +list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const +{ + return __i->__ptr_ != this->__end_as_link(); +} + +template <class _Tp, class _Alloc> +bool +list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const +{ + return !empty() && __i->__ptr_ != base::__end_.__next_; +} + +template <class _Tp, class _Alloc> +bool +list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const +{ + return false; +} + +template <class _Tp, class _Alloc> +bool +list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const +{ + return false; +} + +#endif // _LIBCPP_DEBUG_LEVEL == 2 + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return !(__x == __y); +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return __y < __x; +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return !(__x < __y); +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) +{ + return !(__y < __x); +} + +template <class _Tp, class _Alloc> +inline _LIBCPP_INLINE_VISIBILITY +void +swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) + _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) +{ + __x.swap(__y); +} + +#if _LIBCPP_STD_VER > 17 +template <class _Tp, class _Allocator, class _Predicate> +inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type +erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) { + return __c.remove_if(__pred); +} + +template <class _Tp, class _Allocator, class _Up> +inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type +erase(list<_Tp, _Allocator>& __c, const _Up& __v) { + return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; }); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP_LIST + + +====================File: include/version==================== +// -*- C++ -*- +//===--------------------------- version ----------------------------------===// +// +// 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_VERSIONH +#define _LIBCPP_VERSIONH + +/* + version synopsis + +Macro name Value Headers +__cpp_lib_addressof_constexpr 201603L <memory> +__cpp_lib_allocator_traits_is_always_equal 201411L <deque> <forward_list> <list> + <map> <memory> <scoped_allocator> + <set> <string> <unordered_map> + <unordered_set> <vector> +__cpp_lib_any 201606L <any> +__cpp_lib_apply 201603L <tuple> +__cpp_lib_array_constexpr 201811L <array> <iterator> + 201603L // C++17 +__cpp_lib_as_const 201510L <utility> +__cpp_lib_assume_aligned 201811L <memory> +__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_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_front 201907L <functional> +__cpp_lib_bit_cast 201806L <bit> +__cpp_lib_bitops 201907L <bit> +__cpp_lib_bool_constant 201505L <type_traits> +__cpp_lib_bounded_array_traits 201902L <type_traits> +__cpp_lib_boyer_moore_searcher 201603L <functional> +__cpp_lib_byte 201603L <cstddef> +__cpp_lib_char8_t 201907L <atomic> <filesystem> <istream> + <limits> <locale> <ostream> + <string> <string_view> +__cpp_lib_chrono 201611L <chrono> +__cpp_lib_chrono_udls 201304L <chrono> +__cpp_lib_clamp 201603L <algorithm> +__cpp_lib_complex_udls 201309L <complex> +__cpp_lib_concepts 202002L <concepts> +__cpp_lib_constexpr_algorithms 201806L <algorithm> +__cpp_lib_constexpr_complex 201711L <complex> +__cpp_lib_constexpr_dynamic_alloc 201907L <memory> +__cpp_lib_constexpr_functional 201907L <functional> +__cpp_lib_constexpr_iterator 201811L <iterator> +__cpp_lib_constexpr_memory 201811L <memory> +__cpp_lib_constexpr_numeric 201911L <numeric> +__cpp_lib_constexpr_string 201811L <string> +__cpp_lib_constexpr_string_view 201811L <string_view> +__cpp_lib_constexpr_tuple 201811L <tuple> +__cpp_lib_constexpr_utility 201811L <utility> +__cpp_lib_constexpr_vector 201907L <vector> +__cpp_lib_coroutine 201902L <coroutine> +__cpp_lib_destroying_delete 201806L <new> +__cpp_lib_enable_shared_from_this 201603L <memory> +__cpp_lib_endian 201907L <bit> +__cpp_lib_erase_if 202002L <deque> <forward_list> <list> + <map> <set> <string> + <unordered_map> <unordered_set> <vector> +__cpp_lib_exchange_function 201304L <utility> +__cpp_lib_execution 201902L <execution> + 201603L // C++17 +__cpp_lib_filesystem 201703L <filesystem> +__cpp_lib_format 201907L <format> +__cpp_lib_gcd_lcm 201606L <numeric> +__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> +__cpp_lib_has_unique_object_representations 201606L <type_traits> +__cpp_lib_hypot 201603L <cmath> +__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector> +__cpp_lib_int_pow2 202002L <bit> +__cpp_lib_integer_comparison_functions 202002L <utility> +__cpp_lib_integer_sequence 201304L <utility> +__cpp_lib_integral_constant_callable 201304L <type_traits> +__cpp_lib_interpolate 201902L <cmath> <numeric> +__cpp_lib_invoke 201411L <functional> +__cpp_lib_is_aggregate 201703L <type_traits> +__cpp_lib_is_constant_evaluated 201811L <type_traits> +__cpp_lib_is_final 201402L <type_traits> +__cpp_lib_is_invocable 201703L <type_traits> +__cpp_lib_is_layout_compatible 201907L <type_traits> +__cpp_lib_is_nothrow_convertible 201806L <type_traits> +__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_jthread 201911L <stop_token> <thread> +__cpp_lib_latch 201907L <latch> +__cpp_lib_launder 201606L <new> +__cpp_lib_list_remove_return_type 201806L <forward_list> <list> +__cpp_lib_logical_traits 201510L <type_traits> +__cpp_lib_make_from_tuple 201606L <tuple> +__cpp_lib_make_reverse_iterator 201402L <iterator> +__cpp_lib_make_unique 201304L <memory> +__cpp_lib_map_try_emplace 201411L <map> +__cpp_lib_math_constants 201907L <numbers> +__cpp_lib_math_special_functions 201603L <cmath> +__cpp_lib_memory_resource 201603L <memory_resource> +__cpp_lib_node_extract 201606L <map> <set> <unordered_map> + <unordered_set> +__cpp_lib_nonmember_container_access 201411L <array> <deque> <forward_list> + <iterator> <list> <map> + <regex> <set> <string> + <unordered_map> <unordered_set> <vector> +__cpp_lib_not_fn 201603L <functional> +__cpp_lib_null_iterators 201304L <iterator> +__cpp_lib_optional 201606L <optional> +__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric> +__cpp_lib_polymorphic_allocator 201902L <memory> +__cpp_lib_quoted_string_io 201304L <iomanip> +__cpp_lib_ranges 201811L <algorithm> <functional> <iterator> + <memory> <ranges> +__cpp_lib_raw_memory_algorithms 201606L <memory> +__cpp_lib_remove_cvref 201711L <type_traits> +__cpp_lib_result_of_sfinae 201210L <functional> <type_traits> +__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm> +__cpp_lib_sample 201603L <algorithm> +__cpp_lib_scoped_lock 201703L <mutex> +__cpp_lib_semaphore 201907L <semaphore> +__cpp_lib_shared_mutex 201505L <shared_mutex> +__cpp_lib_shared_ptr_arrays 201611L <memory> +__cpp_lib_shared_ptr_weak_type 201606L <memory> +__cpp_lib_shared_timed_mutex 201402L <shared_mutex> +__cpp_lib_shift 201806L <algorithm> +__cpp_lib_smart_ptr_for_overwrite 202002L <memory> +__cpp_lib_source_location 201907L <source_location> +__cpp_lib_span 202002L <span> +__cpp_lib_ssize 201902L <iterator> +__cpp_lib_stacktrace 202011L <stacktrace> +__cpp_lib_starts_ends_with 201711L <string> <string_view> +__cpp_lib_stdatomic_h 202011L <stdatomic.h> +__cpp_lib_string_contains 202011L <string> <string_view> +__cpp_lib_string_udls 201304L <string> +__cpp_lib_string_view 201803L <string> <string_view> + 201606L // C++17 +__cpp_lib_syncbuf 201803L <syncstream> +__cpp_lib_three_way_comparison 201907L <compare> +__cpp_lib_to_address 201711L <memory> +__cpp_lib_to_array 201907L <array> +__cpp_lib_to_chars 201611L <utility> +__cpp_lib_to_underlying 202102L <utility> +__cpp_lib_transformation_trait_aliases 201304L <type_traits> +__cpp_lib_transparent_operators 201510L <functional> <memory> + 201210L // C++14 +__cpp_lib_tuple_element_t 201402L <tuple> +__cpp_lib_tuples_by_type 201304L <tuple> <utility> +__cpp_lib_type_trait_variable_templates 201510L <type_traits> +__cpp_lib_uncaught_exceptions 201411L <exception> +__cpp_lib_unordered_map_try_emplace 201411L <unordered_map> +__cpp_lib_unwrap_ref 201811L <functional> +__cpp_lib_variant 202102L <variant> +__cpp_lib_void_t 201411L <type_traits> + +*/ + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +// clang-format off + +#if _LIBCPP_STD_VER > 11 +# define __cpp_lib_chrono_udls 201304L +# define __cpp_lib_complex_udls 201309L +# define __cpp_lib_exchange_function 201304L +# define __cpp_lib_generic_associative_lookup 201304L +# define __cpp_lib_integer_sequence 201304L +# define __cpp_lib_integral_constant_callable 201304L +# define __cpp_lib_is_final 201402L +# define __cpp_lib_is_null_pointer 201309L +# define __cpp_lib_make_reverse_iterator 201402L +# define __cpp_lib_make_unique 201304L +# define __cpp_lib_null_iterators 201304L +# define __cpp_lib_quoted_string_io 201304L +# define __cpp_lib_result_of_sfinae 201210L +# define __cpp_lib_robust_nonmodifying_seq_ops 201304L +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex) +# define __cpp_lib_shared_timed_mutex 201402L +# endif +# define __cpp_lib_string_udls 201304L +# define __cpp_lib_transformation_trait_aliases 201304L +# define __cpp_lib_transparent_operators 201210L +# define __cpp_lib_tuple_element_t 201402L +# define __cpp_lib_tuples_by_type 201304L +#endif + +#if _LIBCPP_STD_VER > 14 +# define __cpp_lib_addressof_constexpr 201603L +# define __cpp_lib_allocator_traits_is_always_equal 201411L +# define __cpp_lib_any 201606L +# define __cpp_lib_apply 201603L +# if defined(_MSC_VER) && _MSC_VER >= 1926 +# define __cpp_lib_array_constexpr 201803L +# else +# define __cpp_lib_array_constexpr 201603L +# endif +# define __cpp_lib_as_const 201510L +# if !defined(_LIBCPP_HAS_NO_THREADS) +# define __cpp_lib_atomic_is_always_lock_free 201603L +# endif +# define __cpp_lib_bool_constant 201505L +// # define __cpp_lib_boyer_moore_searcher 201603L +# define __cpp_lib_byte 201603L +# define __cpp_lib_chrono 201611L +# define __cpp_lib_clamp 201603L +# define __cpp_lib_enable_shared_from_this 201603L +// # define __cpp_lib_execution 201603L +# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem) +# define __cpp_lib_filesystem 201703L +# endif +# define __cpp_lib_gcd_lcm 201606L +// # define __cpp_lib_hardware_interference_size 201703L +# define __cpp_lib_has_unique_object_representations 201606L +# define __cpp_lib_hypot 201603L +# define __cpp_lib_incomplete_container_elements 201505L +# define __cpp_lib_invoke 201411L +# define __cpp_lib_is_aggregate 201703L +# define __cpp_lib_is_invocable 201703L +# define __cpp_lib_is_swappable 201603L +# define __cpp_lib_launder 201606L +# define __cpp_lib_logical_traits 201510L +# define __cpp_lib_make_from_tuple 201606L +# define __cpp_lib_map_try_emplace 201411L +// # define __cpp_lib_math_special_functions 201603L +// # define __cpp_lib_memory_resource 201603L +# define __cpp_lib_node_extract 201606L +# define __cpp_lib_nonmember_container_access 201411L +# define __cpp_lib_not_fn 201603L +# define __cpp_lib_optional 201606L +// # define __cpp_lib_parallel_algorithm 201603L +# define __cpp_lib_raw_memory_algorithms 201606L +# define __cpp_lib_sample 201603L +# define __cpp_lib_scoped_lock 201703L +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex) +# define __cpp_lib_shared_mutex 201505L +# endif +# define __cpp_lib_shared_ptr_arrays 201611L +# define __cpp_lib_shared_ptr_weak_type 201606L +# if defined(_MSC_VER) && _MSC_VER >= 1926 +# define __cpp_lib_string_view 201803L +# else +# define __cpp_lib_string_view 201606L +# endif +// # define __cpp_lib_to_chars 201611L +# undef __cpp_lib_transparent_operators +# define __cpp_lib_transparent_operators 201510L +# define __cpp_lib_type_trait_variable_templates 201510L +# define __cpp_lib_uncaught_exceptions 201411L +# define __cpp_lib_unordered_map_try_emplace 201411L +# define __cpp_lib_variant 202102L +# define __cpp_lib_void_t 201411L +#endif + +#if _LIBCPP_STD_VER > 17 +# undef __cpp_lib_array_constexpr +# define __cpp_lib_array_constexpr 201811L +// # define __cpp_lib_assume_aligned 201811L +# if !defined(_LIBCPP_HAS_NO_THREADS) +# define __cpp_lib_atomic_flag_test 201907L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) +// # define __cpp_lib_atomic_float 201711L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) +# define __cpp_lib_atomic_lock_free_type_aliases 201907L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) +// # define __cpp_lib_atomic_ref 201806L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) +// # define __cpp_lib_atomic_shared_ptr 201711L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) +# define __cpp_lib_atomic_value_initialization 201911L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait) +# define __cpp_lib_atomic_wait 201907L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier) +# define __cpp_lib_barrier 201907L +# endif +# define __cpp_lib_bind_front 201907L +# define __cpp_lib_bit_cast 201806L +// # define __cpp_lib_bitops 201907L +# define __cpp_lib_bounded_array_traits 201902L +# if !defined(_LIBCPP_HAS_NO_CHAR8_T) +# define __cpp_lib_char8_t 201907L +# endif +# define __cpp_lib_concepts 202002L +# define __cpp_lib_constexpr_algorithms 201806L +// # define __cpp_lib_constexpr_complex 201711L +# define __cpp_lib_constexpr_dynamic_alloc 201907L +# define __cpp_lib_constexpr_functional 201907L +# define __cpp_lib_constexpr_iterator 201811L +# define __cpp_lib_constexpr_memory 201811L +# define __cpp_lib_constexpr_numeric 201911L +# define __cpp_lib_constexpr_string 201811L +# define __cpp_lib_constexpr_string_view 201811L +# define __cpp_lib_constexpr_tuple 201811L +# define __cpp_lib_constexpr_utility 201811L +// # define __cpp_lib_constexpr_vector 201907L +// # define __cpp_lib_coroutine 201902L +# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L +# define __cpp_lib_destroying_delete 201806L +# endif +# define __cpp_lib_endian 201907L +# define __cpp_lib_erase_if 202002L +# undef __cpp_lib_execution +// # define __cpp_lib_execution 201902L +# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) +// # define __cpp_lib_format 201907L +# endif +# define __cpp_lib_generic_unordered_lookup 201811L +# define __cpp_lib_int_pow2 202002L +# if !defined(_LIBCPP_HAS_NO_CONCEPTS) +# define __cpp_lib_integer_comparison_functions 202002L +# endif +# define __cpp_lib_interpolate 201902L +# define __cpp_lib_is_constant_evaluated 201811L +// # define __cpp_lib_is_layout_compatible 201907L +# define __cpp_lib_is_nothrow_convertible 201806L +// # define __cpp_lib_is_pointer_interconvertible 201907L +# if !defined(_LIBCPP_HAS_NO_THREADS) +// # define __cpp_lib_jthread 201911L +# endif +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch) +# define __cpp_lib_latch 201907L +# endif +# define __cpp_lib_list_remove_return_type 201806L +# if !defined(_LIBCPP_HAS_NO_CONCEPTS) +# define __cpp_lib_math_constants 201907L +# endif +// # define __cpp_lib_polymorphic_allocator 201902L +// # define __cpp_lib_ranges 201811L +# define __cpp_lib_remove_cvref 201711L +# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore) +# define __cpp_lib_semaphore 201907L +# endif +# define __cpp_lib_shift 201806L +// # define __cpp_lib_smart_ptr_for_overwrite 202002L +// # define __cpp_lib_source_location 201907L +# define __cpp_lib_span 202002L +# define __cpp_lib_ssize 201902L +# define __cpp_lib_starts_ends_with 201711L +# undef __cpp_lib_string_view +# define __cpp_lib_string_view 201803L +// # define __cpp_lib_syncbuf 201803L +// # define __cpp_lib_three_way_comparison 201907L +# define __cpp_lib_to_address 201711L +# define __cpp_lib_to_array 201907L +# define __cpp_lib_unwrap_ref 201811L +#endif + +#if _LIBCPP_STD_VER > 20 +# define __cpp_lib_is_scoped_enum 202011L +// # define __cpp_lib_stacktrace 202011L +// # define __cpp_lib_stdatomic_h 202011L +# define __cpp_lib_string_contains 202011L +# define __cpp_lib_to_underlying 202102L +#endif + +// clang-format on + +#endif // _LIBCPP_VERSIONH + + ====================MIT==================== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/contrib/libs/cxxsupp/libcxx/import b/contrib/libs/cxxsupp/libcxx/import index 9b93145897..e9678f8fe9 100755 --- a/contrib/libs/cxxsupp/libcxx/import +++ b/contrib/libs/cxxsupp/libcxx/import @@ -1,7 +1,7 @@ #!/bin/sh -e rev=968e2739 -output_dir="libcxx-r$rev" +output_dir="libcxx-r$rev" if [ -z $1 ] ; then git clone https://github.com/llvm/llvm-project.git --no-checkout "$output_dir/tmp" else diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config index bdc54b92d1..779575d0f7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config +++ b/contrib/libs/cxxsupp/libcxx/include/__config @@ -963,7 +963,7 @@ typedef unsigned int char32_t; #define _LIBCPP_WCTYPE_IS_MASK #endif -#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t) +#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t) #define _LIBCPP_HAS_NO_CHAR8_T #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config b/contrib/libs/cxxsupp/libcxx/include/__wrappers_config index 934e7c9279..8231a777cc 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config +++ b/contrib/libs/cxxsupp/libcxx/include/__wrappers_config @@ -1,31 +1,31 @@ #pragma once -#if !defined(NDEBUG) && !defined(_LIBCPP_DEBUG) -# define _LIBCPP_DEBUG 0 +#if !defined(NDEBUG) && !defined(_LIBCPP_DEBUG) +# define _LIBCPP_DEBUG 0 #endif - -#ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS -# define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1 -#endif - -#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 -# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 1 -# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 0 -# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 1 -#else -# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 0 -# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 1 -# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 0 -#endif - -#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 && (!defined(_LIBCPP_DEBUG) || _LIBCPP_DEBUG == 0) -# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 1 -# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 1 -#else -# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 0 -# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 0 + +#ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS +# define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1 #endif +#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 +# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 1 +# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 0 +# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 1 +#else +# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 0 +# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 1 +# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 0 +#endif + +#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 && (!defined(_LIBCPP_DEBUG) || _LIBCPP_DEBUG == 0) +# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 1 +# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 1 +#else +# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 0 +# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 0 +#endif + #define _YNDX_WIN32_NOFILESYSTEM_RUNTIME #define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS @@ -35,5 +35,5 @@ #define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS #ifdef _musl_ -# define _LIBCPP_HAS_MUSL_LIBC +# define _LIBCPP_HAS_MUSL_LIBC #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/array b/contrib/libs/cxxsupp/libcxx/include/array index 0ddfc955af..1075d03fc0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/array +++ b/contrib/libs/cxxsupp/libcxx/include/array @@ -32,24 +32,24 @@ struct array typedef std::reverse_iterator<const_iterator> const_reverse_iterator; // No explicit construct/copy/destroy for aggregate type - void fill(const T& u); // constexpr in C++20 - void swap(array& a) noexcept(is_nothrow_swappable_v<T>); // constexpr in C++20 + void fill(const T& u); // constexpr in C++20 + void swap(array& a) noexcept(is_nothrow_swappable_v<T>); // constexpr in C++20 // iterators: - iterator begin() noexcept; // constexpr in C++17 - const_iterator begin() const noexcept; // constexpr in C++17 - iterator end() noexcept; // constexpr in C++17 - const_iterator end() const noexcept; // constexpr in C++17 + iterator begin() noexcept; // constexpr in C++17 + const_iterator begin() const noexcept; // constexpr in C++17 + iterator end() noexcept; // constexpr in C++17 + const_iterator end() const noexcept; // constexpr in C++17 - reverse_iterator rbegin() noexcept; // constexpr in C++17 - const_reverse_iterator rbegin() const noexcept; // constexpr in C++17 - reverse_iterator rend() noexcept; // constexpr in C++17 - const_reverse_iterator rend() const noexcept; // constexpr in C++17 + reverse_iterator rbegin() noexcept; // constexpr in C++17 + const_reverse_iterator rbegin() const noexcept; // constexpr in C++17 + reverse_iterator rend() noexcept; // constexpr in C++17 + const_reverse_iterator rend() const noexcept; // constexpr in C++17 - const_iterator cbegin() const noexcept; // constexpr in C++17 - const_iterator cend() const noexcept; // constexpr in C++17 - const_reverse_iterator crbegin() const noexcept; // constexpr in C++17 - const_reverse_iterator crend() const noexcept; // constexpr in C++17 + const_iterator cbegin() const noexcept; // constexpr in C++17 + const_iterator cend() const noexcept; // constexpr in C++17 + const_reverse_iterator crbegin() const noexcept; // constexpr in C++17 + const_reverse_iterator crend() const noexcept; // constexpr in C++17 // capacity: constexpr size_type size() const noexcept; @@ -57,51 +57,51 @@ struct array constexpr bool empty() const noexcept; // element access: - reference operator[](size_type n); // constexpr in C++17 - const_reference operator[](size_type n) const; // constexpr in C++14 - reference at(size_type n); // constexpr in C++17 - const_reference at(size_type n) const; // constexpr in C++14 - - reference front(); // constexpr in C++17 - const_reference front() const; // constexpr in C++14 - reference back(); // constexpr in C++17 - const_reference back() const; // constexpr in C++14 - - T* data() noexcept; // constexpr in C++17 - const T* data() const noexcept; // constexpr in C++17 + reference operator[](size_type n); // constexpr in C++17 + const_reference operator[](size_type n) const; // constexpr in C++14 + reference at(size_type n); // constexpr in C++17 + const_reference at(size_type n) const; // constexpr in C++14 + + reference front(); // constexpr in C++17 + const_reference front() const; // constexpr in C++14 + reference back(); // constexpr in C++17 + const_reference back() const; // constexpr in C++14 + + T* data() noexcept; // constexpr in C++17 + const T* data() const noexcept; // constexpr in C++17 }; -template <class T, class... U> - array(T, U...) -> array<T, 1 + sizeof...(U)>; // C++17 +template <class T, class... U> + array(T, U...) -> array<T, 1 + sizeof...(U)>; // C++17 template <class T, size_t N> - bool operator==(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator==(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator!=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator!=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator<(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator<(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator>(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator>(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator<=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator<=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator>=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator>=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N > - void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 - -template <class T, size_t N> - constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); // C++20 -template <class T, size_t N> - constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); // C++20 + void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 +template <class T, size_t N> + constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); // C++20 +template <class T, size_t N> + constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); // C++20 + template <class T> struct tuple_size; template <size_t I, class T> struct tuple_element; template <class T, size_t N> struct tuple_size<array<T, N>>; template <size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>; -template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 -template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14 -template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14 template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexcept; // constexpr in C++14 } // std @@ -139,20 +139,20 @@ struct _LIBCPP_TEMPLATE_VIS array typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef _VSTD::reverse_iterator<iterator> reverse_iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _Tp __elems_[_Size]; // No explicit construct/copy/destroy for aggregate type - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 - void fill(const value_type& __u) { - _VSTD::fill_n(data(), _Size, __u); + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void fill(const value_type& __u) { + _VSTD::fill_n(data(), _Size, __u); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - _VSTD::swap_ranges(data(), data() + _Size, __a.data()); + _VSTD::swap_ranges(data(), data() + _Size, __a.data()); } // iterators: @@ -189,39 +189,39 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;} _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} + _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} // element access: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reference operator[](size_type __n) _NOEXCEPT { - _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); - return __elems_[__n]; - } + reference operator[](size_type __n) _NOEXCEPT { + _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); + return __elems_[__n]; + } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - const_reference operator[](size_type __n) const _NOEXCEPT { - _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); - return __elems_[__n]; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n) - { - if (__n >= _Size) - __throw_out_of_range("array::at"); - return __elems_[__n]; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const - { - if (__n >= _Size) - __throw_out_of_range("array::at"); - return __elems_[__n]; - } - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return (*this)[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return (*this)[_Size - 1];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return (*this)[_Size - 1];} - + const_reference operator[](size_type __n) const _NOEXCEPT { + _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); + return __elems_[__n]; + } + + _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n) + { + if (__n >= _Size) + __throw_out_of_range("array::at"); + return __elems_[__n]; + } + + _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const + { + if (__n >= _Size) + __throw_out_of_range("array::at"); + return __elems_[__n]; + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return (*this)[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return (*this)[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return (*this)[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 value_type* data() _NOEXCEPT {return __elems_;} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 @@ -242,8 +242,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef _VSTD::reverse_iterator<iterator> reverse_iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; typedef typename conditional<is_const<_Tp>::value, const char, char>::type _CharType; @@ -251,50 +251,50 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> struct _ArrayInStructT { _Tp __data_[1]; }; _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)]; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - value_type* data() _NOEXCEPT {return nullptr;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - const value_type* data() const _NOEXCEPT {return nullptr;} - + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + value_type* data() _NOEXCEPT {return nullptr;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + const value_type* data() const _NOEXCEPT {return nullptr;} + // No explicit construct/copy/destroy for aggregate type - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 - void fill(const value_type&) { + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void fill(const value_type&) { static_assert(!is_const<_Tp>::value, "cannot fill zero-sized array of type 'const T'"); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array&) _NOEXCEPT { static_assert(!is_const<_Tp>::value, "cannot swap zero-sized array of type 'const T'"); } // iterators: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 iterator begin() _NOEXCEPT {return iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator begin() const _NOEXCEPT {return const_iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 iterator end() _NOEXCEPT {return iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator end() const _NOEXCEPT {return const_iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator cbegin() const _NOEXCEPT {return begin();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator cend() const _NOEXCEPT {return end();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator crend() const _NOEXCEPT {return rend();} // capacity: @@ -306,7 +306,7 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return true;} // element access: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference operator[](size_type) _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); _LIBCPP_UNREACHABLE(); @@ -318,37 +318,37 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type) { __throw_out_of_range("array<T, 0>::at"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type) const { __throw_out_of_range("array<T, 0>::at"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); @@ -414,7 +414,7 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template <class _Tp, size_t _Size> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < _Size == 0 || @@ -497,7 +497,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) { static_assert( is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements."); - return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); + return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); } template <typename _Tp, size_t _Size> @@ -509,8 +509,8 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) { static_assert( is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements."); - return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr), - make_index_sequence<_Size>()); + return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr), + make_index_sequence<_Size>()); } #endif // _LIBCPP_STD_VER > 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/cxxabi.h b/contrib/libs/cxxsupp/libcxx/include/cxxabi.h index 3b1edaf75a..b3d950dd47 100644 --- a/contrib/libs/cxxsupp/libcxx/include/cxxabi.h +++ b/contrib/libs/cxxsupp/libcxx/include/cxxabi.h @@ -2,8 +2,8 @@ #if defined(__IOS__) || defined(__ANDROID__) #include_next <cxxabi.h> -#elif defined(_WIN32) -// pass +#elif defined(_WIN32) +// pass #else #include <contrib/libs/cxxsupp/libcxxrt/cxxabi.h> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/simd b/contrib/libs/cxxsupp/libcxx/include/experimental/simd index 59a7139585..782f82cda8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/simd +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/simd @@ -1,684 +1,684 @@ -// -*- C++ -*- -//===------------------------------- simd ---------------------------------===// -// +// -*- C++ -*- +//===------------------------------- simd ---------------------------------===// +// // 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_EXPERIMENTAL_SIMD -#define _LIBCPP_EXPERIMENTAL_SIMD - -/* - experimental/simd synopsis - -namespace std::experimental { - -inline namespace parallelism_v2 { - -namespace simd_abi { - -struct scalar {}; -template <int N> struct fixed_size {}; -template <typename T> inline constexpr int max_fixed_size = implementation-defined; -template <typename T> using compatible = implementation-defined; -template <typename T> using native = implementation-defined; - -} // simd_abi - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> struct overaligned_tag {}; -inline constexpr element_aligned_tag element_aligned{}; -inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; - -// traits [simd.traits] -template <class T> struct is_abi_tag; -template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; - -template <class T> struct is_simd; -template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; - -template <class T> struct is_simd_mask; -template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; - -template <class T> struct is_simd_flag_type; -template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; - -template <class T, size_t N> struct abi_for_size { using type = see below; }; -template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; - -template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; -template <class T, class Abi = simd_abi::compatible<T>> -inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; - -template <class T, class U = typename T::value_type> struct memory_alignment; -template <class T, class U = typename T::value_type> -inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; - -// class template simd [simd.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd; -template <class T> using native_simd = simd<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; - -// class template simd_mask [simd.mask.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; -template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; - -// casts [simd.casts] -template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); -template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); - -template <class T, class Abi> -fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; -template <class T, class Abi> -fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; -template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> -native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; -template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; - -template <size_t... Sizes, class T, class Abi> -tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); -template <size_t... Sizes, class T, class Abi> -tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd<typename V::value_type, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd_mask<typename V::value_type, Abi>&); - -template <class T, class... Abis> -simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); -template <class T, class... Abis> -simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); - -// reductions [simd.mask.reductions] -template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); -template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); - -bool all_of(see below) noexcept; -bool any_of(see below) noexcept; -bool none_of(see below) noexcept; -bool some_of(see below) noexcept; -int popcount(see below) noexcept; -int find_first_set(see below) noexcept; -int find_last_set(see below) noexcept; - -// masked assignment [simd.whereexpr] -template <class M, class T> class const_where_expression; -template <class M, class T> class where_expression; - -// masked assignment [simd.mask.where] -template <class T> struct nodeduce { using type = T; }; // exposition only - -template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; - -template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; - -template <class T> -const_where_expression<bool, const T> where(see below k, const T& d) noexcept; - -// reductions [simd.reductions] -template <class T, class Abi, class BinaryOperation = std::plus<>> -T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); - -template <class M, class V, class BinaryOperation> -typename V::value_type reduce(const const_where_expression<M, V>& x, -typename V::value_type neutral_element, BinaryOperation binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); - -template <class T, class Abi> T hmin(const simd<T, Abi>&); -template <class M, class V> T hmin(const const_where_expression<M, V>&); -template <class T, class Abi> T hmax(const simd<T, Abi>&); -template <class M, class V> T hmax(const const_where_expression<M, V>&); - -// algorithms [simd.alg] -template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); - -// [simd.whereexpr] -template <class M, class T> -class const_where_expression { - const M& mask; // exposition only - T& data; // exposition only -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - remove_const_t<T> operator-() const &&; - template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; -}; - -template <class M, class T> -class where_expression : public const_where_expression<M, T> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class U> void operator=(U&& x); - template <class U> void operator+=(U&& x); - template <class U> void operator-=(U&& x); - template <class U> void operator*=(U&& x); - template <class U> void operator/=(U&& x); - template <class U> void operator%=(U&& x); - template <class U> void operator&=(U&& x); - template <class U> void operator|=(U&& x); - template <class U> void operator^=(U&& x); - template <class U> void operator<<=(U&& x); - template <class U> void operator>>=(U&& x); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class U, class Flags> void copy_from(const U* mem, Flags); -}; - -// [simd.class] -template <class T, class Abi> class simd { -public: - using value_type = T; - using reference = see below; - using mask_type = simd_mask<T, Abi>; - - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd() = default; - - // implicit type conversion constructor - template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); - - // implicit broadcast constructor (see below for constraints) - template <class U> simd(U&& value); - - // generator constructor (see below for constraints) - template <class G> explicit simd(G&& gen); - - // load constructor - template <class U, class Flags> simd(const U* mem, Flags f); - - // loads [simd.load] - template <class U, class Flags> void copy_from(const U* mem, Flags f); - - // stores [simd.store] - template <class U, class Flags> void copy_to(U* mem, Flags f) const; - - // scalar access [simd.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; // see below - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+ (const simd&, const simd&); - friend simd operator- (const simd&, const simd&); - friend simd operator* (const simd&, const simd&); - friend simd operator/ (const simd&, const simd&); - friend simd operator% (const simd&, const simd&); - friend simd operator& (const simd&, const simd&); - friend simd operator| (const simd&, const simd&); - friend simd operator^ (const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+= (simd&, const simd&); - friend simd& operator-= (simd&, const simd&); - friend simd& operator*= (simd&, const simd&); - friend simd& operator/= (simd&, const simd&); - friend simd& operator%= (simd&, const simd&); - - friend simd& operator&= (simd&, const simd&); - friend simd& operator|= (simd&, const simd&); - friend simd& operator^= (simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator> (const simd&, const simd&); - friend mask_type operator< (const simd&, const simd&); -}; - -// [simd.math] -template <class Abi> using scharv = simd<signed char, Abi>; // exposition only -template <class Abi> using shortv = simd<short, Abi>; // exposition only -template <class Abi> using intv = simd<int, Abi>; // exposition only -template <class Abi> using longv = simd<long int, Abi>; // exposition only -template <class Abi> using llongv = simd<long long int, Abi>; // exposition only -template <class Abi> using floatv = simd<float, Abi>; // exposition only -template <class Abi> using doublev = simd<double, Abi>; // exposition only -template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only -template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only - -template <class Abi> floatv<Abi> acos(floatv<Abi> x); -template <class Abi> doublev<Abi> acos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asin(floatv<Abi> x); -template <class Abi> doublev<Abi> asin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan(floatv<Abi> x); -template <class Abi> doublev<Abi> atan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); -template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cos(floatv<Abi> x); -template <class Abi> doublev<Abi> cos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sin(floatv<Abi> x); -template <class Abi> doublev<Abi> sin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tan(floatv<Abi> x); -template <class Abi> doublev<Abi> tan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> acosh(floatv<Abi> x); -template <class Abi> doublev<Abi> acosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asinh(floatv<Abi> x); -template <class Abi> doublev<Abi> asinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atanh(floatv<Abi> x); -template <class Abi> doublev<Abi> atanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cosh(floatv<Abi> x); -template <class Abi> doublev<Abi> cosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sinh(floatv<Abi> x); -template <class Abi> doublev<Abi> sinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tanh(floatv<Abi> x); -template <class Abi> doublev<Abi> tanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp(floatv<Abi> x); -template <class Abi> doublev<Abi> exp(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp2(floatv<Abi> x); -template <class Abi> doublev<Abi> exp2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> expm1(floatv<Abi> x); -template <class Abi> doublev<Abi> expm1(doublev<Abi> x); -template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); -template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); -template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); - -template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); -template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); -template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); - -template <class Abi> floatv<Abi> log(floatv<Abi> x); -template <class Abi> doublev<Abi> log(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log10(floatv<Abi> x); -template <class Abi> doublev<Abi> log10(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log1p(floatv<Abi> x); -template <class Abi> doublev<Abi> log1p(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log2(floatv<Abi> x); -template <class Abi> doublev<Abi> log2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> logb(floatv<Abi> x); -template <class Abi> doublev<Abi> logb(doublev<Abi> x); -template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); -template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); -template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); - -template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); -template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); - -template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); -template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); - -template <class Abi> scharv<Abi> abs(scharv<Abi> j); -template <class Abi> shortv<Abi> abs(shortv<Abi> j); -template <class Abi> intv<Abi> abs(intv<Abi> j); -template <class Abi> longv<Abi> abs(longv<Abi> j); -template <class Abi> llongv<Abi> abs(llongv<Abi> j); -template <class Abi> floatv<Abi> abs(floatv<Abi> j); -template <class Abi> doublev<Abi> abs(doublev<Abi> j); -template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); - -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); -template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> erf(floatv<Abi> x); -template <class Abi> doublev<Abi> erf(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); -template <class Abi> floatv<Abi> erfc(floatv<Abi> x); -template <class Abi> doublev<Abi> erfc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ceil(floatv<Abi> x); -template <class Abi> doublev<Abi> ceil(doublev<Abi> x); -template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> floor(floatv<Abi> x); -template <class Abi> doublev<Abi> floor(doublev<Abi> x); -template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); -template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> rint(floatv<Abi> x); -template <class Abi> doublev<Abi> rint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); - -template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> round(floatv<Abi> x); -template <class Abi> doublev<Abi> round(doublev<Abi> x); -template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); -template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> trunc(floatv<Abi> x); -template <class Abi> doublev<Abi> trunc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); -template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); -template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); - -template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> doublev<Abi> nan(const char* tagp); -template <class Abi> floatv<Abi> nanf(const char* tagp); -template <class Abi> ldoublev<Abi> nanl(const char* tagp); - -template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); -template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); -template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class V> struct simd_div_t { V quot, rem; }; -template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); -template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); -template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); -template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); -template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); - -// [simd.mask.class] -template <class T, class Abi> -class simd_mask { -public: - using value_type = bool; - using reference = see below; - using simd_type = simd<T, Abi>; - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class Flags> simd_mask(const value_type* mem, Flags); - - // loads [simd.mask.copy] - template <class Flags> void copy_from(const value_type* mem, Flags); - template <class Flags> void copy_to(value_type* mem, Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - -} // parallelism_v2 -} // std::experimental - -*/ - -#include <experimental/__config> +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP_EXPERIMENTAL_SIMD +#define _LIBCPP_EXPERIMENTAL_SIMD + +/* + experimental/simd synopsis + +namespace std::experimental { + +inline namespace parallelism_v2 { + +namespace simd_abi { + +struct scalar {}; +template <int N> struct fixed_size {}; +template <typename T> inline constexpr int max_fixed_size = implementation-defined; +template <typename T> using compatible = implementation-defined; +template <typename T> using native = implementation-defined; + +} // simd_abi + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> struct overaligned_tag {}; +inline constexpr element_aligned_tag element_aligned{}; +inline constexpr vector_aligned_tag vector_aligned{}; +template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; + +// traits [simd.traits] +template <class T> struct is_abi_tag; +template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; + +template <class T> struct is_simd; +template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; + +template <class T> struct is_simd_mask; +template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; + +template <class T> struct is_simd_flag_type; +template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; + +template <class T, size_t N> struct abi_for_size { using type = see below; }; +template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; + +template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; +template <class T, class Abi = simd_abi::compatible<T>> +inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; + +template <class T, class U = typename T::value_type> struct memory_alignment; +template <class T, class U = typename T::value_type> +inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; + +// class template simd [simd.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd; +template <class T> using native_simd = simd<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; + +// class template simd_mask [simd.mask.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; +template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; + +// casts [simd.casts] +template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); +template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); + +template <class T, class Abi> +fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; +template <class T, class Abi> +fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; +template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> +native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; +template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; + +template <size_t... Sizes, class T, class Abi> +tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); +template <size_t... Sizes, class T, class Abi> +tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd<typename V::value_type, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd_mask<typename V::value_type, Abi>&); + +template <class T, class... Abis> +simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); +template <class T, class... Abis> +simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); + +// reductions [simd.mask.reductions] +template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); +template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); + +bool all_of(see below) noexcept; +bool any_of(see below) noexcept; +bool none_of(see below) noexcept; +bool some_of(see below) noexcept; +int popcount(see below) noexcept; +int find_first_set(see below) noexcept; +int find_last_set(see below) noexcept; + +// masked assignment [simd.whereexpr] +template <class M, class T> class const_where_expression; +template <class M, class T> class where_expression; + +// masked assignment [simd.mask.where] +template <class T> struct nodeduce { using type = T; }; // exposition only + +template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; + +template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; + +template <class T> +const_where_expression<bool, const T> where(see below k, const T& d) noexcept; + +// reductions [simd.reductions] +template <class T, class Abi, class BinaryOperation = std::plus<>> +T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); + +template <class M, class V, class BinaryOperation> +typename V::value_type reduce(const const_where_expression<M, V>& x, +typename V::value_type neutral_element, BinaryOperation binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); + +template <class T, class Abi> T hmin(const simd<T, Abi>&); +template <class M, class V> T hmin(const const_where_expression<M, V>&); +template <class T, class Abi> T hmax(const simd<T, Abi>&); +template <class M, class V> T hmax(const const_where_expression<M, V>&); + +// algorithms [simd.alg] +template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); + +// [simd.whereexpr] +template <class M, class T> +class const_where_expression { + const M& mask; // exposition only + T& data; // exposition only +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + remove_const_t<T> operator-() const &&; + template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; +}; + +template <class M, class T> +class where_expression : public const_where_expression<M, T> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class U> void operator=(U&& x); + template <class U> void operator+=(U&& x); + template <class U> void operator-=(U&& x); + template <class U> void operator*=(U&& x); + template <class U> void operator/=(U&& x); + template <class U> void operator%=(U&& x); + template <class U> void operator&=(U&& x); + template <class U> void operator|=(U&& x); + template <class U> void operator^=(U&& x); + template <class U> void operator<<=(U&& x); + template <class U> void operator>>=(U&& x); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class U, class Flags> void copy_from(const U* mem, Flags); +}; + +// [simd.class] +template <class T, class Abi> class simd { +public: + using value_type = T; + using reference = see below; + using mask_type = simd_mask<T, Abi>; + + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd() = default; + + // implicit type conversion constructor + template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); + + // implicit broadcast constructor (see below for constraints) + template <class U> simd(U&& value); + + // generator constructor (see below for constraints) + template <class G> explicit simd(G&& gen); + + // load constructor + template <class U, class Flags> simd(const U* mem, Flags f); + + // loads [simd.load] + template <class U, class Flags> void copy_from(const U* mem, Flags f); + + // stores [simd.store] + template <class U, class Flags> void copy_to(U* mem, Flags f) const; + + // scalar access [simd.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; // see below + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+ (const simd&, const simd&); + friend simd operator- (const simd&, const simd&); + friend simd operator* (const simd&, const simd&); + friend simd operator/ (const simd&, const simd&); + friend simd operator% (const simd&, const simd&); + friend simd operator& (const simd&, const simd&); + friend simd operator| (const simd&, const simd&); + friend simd operator^ (const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+= (simd&, const simd&); + friend simd& operator-= (simd&, const simd&); + friend simd& operator*= (simd&, const simd&); + friend simd& operator/= (simd&, const simd&); + friend simd& operator%= (simd&, const simd&); + + friend simd& operator&= (simd&, const simd&); + friend simd& operator|= (simd&, const simd&); + friend simd& operator^= (simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator> (const simd&, const simd&); + friend mask_type operator< (const simd&, const simd&); +}; + +// [simd.math] +template <class Abi> using scharv = simd<signed char, Abi>; // exposition only +template <class Abi> using shortv = simd<short, Abi>; // exposition only +template <class Abi> using intv = simd<int, Abi>; // exposition only +template <class Abi> using longv = simd<long int, Abi>; // exposition only +template <class Abi> using llongv = simd<long long int, Abi>; // exposition only +template <class Abi> using floatv = simd<float, Abi>; // exposition only +template <class Abi> using doublev = simd<double, Abi>; // exposition only +template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only +template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only + +template <class Abi> floatv<Abi> acos(floatv<Abi> x); +template <class Abi> doublev<Abi> acos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asin(floatv<Abi> x); +template <class Abi> doublev<Abi> asin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan(floatv<Abi> x); +template <class Abi> doublev<Abi> atan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); +template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cos(floatv<Abi> x); +template <class Abi> doublev<Abi> cos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sin(floatv<Abi> x); +template <class Abi> doublev<Abi> sin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tan(floatv<Abi> x); +template <class Abi> doublev<Abi> tan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> acosh(floatv<Abi> x); +template <class Abi> doublev<Abi> acosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asinh(floatv<Abi> x); +template <class Abi> doublev<Abi> asinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atanh(floatv<Abi> x); +template <class Abi> doublev<Abi> atanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cosh(floatv<Abi> x); +template <class Abi> doublev<Abi> cosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sinh(floatv<Abi> x); +template <class Abi> doublev<Abi> sinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tanh(floatv<Abi> x); +template <class Abi> doublev<Abi> tanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp(floatv<Abi> x); +template <class Abi> doublev<Abi> exp(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp2(floatv<Abi> x); +template <class Abi> doublev<Abi> exp2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> expm1(floatv<Abi> x); +template <class Abi> doublev<Abi> expm1(doublev<Abi> x); +template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); +template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); +template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); + +template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); +template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); +template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); + +template <class Abi> floatv<Abi> log(floatv<Abi> x); +template <class Abi> doublev<Abi> log(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log10(floatv<Abi> x); +template <class Abi> doublev<Abi> log10(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log1p(floatv<Abi> x); +template <class Abi> doublev<Abi> log1p(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log2(floatv<Abi> x); +template <class Abi> doublev<Abi> log2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> logb(floatv<Abi> x); +template <class Abi> doublev<Abi> logb(doublev<Abi> x); +template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); +template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); +template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); + +template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); +template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); + +template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); +template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); + +template <class Abi> scharv<Abi> abs(scharv<Abi> j); +template <class Abi> shortv<Abi> abs(shortv<Abi> j); +template <class Abi> intv<Abi> abs(intv<Abi> j); +template <class Abi> longv<Abi> abs(longv<Abi> j); +template <class Abi> llongv<Abi> abs(llongv<Abi> j); +template <class Abi> floatv<Abi> abs(floatv<Abi> j); +template <class Abi> doublev<Abi> abs(doublev<Abi> j); +template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); + +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); +template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> erf(floatv<Abi> x); +template <class Abi> doublev<Abi> erf(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); +template <class Abi> floatv<Abi> erfc(floatv<Abi> x); +template <class Abi> doublev<Abi> erfc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ceil(floatv<Abi> x); +template <class Abi> doublev<Abi> ceil(doublev<Abi> x); +template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> floor(floatv<Abi> x); +template <class Abi> doublev<Abi> floor(doublev<Abi> x); +template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); +template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> rint(floatv<Abi> x); +template <class Abi> doublev<Abi> rint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); + +template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> round(floatv<Abi> x); +template <class Abi> doublev<Abi> round(doublev<Abi> x); +template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); +template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> trunc(floatv<Abi> x); +template <class Abi> doublev<Abi> trunc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); +template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); +template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); + +template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> doublev<Abi> nan(const char* tagp); +template <class Abi> floatv<Abi> nanf(const char* tagp); +template <class Abi> ldoublev<Abi> nanl(const char* tagp); + +template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); +template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); +template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class V> struct simd_div_t { V quot, rem; }; +template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); +template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); +template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); +template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); +template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); + +// [simd.mask.class] +template <class T, class Abi> +class simd_mask { +public: + using value_type = bool; + using reference = see below; + using simd_type = simd<T, Abi>; + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class Flags> simd_mask(const value_type* mem, Flags); + + // loads [simd.mask.copy] + template <class Flags> void copy_from(const value_type* mem, Flags); + template <class Flags> void copy_to(value_type* mem, Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + +} // parallelism_v2 +} // std::experimental + +*/ + +#include <experimental/__config> #include <algorithm> -#include <array> -#include <cstddef> -#include <functional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - +#include <array> +#include <cstddef> +#include <functional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + _LIBCPP_PUSH_MACROS #include <__undef_macros> -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + #if _LIBCPP_STD_VER >= 17 -enum class _StorageKind { - _Scalar, - _Array, +enum class _StorageKind { + _Scalar, + _Array, _VecExt, -}; - -template <_StorageKind __kind, int _Np> -struct __simd_abi {}; - -template <class _Tp, class _Abi> +}; + +template <_StorageKind __kind, int _Np> +struct __simd_abi {}; + +template <class _Tp, class _Abi> class __simd_storage {}; - -template <class _Tp, int __num_element> + +template <class _Tp, int __num_element> class __simd_storage<_Tp, __simd_abi<_StorageKind::_Array, __num_element>> { std::array<_Tp, __num_element> __storage_; @@ -693,9 +693,9 @@ public: void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } -}; - -template <class _Tp> +}; + +template <class _Tp> class __simd_storage<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> { _Tp __storage_; @@ -710,8 +710,8 @@ public: void __set(size_t __index, _Tp __val) noexcept { (&__storage_)[__index] = __val; } -}; - +}; + #ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION constexpr size_t __floor_pow_of_2(size_t __val) { @@ -906,43 +906,43 @@ public: } }; -template <class _To, class _From> -constexpr decltype(_To{std::declval<_From>()}, true) -__is_non_narrowing_convertible_impl(_From) { - return true; -} - -template <class _To> -constexpr bool __is_non_narrowing_convertible_impl(...) { - return false; -} - -template <class _From, class _To> -constexpr typename std::enable_if<std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value, - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return __is_non_narrowing_convertible_impl<_To>(_From{}); -} - -template <class _From, class _To> -constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value), - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return false; -} - -template <class _Tp> -constexpr _Tp __variadic_sum() { - return _Tp{}; -} - -template <class _Tp, class _Up, class... _Args> -constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { - return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); -} - +template <class _To, class _From> +constexpr decltype(_To{std::declval<_From>()}, true) +__is_non_narrowing_convertible_impl(_From) { + return true; +} + +template <class _To> +constexpr bool __is_non_narrowing_convertible_impl(...) { + return false; +} + +template <class _From, class _To> +constexpr typename std::enable_if<std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value, + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return __is_non_narrowing_convertible_impl<_To>(_From{}); +} + +template <class _From, class _To> +constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value), + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return false; +} + +template <class _Tp> +constexpr _Tp __variadic_sum() { + return _Tp{}; +} + +template <class _Tp, class _Up, class... _Args> +constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { + return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); +} + template <class _Tp> struct __nodeduce { using type = _Tp; @@ -954,22 +954,22 @@ constexpr bool __vectorizable() { !std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value; } -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI - -using scalar = __simd_abi<_StorageKind::_Scalar, 1>; - -template <int _Np> -using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; - -template <class _Tp> +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI + +using scalar = __simd_abi<_StorageKind::_Scalar, 1>; + +template <int _Np> +using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; + +template <class _Tp> inline constexpr size_t max_fixed_size = 32; -template <class _Tp> -using compatible = fixed_size<16 / sizeof(_Tp)>; +template <class _Tp> +using compatible = fixed_size<16 / sizeof(_Tp)>; #ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION -template <class _Tp> +template <class _Tp> using native = __simd_abi<_StorageKind::_VecExt, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; #else @@ -977,369 +977,369 @@ template <class _Tp> using native = fixed_size<_Tp, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; #endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd; -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd_mask; - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> -struct overaligned_tag {}; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd; +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd_mask; + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> +struct overaligned_tag {}; inline constexpr element_aligned_tag element_aligned{}; inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t _Np> +template <size_t _Np> inline constexpr overaligned_tag<_Np> overaligned{}; - -// traits [simd.traits] -template <class _Tp> -struct is_abi_tag : std::integral_constant<bool, false> {}; - -template <_StorageKind __kind, int _Np> -struct is_abi_tag<__simd_abi<__kind, _Np>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd_mask : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { -}; - -template <class _Tp> -struct is_simd_flag_type : std::integral_constant<bool, false> {}; - -template <> -struct is_simd_flag_type<element_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <> -struct is_simd_flag_type<vector_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <size_t _Align> -struct is_simd_flag_type<overaligned_tag<_Align>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> + +// traits [simd.traits] +template <class _Tp> +struct is_abi_tag : std::integral_constant<bool, false> {}; + +template <_StorageKind __kind, int _Np> +struct is_abi_tag<__simd_abi<__kind, _Np>> + : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd_mask : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { +}; + +template <class _Tp> +struct is_simd_flag_type : std::integral_constant<bool, false> {}; + +template <> +struct is_simd_flag_type<element_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <> +struct is_simd_flag_type<vector_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <size_t _Align> +struct is_simd_flag_type<overaligned_tag<_Align>> + : std::integral_constant<bool, true> {}; + +template <class _Tp> inline constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_v = is_simd<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_mask_v = is_simd_mask<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<_Tp>::value; -template <class _Tp, size_t _Np> -struct abi_for_size { - using type = simd_abi::fixed_size<_Np>; -}; -template <class _Tp, size_t _Np> -using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -struct simd_size; - -template <class _Tp, _StorageKind __kind, int _Np> -struct simd_size<_Tp, __simd_abi<__kind, _Np>> - : std::integral_constant<size_t, _Np> { - static_assert( - std::is_arithmetic<_Tp>::value && - !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, - "Element type should be vectorizable"); -}; - +template <class _Tp, size_t _Np> +struct abi_for_size { + using type = simd_abi::fixed_size<_Np>; +}; +template <class _Tp, size_t _Np> +using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +struct simd_size; + +template <class _Tp, _StorageKind __kind, int _Np> +struct simd_size<_Tp, __simd_abi<__kind, _Np>> + : std::integral_constant<size_t, _Np> { + static_assert( + std::is_arithmetic<_Tp>::value && + !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, + "Element type should be vectorizable"); +}; + // TODO: implement it. -template <class _Tp, class _Up = typename _Tp::value_type> -struct memory_alignment; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +template <class _Tp, class _Up = typename _Tp::value_type> +struct memory_alignment; + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> inline constexpr size_t simd_size_v = simd_size<_Tp, _Abi>::value; - -template <class _Tp, class _Up = typename _Tp::value_type> + +template <class _Tp, class _Up = typename _Tp::value_type> inline constexpr size_t memory_alignment_v = memory_alignment<_Tp, _Up>::value; - -// class template simd [simd.class] -template <class _Tp> -using native_simd = simd<_Tp, simd_abi::native<_Tp>>; -template <class _Tp, int _Np> -using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; - -// class template simd_mask [simd.mask.class] -template <class _Tp> -using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; - -template <class _Tp, int _Np> -using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; - -// casts [simd.casts] -template <class _Tp> -struct __static_simd_cast_traits { - template <class _Up, class _Abi> - static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if<simd<_Up, _Abi>::size() == - simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp> -struct __simd_cast_traits { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), - simd<_Tp, _Abi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && - simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _Up, class _Abi> -auto simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { - return __simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Up, class _Abi> -auto static_simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { - return __static_simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Abi> -fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> -split(const simd_mask<_Tp, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd<typename _SimdType::value_type, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd_mask<typename _SimdType::value_type, _Abi>&); - -template <class _Tp, class... _Abis> -simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd<_Tp, _Abis>&...); - -template <class _Tp, class... _Abis> -simd_mask<_Tp, - abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd_mask<_Tp, _Abis>&...); - -// reductions [simd.mask.reductions] -template <class _Tp, class _Abi> -bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int popcount(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int find_first_set(const simd_mask<_Tp, _Abi>&); -template <class _Tp, class _Abi> -int find_last_set(const simd_mask<_Tp, _Abi>&); -bool all_of(bool) noexcept; -bool any_of(bool) noexcept; -bool none_of(bool) noexcept; -bool some_of(bool) noexcept; -int popcount(bool) noexcept; -int find_first_set(bool) noexcept; -int find_last_set(bool) noexcept; - -// masked assignment [simd.whereexpr] -template <class _MaskType, class _Tp> -class const_where_expression; -template <class _MaskType, class _Tp> -class where_expression; - -// masked assignment [simd.mask.where] -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, - const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp> -where_expression<bool, _Tp> where(bool, _Tp&) noexcept; - -template <class _Tp> -const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; - -// reductions [simd.reductions] -template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> -_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); - -template <class _MaskType, class _SimdType, class _BinaryOp> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - typename _SimdType::value_type neutral_element, _BinaryOp binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - plus<typename _SimdType::value_type> binary_op = {}); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - multiplies<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_and<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_or<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_xor<typename _SimdType::value_type> binary_op); - -template <class _Tp, class _Abi> -_Tp hmin(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmin(const const_where_expression<_MaskType, _SimdType>&); -template <class _Tp, class _Abi> -_Tp hmax(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmax(const const_where_expression<_MaskType, _SimdType>&); - -// algorithms [simd.alg] -template <class _Tp, class _Abi> -simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> -minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, - const simd<_Tp, _Abi>&); - -// [simd.whereexpr] -// TODO implement where expressions. -template <class _MaskType, class _Tp> -class const_where_expression { -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - typename remove_const<_Tp>::type operator-() const&&; - template <class _Up, class _Flags> - void copy_to(_Up*, _Flags) const&&; -}; - -template <class _MaskType, class _Tp> -class where_expression : public const_where_expression<_MaskType, _Tp> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class _Up> - void operator=(_Up&&); - template <class _Up> - void operator+=(_Up&&); - template <class _Up> - void operator-=(_Up&&); - template <class _Up> - void operator*=(_Up&&); - template <class _Up> - void operator/=(_Up&&); - template <class _Up> - void operator%=(_Up&&); - template <class _Up> - void operator&=(_Up&&); - template <class _Up> - void operator|=(_Up&&); - template <class _Up> - void operator^=(_Up&&); - template <class _Up> - void operator<<=(_Up&&); - template <class _Up> - void operator>>=(_Up&&); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class _Up, class _Flags> - void copy_from(const _Up*, _Flags); -}; - -// [simd.class] -// TODO: implement simd -template <class _Tp, class _Abi> -class simd { + +// class template simd [simd.class] +template <class _Tp> +using native_simd = simd<_Tp, simd_abi::native<_Tp>>; +template <class _Tp, int _Np> +using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; + +// class template simd_mask [simd.mask.class] +template <class _Tp> +using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; + +template <class _Tp, int _Np> +using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; + +// casts [simd.casts] +template <class _Tp> +struct __static_simd_cast_traits { + template <class _Up, class _Abi> + static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if<simd<_Up, _Abi>::size() == + simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp> +struct __simd_cast_traits { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), + simd<_Tp, _Abi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && + simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _Up, class _Abi> +auto simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { + return __simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Up, class _Abi> +auto static_simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { + return __static_simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Abi> +fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> +split(const simd_mask<_Tp, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd<typename _SimdType::value_type, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd_mask<typename _SimdType::value_type, _Abi>&); + +template <class _Tp, class... _Abis> +simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd<_Tp, _Abis>&...); + +template <class _Tp, class... _Abis> +simd_mask<_Tp, + abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd_mask<_Tp, _Abis>&...); + +// reductions [simd.mask.reductions] +template <class _Tp, class _Abi> +bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int popcount(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int find_first_set(const simd_mask<_Tp, _Abi>&); +template <class _Tp, class _Abi> +int find_last_set(const simd_mask<_Tp, _Abi>&); +bool all_of(bool) noexcept; +bool any_of(bool) noexcept; +bool none_of(bool) noexcept; +bool some_of(bool) noexcept; +int popcount(bool) noexcept; +int find_first_set(bool) noexcept; +int find_last_set(bool) noexcept; + +// masked assignment [simd.whereexpr] +template <class _MaskType, class _Tp> +class const_where_expression; +template <class _MaskType, class _Tp> +class where_expression; + +// masked assignment [simd.mask.where] +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, + const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp> +where_expression<bool, _Tp> where(bool, _Tp&) noexcept; + +template <class _Tp> +const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; + +// reductions [simd.reductions] +template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> +_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); + +template <class _MaskType, class _SimdType, class _BinaryOp> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + typename _SimdType::value_type neutral_element, _BinaryOp binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + plus<typename _SimdType::value_type> binary_op = {}); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + multiplies<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_and<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_or<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_xor<typename _SimdType::value_type> binary_op); + +template <class _Tp, class _Abi> +_Tp hmin(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmin(const const_where_expression<_MaskType, _SimdType>&); +template <class _Tp, class _Abi> +_Tp hmax(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmax(const const_where_expression<_MaskType, _SimdType>&); + +// algorithms [simd.alg] +template <class _Tp, class _Abi> +simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> +minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, + const simd<_Tp, _Abi>&); + +// [simd.whereexpr] +// TODO implement where expressions. +template <class _MaskType, class _Tp> +class const_where_expression { +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + typename remove_const<_Tp>::type operator-() const&&; + template <class _Up, class _Flags> + void copy_to(_Up*, _Flags) const&&; +}; + +template <class _MaskType, class _Tp> +class where_expression : public const_where_expression<_MaskType, _Tp> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class _Up> + void operator=(_Up&&); + template <class _Up> + void operator+=(_Up&&); + template <class _Up> + void operator-=(_Up&&); + template <class _Up> + void operator*=(_Up&&); + template <class _Up> + void operator/=(_Up&&); + template <class _Up> + void operator%=(_Up&&); + template <class _Up> + void operator&=(_Up&&); + template <class _Up> + void operator|=(_Up&&); + template <class _Up> + void operator^=(_Up&&); + template <class _Up> + void operator<<=(_Up&&); + template <class _Up> + void operator>>=(_Up&&); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class _Up, class _Flags> + void copy_from(const _Up*, _Flags); +}; + +// [simd.class] +// TODO: implement simd +template <class _Tp, class _Abi> +class simd { public: using value_type = _Tp; using reference = __simd_reference<_Tp, _Tp, _Abi>; @@ -1354,21 +1354,21 @@ public: return simd_size<_Tp, _Abi>::value; } -private: +private: __simd_storage<_Tp, _Abi> __s_; - template <class _Up> - static constexpr bool __can_broadcast() { - return (std::is_arithmetic<_Up>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || - (!std::is_arithmetic<_Up>::value && - std::is_convertible<_Up, _Tp>::value) || - std::is_same<typename std::remove_const<_Up>::type, int>::value || - (std::is_same<typename std::remove_const<_Up>::type, - unsigned int>::value && - std::is_unsigned<_Tp>::value); - } - + template <class _Up> + static constexpr bool __can_broadcast() { + return (std::is_arithmetic<_Up>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || + (!std::is_arithmetic<_Up>::value && + std::is_convertible<_Up, _Tp>::value) || + std::is_same<typename std::remove_const<_Up>::type, int>::value || + (std::is_same<typename std::remove_const<_Up>::type, + unsigned int>::value && + std::is_unsigned<_Tp>::value); + } + template <class _Generator, size_t... __indicies> static constexpr decltype( std::forward_as_tuple(std::declval<_Generator>()( @@ -1379,44 +1379,44 @@ private: !__can_broadcast<decltype(std::declval<_Generator>()( std::integral_constant<size_t, __indicies>()))>()...); } - + template <class _Generator> static bool __can_generate(...) { return false; } - + template <class _Generator, size_t... __indicies> void __generator_init(_Generator&& __g, std::index_sequence<__indicies...>) { int __not_used[]{((*this)[__indicies] = __g(std::integral_constant<size_t, __indicies>()), 0)...}; (void)__not_used; - } - + } + public: - // implicit type conversion constructor - template <class _Up, - class = typename std::enable_if< - std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> + // implicit type conversion constructor + template <class _Up, + class = typename std::enable_if< + std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> simd(const simd<_Up, simd_abi::fixed_size<size()>>& __v) { for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = static_cast<_Tp>(__v[__i]); } } - - // implicit broadcast constructor - template <class _Up, - class = typename std::enable_if<__can_broadcast<_Up>()>::type> + + // implicit broadcast constructor + template <class _Up, + class = typename std::enable_if<__can_broadcast<_Up>()>::type> simd(_Up&& __rv) { auto __v = static_cast<_Tp>(__rv); for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = __v; } } - - // generator constructor - template <class _Generator, + + // generator constructor + template <class _Generator, int = typename std::enable_if< __can_generate<_Generator>(std::make_index_sequence<size()>()), int>::type()> @@ -1424,8 +1424,8 @@ public: __generator_init(std::forward<_Generator>(__g), std::make_index_sequence<size()>()); } - - // load constructor + + // load constructor template < class _Up, class _Flags, class = typename std::enable_if<__vectorizable<_Up>()>::type, @@ -1436,17 +1436,17 @@ public: (*this)[__i] = static_cast<_Tp>(__buffer[__i]); } } - - // loads [simd.load] - template <class _Up, class _Flags> + + // loads [simd.load] + template <class _Up, class _Flags> typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type copy_from(const _Up* __buffer, _Flags) { *this = simd(__buffer, _Flags()); } - - // stores [simd.store] - template <class _Up, class _Flags> + + // stores [simd.store] + template <class _Up, class _Flags> typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type copy_to(_Up* __buffer, _Flags) const { @@ -1455,118 +1455,118 @@ public: __buffer[__i] = static_cast<_Up>((*this)[__i]); } } - - // scalar access [simd.subscr] + + // scalar access [simd.subscr] reference operator[](size_t __i) { return reference(&__s_, __i); } - + value_type operator[](size_t __i) const { return __s_.__get(__i); } - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+(const simd&, const simd&); - friend simd operator-(const simd&, const simd&); - friend simd operator*(const simd&, const simd&); - friend simd operator/(const simd&, const simd&); - friend simd operator%(const simd&, const simd&); - friend simd operator&(const simd&, const simd&); - friend simd operator|(const simd&, const simd&); - friend simd operator^(const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+=(simd&, const simd&); - friend simd& operator-=(simd&, const simd&); - friend simd& operator*=(simd&, const simd&); - friend simd& operator/=(simd&, const simd&); - friend simd& operator%=(simd&, const simd&); - - friend simd& operator&=(simd&, const simd&); - friend simd& operator|=(simd&, const simd&); - friend simd& operator^=(simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator>(const simd&, const simd&); - friend mask_type operator<(const simd&, const simd&); -}; - -// [simd.mask.class] -template <class _Tp, class _Abi> -// TODO: implement simd_mask -class simd_mask { -public: - using value_type = bool; - // TODO: this is strawman implementation. Turn it into a proxy type. - using reference = bool&; - using simd_type = simd<_Tp, _Abi>; - using abi_type = _Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class _Up> - simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class _Flags> - simd_mask(const value_type*, _Flags); - - // loads [simd.mask.copy] - template <class _Flags> - void copy_from(const value_type*, _Flags); - template <class _Flags> - void copy_to(value_type*, _Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; - friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+(const simd&, const simd&); + friend simd operator-(const simd&, const simd&); + friend simd operator*(const simd&, const simd&); + friend simd operator/(const simd&, const simd&); + friend simd operator%(const simd&, const simd&); + friend simd operator&(const simd&, const simd&); + friend simd operator|(const simd&, const simd&); + friend simd operator^(const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+=(simd&, const simd&); + friend simd& operator-=(simd&, const simd&); + friend simd& operator*=(simd&, const simd&); + friend simd& operator/=(simd&, const simd&); + friend simd& operator%=(simd&, const simd&); + + friend simd& operator&=(simd&, const simd&); + friend simd& operator|=(simd&, const simd&); + friend simd& operator^=(simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator>(const simd&, const simd&); + friend mask_type operator<(const simd&, const simd&); +}; + +// [simd.mask.class] +template <class _Tp, class _Abi> +// TODO: implement simd_mask +class simd_mask { +public: + using value_type = bool; + // TODO: this is strawman implementation. Turn it into a proxy type. + using reference = bool&; + using simd_type = simd<_Tp, _Abi>; + using abi_type = _Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class _Up> + simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class _Flags> + simd_mask(const value_type*, _Flags); + + // loads [simd.mask.copy] + template <class _Flags> + void copy_from(const value_type*, _Flags); + template <class _Flags> + void copy_to(value_type*, _Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; + friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + #endif // _LIBCPP_STD_VER >= 17 -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD - +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD + _LIBCPP_POP_MACROS -#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ +#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ diff --git a/contrib/libs/cxxsupp/libcxx/include/functional b/contrib/libs/cxxsupp/libcxx/include/functional index 53a5f2bc37..d6b1ec05ab 100644 --- a/contrib/libs/cxxsupp/libcxx/include/functional +++ b/contrib/libs/cxxsupp/libcxx/include/functional @@ -462,7 +462,7 @@ template <> struct hash<bool>; template <> struct hash<char>; template <> struct hash<signed char>; template <> struct hash<unsigned char>; -template <> struct hash<char8_t>; // since C++20 +template <> struct hash<char8_t>; // since C++20 template <> struct hash<char16_t>; template <> struct hash<char32_t>; template <> struct hash<wchar_t>; diff --git a/contrib/libs/cxxsupp/libcxx/include/locale b/contrib/libs/cxxsupp/libcxx/include/locale index 242790a9d4..15b6e96b22 100644 --- a/contrib/libs/cxxsupp/libcxx/include/locale +++ b/contrib/libs/cxxsupp/libcxx/include/locale @@ -2636,12 +2636,12 @@ public: : time_put<_CharT, _OutputIterator>(__nm, __refs) {} protected: -#if defined(_MSC_VER) && defined(__clang__) - ~time_put_byname() {} -#else +#if defined(_MSC_VER) && defined(__clang__) + ~time_put_byname() {} +#else _LIBCPP_INLINE_VISIBILITY ~time_put_byname() {} -#endif +#endif }; _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>) diff --git a/contrib/libs/cxxsupp/libcxx/include/span b/contrib/libs/cxxsupp/libcxx/include/span index 5d57bd693c..54c7cacf28 100644 --- a/contrib/libs/cxxsupp/libcxx/include/span +++ b/contrib/libs/cxxsupp/libcxx/include/span @@ -550,7 +550,7 @@ public: constexpr span<element_type, dynamic_extent> _LIBCPP_INLINE_VISIBILITY - subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept + subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept { _LIBCPP_ASSERT(__offset <= size(), "Offset out of range in span::subspan(offset, count)"); _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "count out of range in span::subspan(offset, count)"); diff --git a/contrib/libs/cxxsupp/libcxx/include/string b/contrib/libs/cxxsupp/libcxx/include/string index 4f3309fea9..1a41d7285f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string +++ b/contrib/libs/cxxsupp/libcxx/include/string @@ -683,7 +683,7 @@ class basic_string : private __basic_string_common<true> // This base class is historical, but it needs to remain for ABI compatibility { - static_assert(sizeof(_CharT) <= 4, "libc++ implementation of std::basic_string does not support extra-wide character types"); + static_assert(sizeof(_CharT) <= 4, "libc++ implementation of std::basic_string does not support extra-wide character types"); public: typedef basic_string __self; typedef basic_string_view<_CharT, _Traits> __self_view; @@ -706,13 +706,13 @@ public: static_assert(( is_same<typename allocator_type::value_type, value_type>::value), "Allocator::value_type must be same type as value_type"); -#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 +#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 typedef pointer iterator; typedef const_pointer const_iterator; -#else +#else typedef __wrap_iter<pointer> iterator; typedef __wrap_iter<const_pointer> const_iterator; -#endif +#endif typedef _VSTD::reverse_iterator<iterator> reverse_iterator; typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; @@ -835,9 +835,9 @@ public: basic_string(basic_string&& __str, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t) = delete; - + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t) = delete; + template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> > _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) { @@ -852,18 +852,18 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, const _Allocator& __a); - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t, size_t) = delete; - + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t, size_t) = delete; + _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n); - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t, size_t, const _Allocator&) = delete; - + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t, size_t, const _Allocator&) = delete; + _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); - + _LIBCPP_INLINE_VISIBILITY basic_string(size_type __n, _CharT __c); @@ -911,8 +911,8 @@ public: basic_string& operator=(const basic_string& __str); - basic_string& operator=(nullptr_t) = delete; - + basic_string& operator=(nullptr_t) = delete; + template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> > basic_string& operator=(const _Tp& __t) {__self_view __sv = __t; return assign(__sv);} @@ -991,14 +991,14 @@ public: {return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;} - -#if _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED == 1 - inline void resize_uninitialized(size_type __n) - { - __resize_default_init(__n); - } -#endif - + +#if _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED == 1 + inline void resize_uninitialized(size_type __n) + { + __resize_default_init(__n); + } +#endif + void resize(size_type __n, value_type __c); _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());} @@ -1425,8 +1425,8 @@ public: int compare(size_type __pos1, size_type __n1, const value_type* __s) const; int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const; -//WARN: disabled std guards in order to allow using these options without switching to new std -//#if _LIBCPP_STD_VER > 17 +//WARN: disabled std guards in order to allow using these options without switching to new std +//#if _LIBCPP_STD_VER > 17 constexpr _LIBCPP_INLINE_VISIBILITY bool starts_with(__self_view __sv) const noexcept { return __self_view(data(), size()).starts_with(__sv); } @@ -1450,7 +1450,7 @@ public: constexpr _LIBCPP_INLINE_VISIBILITY bool ends_with(const value_type* __s) const noexcept { return ends_with(__self_view(__s)); } -//#endif +//#endif #if _LIBCPP_STD_VER > 20 constexpr _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/string_view b/contrib/libs/cxxsupp/libcxx/include/string_view index 8df3ff297c..56461f099c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string_view +++ b/contrib/libs/cxxsupp/libcxx/include/string_view @@ -277,9 +277,9 @@ public: basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default; _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(nullptr_t, size_t) = delete; - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string_view(nullptr_t, size_t) = delete; + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT : __data(__s), __size(__len) { @@ -299,9 +299,9 @@ public: #endif _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(nullptr_t) = delete; - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string_view(nullptr_t) = delete; + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s) : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {} @@ -648,8 +648,8 @@ public: (data(), size(), __s, __pos, traits_type::length(__s)); } -//WARN: disabled std guards in order to allow using these options without switching to new std -//#if _LIBCPP_STD_VER > 17 +//WARN: disabled std guards in order to allow using these options without switching to new std +//#if _LIBCPP_STD_VER > 17 constexpr _LIBCPP_INLINE_VISIBILITY bool starts_with(basic_string_view __s) const noexcept { return size() >= __s.size() && compare(0, __s.size(), __s) == 0; } @@ -673,7 +673,7 @@ public: constexpr _LIBCPP_INLINE_VISIBILITY bool ends_with(const value_type* __s) const noexcept { return ends_with(basic_string_view(__s)); } -//#endif +//#endif #if _LIBCPP_STD_VER > 20 constexpr _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector index c02253c751..c04259679e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/vector +++ b/contrib/libs/cxxsupp/libcxx/include/vector @@ -492,7 +492,7 @@ public: typedef typename __base::difference_type difference_type; typedef typename __base::pointer pointer; typedef typename __base::const_pointer const_pointer; -#if _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS == 1 +#if _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS == 1 typedef typename __base::pointer iterator; typedef typename __base::const_pointer const_iterator; #else @@ -788,10 +788,10 @@ public: __invalidate_all_iterators(); } -#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED +#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED void resize_uninitialized(size_type __sz); -#endif - +#endif + void resize(size_type __sz); void resize(size_type __sz, const_reference __x); @@ -2057,8 +2057,8 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __fi return __make_iter(__p); } -#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED - +#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED + template <class _Tp, class _Allocator> void vector<_Tp, _Allocator>::resize_uninitialized(size_type __sz) @@ -2072,8 +2072,8 @@ vector<_Tp, _Allocator>::resize_uninitialized(size_type __sz) } } -#endif - +#endif + template <class _Tp, class _Allocator> void vector<_Tp, _Allocator>::resize(size_type __sz) @@ -2207,7 +2207,7 @@ vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) { #endif } -#if _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION == 1 +#if _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION == 1 // vector<bool> template <class _Allocator> class vector<bool, _Allocator>; @@ -3390,7 +3390,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> > size_t operator()(const vector<bool, _Allocator>& __vec) const _NOEXCEPT {return __vec.__hash_code();} }; -#endif // _YNDX_LIBCXX_DISABLE_VECTOR_BOOL_COMPRESSION +#endif // _YNDX_LIBCXX_DISABLE_VECTOR_BOOL_COMPRESSION template <class _Tp, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp index b18e4f7cb9..f4201e6228 100644 --- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp @@ -119,9 +119,9 @@ static system_clock::time_point __libcpp_system_clock_now() { #elif defined(CLOCK_REALTIME) && defined(_LIBCPP_USE_CLOCK_GETTIME) static system_clock::time_point __libcpp_system_clock_now() { - struct timespec tp; - if (0 != clock_gettime(CLOCK_REALTIME, &tp)) - __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed"); + struct timespec tp; + if (0 != clock_gettime(CLOCK_REALTIME, &tp)) + __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed"); return system_clock::time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000)); } diff --git a/contrib/libs/cxxsupp/libcxx/src/exception.cpp b/contrib/libs/cxxsupp/libcxx/src/exception.cpp index cc73288377..4576c3eab3 100644 --- a/contrib/libs/cxxsupp/libcxx/src/exception.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/exception.cpp @@ -10,7 +10,7 @@ #include "new" #include "typeinfo" -#if defined(LIBCXX_BUILDING_LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) +#if defined(LIBCXX_BUILDING_LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) #include <cxxabi.h> using namespace __cxxabiv1; #define HAVE_DEPENDENT_EH_ABI 1 @@ -22,7 +22,7 @@ #elif defined(_LIBCPPABI_VERSION) #include "support/runtime/exception_libcxxabi.ipp" #include "support/runtime/exception_pointer_cxxabi.ipp" -#elif defined(LIBCXX_BUILDING_LIBCXXRT) +#elif defined(LIBCXX_BUILDING_LIBCXXRT) #include "support/runtime/exception_libcxxrt.ipp" #include "support/runtime/exception_pointer_cxxabi.ipp" #elif defined(__GLIBCXX__) diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp index a098dd163b..16fc85861f 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp @@ -55,7 +55,7 @@ static file_type get_file_type(DirEntT* ent, int) { #endif // defined(DT_BLK) template <class DirEntT> -static file_type get_file_type(DirEntT*, long) { +static file_type get_file_type(DirEntT*, long) { return file_type::none; } diff --git a/contrib/libs/cxxsupp/libcxx/src/new.cpp b/contrib/libs/cxxsupp/libcxx/src/new.cpp index 85afe3039e..67336d56cc 100644 --- a/contrib/libs/cxxsupp/libcxx/src/new.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/new.cpp @@ -16,7 +16,7 @@ # endif #elif defined(LIBCXX_BUILDING_LIBCXXABI) # include <cxxabi.h> -#elif defined(LIBCXX_BUILDING_LIBCXXRT) +#elif defined(LIBCXX_BUILDING_LIBCXXRT) # include <cxxabi.h> # include "support/runtime/new_handler_fallback.ipp" #elif defined(__GLIBCXX__) diff --git a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_libcxxrt.ipp b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_libcxxrt.ipp index 4e428d216c..a1696db401 100644 --- a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_libcxxrt.ipp +++ b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_libcxxrt.ipp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#ifndef LIBCXX_BUILDING_LIBCXXRT +#ifndef LIBCXX_BUILDING_LIBCXXRT #error this header may only be used when targeting libcxxrt #endif diff --git a/contrib/libs/cxxsupp/libcxx/src/support/runtime/stdexcept_default.ipp b/contrib/libs/cxxsupp/libcxx/src/support/runtime/stdexcept_default.ipp index 5d22b7894c..326d644c61 100644 --- a/contrib/libs/cxxsupp/libcxx/src/support/runtime/stdexcept_default.ipp +++ b/contrib/libs/cxxsupp/libcxx/src/support/runtime/stdexcept_default.ipp @@ -10,7 +10,7 @@ /* For _LIBCPPABI_VERSION */ #if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \ - (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(LIBCXX_BUILDING_LIBCXXRT)) + (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(LIBCXX_BUILDING_LIBCXXRT)) #include <cxxabi.h> #endif diff --git a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp index a1ea6c4754..9009dceb2e 100644 --- a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp @@ -91,7 +91,7 @@ handle_strerror_r_return(int strerror_return, char *buffer) { // The POSIX variant either: // - fills in the provided buffer and returns 0 // - returns a positive error value, or - // - returns -1 and fills in errno with an error value. + // - returns -1 and fills in errno with an error value. if (strerror_return == 0) return buffer; @@ -117,8 +117,8 @@ string do_strerror_r(int ev) { ::strerror_r(ev, buffer, strerror_buff_size), buffer); // If we didn't get any message, print one now. if (!error_message[0]) { - std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev); - error_message = buffer; + std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev); + error_message = buffer; } errno = old_errno; return string(error_message); diff --git a/contrib/libs/cxxsupp/libcxx/src/typeinfo.cpp b/contrib/libs/cxxsupp/libcxx/src/typeinfo.cpp index baace5643c..aa0624d851 100644 --- a/contrib/libs/cxxsupp/libcxx/src/typeinfo.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/typeinfo.cpp @@ -47,7 +47,7 @@ size_t std::type_info::hash_code() const noexcept { // FIXME: Remove the _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY configuration. #if (!defined(LIBCXX_BUILDING_LIBCXXABI) && \ - !defined(LIBCXX_BUILDING_LIBCXXRT) && \ + !defined(LIBCXX_BUILDING_LIBCXXRT) && \ !defined(__GLIBCXX__) && \ !defined(_LIBCPP_ABI_VCRUNTIME)) || \ defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) diff --git a/contrib/libs/cxxsupp/libcxx/ya.make b/contrib/libs/cxxsupp/libcxx/ya.make index 15403fe6d5..145517817e 100644 --- a/contrib/libs/cxxsupp/libcxx/ya.make +++ b/contrib/libs/cxxsupp/libcxx/ya.make @@ -15,7 +15,7 @@ VERSION(2021-04-02-7959d59028dd126416cdf10dbbd22162922e1336) OWNER( halyavin somov - g:cpp-committee + g:cpp-committee g:cpp-contrib ) @@ -28,33 +28,33 @@ CXXFLAGS(-D_LIBCPP_BUILDING_LIBRARY) IF (OS_ANDROID) DEFAULT(CXX_RT "default") IF (ARCH_I686 OR ARCH_ARM7) - # 32-bit architectures require additional libandroid_support.so to be linked - # We add --start-group / --end-group statements due to the issue in NDK < r22. - # See: https://github.com/android/ndk/issues/1130 - # - # Though these statements are not respected by LLD, they might have sense for other linkers. - LDFLAGS( - -Wl,--start-group - -lc++abi - -landroid_support - -Wl,--end-group - ) - ELSE() - LDFLAGS(-lc++abi) + # 32-bit architectures require additional libandroid_support.so to be linked + # We add --start-group / --end-group statements due to the issue in NDK < r22. + # See: https://github.com/android/ndk/issues/1130 + # + # Though these statements are not respected by LLD, they might have sense for other linkers. + LDFLAGS( + -Wl,--start-group + -lc++abi + -landroid_support + -Wl,--end-group + ) + ELSE() + LDFLAGS(-lc++abi) ENDIF() CFLAGS( -DLIBCXX_BUILDING_LIBCXXABI ) ELSEIF (OS_IOS) - # Take cxxabi implementation from system. + # Take cxxabi implementation from system. LDFLAGS(-lc++abi) CFLAGS( -DLIBCXX_BUILDING_LIBCXXABI ) - # Yet take builtins library from Arcadia - PEERDIR( - contrib/libs/cxxsupp/builtins - ) + # Yet take builtins library from Arcadia + PEERDIR( + contrib/libs/cxxsupp/builtins + ) ELSEIF (CLANG OR MUSL OR OS_DARWIN OR USE_LTO) IF (ARCH_ARM7) # XXX: libcxxrt support for ARM is currently broken @@ -120,18 +120,18 @@ DEFAULT(CXX_RT "default") DISABLE(NEED_GLIBCXX_CXX17_SHIMS) -IF (CXX_RT == "libcxxrt") - PEERDIR( - contrib/libs/cxxsupp/libcxxabi-parts - contrib/libs/cxxsupp/libcxxrt +IF (CXX_RT == "libcxxrt") + PEERDIR( + contrib/libs/cxxsupp/libcxxabi-parts + contrib/libs/cxxsupp/libcxxrt contrib/libs/cxxsupp/builtins - ) + ) ADDINCL( contrib/libs/cxxsupp/libcxxrt ) - CFLAGS( - GLOBAL -DLIBCXX_BUILDING_LIBCXXRT - ) + CFLAGS( + GLOBAL -DLIBCXX_BUILDING_LIBCXXRT + ) # These builtins are equivalent to clang -rtlib=compiler_rt and # are needed by potentially any code generated by clang. # With glibcxx runtime, builtins are provided by libgcc @@ -145,22 +145,22 @@ ELSEIF (CXX_RT == "glibcxx" OR CXX_RT == "glibcxx_static") ) CXXFLAGS(-D__GLIBCXX__=1) ENABLE(NEED_GLIBCXX_CXX17_SHIMS) - CFLAGS( - GLOBAL -DLIBCXX_BUILDING_LIBGCC - ) -ELSEIF (CXX_RT == "glibcxx_dynamic") + CFLAGS( + GLOBAL -DLIBCXX_BUILDING_LIBGCC + ) +ELSEIF (CXX_RT == "glibcxx_dynamic") LDFLAGS( -lgcc_s -lstdc++ ) CXXFLAGS(-D__GLIBCXX__=1) - CFLAGS( - GLOBAL -DLIBCXX_BUILDING_LIBGCC - ) + CFLAGS( + GLOBAL -DLIBCXX_BUILDING_LIBGCC + ) ENABLE(NEED_GLIBCXX_CXX17_SHIMS) -ELSEIF (CXX_RT == "glibcxx_driver") +ELSEIF (CXX_RT == "glibcxx_driver") CXXFLAGS(-D__GLIBCXX__=1) -ELSEIF (CXX_RT == "default") +ELSEIF (CXX_RT == "default") # Do nothing ELSE() MESSAGE(FATAL_ERROR "Unexpected CXX_RT value: ${CXX_RT}") @@ -169,7 +169,7 @@ ENDIF() IF (NEED_GLIBCXX_CXX17_SHIMS) IF (GCC) # Assume GCC is bundled with a modern enough version of C++ runtime - ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16") + ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16") # Prior to ubuntu-18, system C++ runtime for C++17 is incomplete SRCS( glibcxx_eh_cxx17.cpp @@ -200,8 +200,8 @@ SRCS( src/condition_variable_destructor.cpp src/debug.cpp src/exception.cpp - src/filesystem/directory_iterator.cpp - src/filesystem/operations.cpp + src/filesystem/directory_iterator.cpp + src/filesystem/operations.cpp src/format.cpp src/functional.cpp src/future.cpp |