[libcxx-commits] [libcxx] [libc++][C++03] Remove code that is not used in C++03 (PR #134045)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 9 06:05:05 PDT 2025
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/134045
>From 88924d0e2802c79a91801ed5f6ca7e1e7a6a6fc8 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Sat, 21 Dec 2024 00:27:12 +0100
Subject: [PATCH] [libc++][C++03] Remove code that is not used in C++03
---
libcxx/include/__cxx03/__algorithm/equal.h | 59 -
libcxx/include/__cxx03/__algorithm/for_each.h | 15 -
.../__cxx03/__algorithm/is_permutation.h | 53 -
.../__cxx03/__algorithm/iterator_operations.h | 25 -
.../__cxx03/__algorithm/make_projected.h | 29 -
libcxx/include/__cxx03/__algorithm/max.h | 15 -
libcxx/include/__cxx03/__algorithm/min.h | 15 -
libcxx/include/__cxx03/__algorithm/minmax.h | 19 -
libcxx/include/__cxx03/__algorithm/mismatch.h | 46 -
libcxx/include/__cxx03/__algorithm/search.h | 9 -
libcxx/include/__cxx03/__algorithm/shuffle.h | 11 +-
.../include/__cxx03/__algorithm/simd_utils.h | 6 +-
libcxx/include/__cxx03/__algorithm/sort.h | 22 -
.../__algorithm/three_way_comp_ref_type.h | 48 -
.../uniform_random_bit_generator_adaptor.h | 38 -
.../include/__cxx03/__algorithm/unwrap_iter.h | 8 -
.../__cxx03/__algorithm/unwrap_range.h | 51 -
libcxx/include/__cxx03/__atomic/aliases.h | 25 -
libcxx/include/__cxx03/__atomic/atomic.h | 134 ---
libcxx/include/__cxx03/__atomic/atomic_base.h | 8 -
libcxx/include/__cxx03/__atomic/atomic_flag.h | 5 -
libcxx/include/__cxx03/__atomic/atomic_init.h | 4 -
.../__cxx03/__atomic/cxx_atomic_impl.h | 8 -
.../include/__cxx03/__atomic/memory_order.h | 25 -
libcxx/include/__cxx03/__bit/countl.h | 14 -
libcxx/include/__cxx03/__bit/countr.h | 14 -
libcxx/include/__cxx03/__bit/popcount.h | 26 -
libcxx/include/__cxx03/__bit/rotate.h | 14 -
libcxx/include/__cxx03/__bit_reference | 31 +-
libcxx/include/__cxx03/__chrono/duration.h | 127 +-
.../include/__cxx03/__chrono/system_clock.h | 9 -
libcxx/include/__cxx03/__chrono/time_point.h | 36 -
libcxx/include/__cxx03/__config | 148 +--
.../__cxx03/__configuration/language.h | 19 -
.../__cxx03/__debug_utils/randomize_range.h | 4 +-
.../include/__cxx03/__exception/operations.h | 3 -
.../__cxx03/__functional/binary_function.h | 11 -
.../__cxx03/__functional/binary_negate.h | 4 -
libcxx/include/__cxx03/__functional/bind.h | 226 ----
.../include/__cxx03/__functional/binder1st.h | 4 -
.../include/__cxx03/__functional/binder2nd.h | 4 -
libcxx/include/__cxx03/__functional/hash.h | 33 -
.../include/__cxx03/__functional/identity.h | 20 -
.../__cxx03/__functional/mem_fun_ref.h | 4 -
.../include/__cxx03/__functional/operations.h | 328 -----
.../__functional/pointer_to_binary_function.h | 4 -
.../__functional/pointer_to_unary_function.h | 4 -
.../__cxx03/__functional/reference_wrapper.h | 58 -
.../__cxx03/__functional/unary_function.h | 11 -
.../__cxx03/__functional/unary_negate.h | 4 -
.../__cxx03/__functional/weak_result_type.h | 22 -
libcxx/include/__cxx03/__fwd/array.h | 8 -
libcxx/include/__cxx03/__fwd/complex.h | 16 -
libcxx/include/__cxx03/__fwd/pair.h | 10 -
libcxx/include/__cxx03/__fwd/string.h | 33 -
libcxx/include/__cxx03/__fwd/tuple.h | 26 -
libcxx/include/__cxx03/__hash_table | 161 ---
libcxx/include/__cxx03/__iterator/access.h | 41 -
libcxx/include/__cxx03/__iterator/advance.h | 127 --
.../__cxx03/__iterator/back_insert_iterator.h | 13 -
.../include/__cxx03/__iterator/bounded_iter.h | 24 -
.../__iterator/cpp17_iterator_concepts.h | 149 ---
libcxx/include/__cxx03/__iterator/distance.h | 47 -
.../__iterator/front_insert_iterator.h | 13 -
.../__cxx03/__iterator/insert_iterator.h | 19 -
.../__cxx03/__iterator/istream_iterator.h | 13 -
.../__cxx03/__iterator/istreambuf_iterator.h | 13 -
.../__cxx03/__iterator/iterator_traits.h | 272 -----
.../__cxx03/__iterator/move_iterator.h | 153 ---
libcxx/include/__cxx03/__iterator/next.h | 42 -
.../__cxx03/__iterator/ostream_iterator.h | 6 -
.../__cxx03/__iterator/ostreambuf_iterator.h | 6 -
libcxx/include/__cxx03/__iterator/prev.h | 36 -
.../__cxx03/__iterator/reverse_iterator.h | 114 --
libcxx/include/__cxx03/__iterator/wrap_iter.h | 37 +-
libcxx/include/__cxx03/__locale | 2 -
.../__locale_dir/locale_base_api/ibm.h | 2 +-
libcxx/include/__cxx03/__math/hypot.h | 51 -
libcxx/include/__cxx03/__memory/addressof.h | 5 -
.../include/__cxx03/__memory/aligned_alloc.h | 11 -
.../__cxx03/__memory/allocate_at_least.h | 11 -
libcxx/include/__cxx03/__memory/allocator.h | 95 --
.../__cxx03/__memory/allocator_arg_t.h | 43 -
.../__cxx03/__memory/allocator_traits.h | 47 -
.../include/__cxx03/__memory/assume_aligned.h | 9 -
libcxx/include/__cxx03/__memory/auto_ptr.h | 4 -
.../__cxx03/__memory/compressed_pair.h | 22 -
.../include/__cxx03/__memory/construct_at.h | 50 -
.../include/__cxx03/__memory/pointer_traits.h | 87 --
.../__cxx03/__memory/raw_storage_iterator.h | 19 -
libcxx/include/__cxx03/__memory/shared_ptr.h | 478 +-------
.../include/__cxx03/__memory/swap_allocator.h | 8 -
libcxx/include/__cxx03/__memory/temp_value.h | 10 -
.../__memory/uninitialized_algorithms.h | 341 ------
libcxx/include/__cxx03/__memory/unique_ptr.h | 113 +-
.../include/__cxx03/__memory/uses_allocator.h | 5 -
libcxx/include/__cxx03/__mutex/once_flag.h | 58 -
libcxx/include/__cxx03/__mutex/tag_types.h | 10 -
libcxx/include/__cxx03/__numeric/accumulate.h | 8 -
.../__cxx03/__numeric/adjacent_difference.h | 8 -
.../include/__cxx03/__numeric/inner_product.h | 8 -
.../include/__cxx03/__numeric/partial_sum.h | 8 -
.../include/__cxx03/__ostream/basic_ostream.h | 63 -
.../__cxx03/__random/bernoulli_distribution.h | 5 -
.../__cxx03/__random/binomial_distribution.h | 6 -
.../__cxx03/__random/cauchy_distribution.h | 6 -
.../__random/chi_squared_distribution.h | 5 -
.../__cxx03/__random/discard_block_engine.h | 11 -
.../__cxx03/__random/discrete_distribution.h | 6 -
.../__random/exponential_distribution.h | 5 -
.../__random/extreme_value_distribution.h | 6 -
.../__cxx03/__random/fisher_f_distribution.h | 6 -
.../__cxx03/__random/gamma_distribution.h | 6 -
.../__cxx03/__random/generate_canonical.h | 4 -
.../__cxx03/__random/geometric_distribution.h | 5 -
.../__random/independent_bits_engine.h | 7 -
.../__random/linear_congruential_engine.h | 5 -
.../__cxx03/__random/lognormal_distribution.h | 5 -
.../__random/mersenne_twister_engine.h | 5 -
.../__random/negative_binomial_distribution.h | 5 -
.../__cxx03/__random/normal_distribution.h | 6 -
.../piecewise_constant_distribution.h | 33 -
.../__random/piecewise_linear_distribution.h | 33 -
.../__cxx03/__random/poisson_distribution.h | 5 -
.../include/__cxx03/__random/random_device.h | 5 -
libcxx/include/__cxx03/__random/seed_seq.h | 6 -
.../__cxx03/__random/shuffle_order_engine.h | 8 -
.../__cxx03/__random/student_t_distribution.h | 5 -
.../__random/subtract_with_carry_engine.h | 5 -
.../__random/uniform_int_distribution.h | 11 -
.../__random/uniform_real_distribution.h | 6 -
.../__cxx03/__random/weibull_distribution.h | 6 -
libcxx/include/__cxx03/__string/char_traits.h | 6 -
.../__cxx03/__string/constexpr_c_functions.h | 8 -
.../__cxx03/__system_error/error_category.h | 10 -
.../__cxx03/__system_error/error_code.h | 19 -
.../__cxx03/__system_error/error_condition.h | 20 -
libcxx/include/__cxx03/__thread/id.h | 18 -
libcxx/include/__cxx03/__thread/thread.h | 39 -
libcxx/include/__cxx03/__tree | 175 +--
libcxx/include/__cxx03/__tuple/find_index.h | 42 -
.../__cxx03/__tuple/make_tuple_types.h | 52 -
.../include/__cxx03/__tuple/sfinae_helpers.h | 106 --
.../include/__cxx03/__tuple/tuple_element.h | 15 -
.../include/__cxx03/__tuple/tuple_indices.h | 17 -
libcxx/include/__cxx03/__tuple/tuple_like.h | 16 -
.../include/__cxx03/__tuple/tuple_like_ext.h | 5 -
.../__cxx03/__tuple/tuple_like_no_subrange.h | 32 -
libcxx/include/__cxx03/__tuple/tuple_size.h | 38 -
.../include/__cxx03/__type_traits/add_const.h | 5 -
libcxx/include/__cxx03/__type_traits/add_cv.h | 5 -
.../__type_traits/add_lvalue_reference.h | 5 -
.../__cxx03/__type_traits/add_pointer.h | 5 -
.../__type_traits/add_rvalue_reference.h | 5 -
.../__cxx03/__type_traits/add_volatile.h | 5 -
.../__cxx03/__type_traits/aligned_storage.h | 9 -
.../__cxx03/__type_traits/aligned_union.h | 5 -
.../__cxx03/__type_traits/alignment_of.h | 5 -
.../__cxx03/__type_traits/common_type.h | 23 -
.../__cxx03/__type_traits/conditional.h | 5 -
.../__cxx03/__type_traits/conjunction.h | 16 -
libcxx/include/__cxx03/__type_traits/decay.h | 5 -
.../__cxx03/__type_traits/disjunction.h | 10 -
.../include/__cxx03/__type_traits/enable_if.h | 5 -
libcxx/include/__cxx03/__type_traits/extent.h | 10 -
.../__type_traits/has_virtual_destructor.h | 5 -
.../__cxx03/__type_traits/integral_constant.h | 8 -
libcxx/include/__cxx03/__type_traits/invoke.h | 49 -
.../__cxx03/__type_traits/is_abstract.h | 5 -
.../__cxx03/__type_traits/is_arithmetic.h | 5 -
.../include/__cxx03/__type_traits/is_array.h | 10 -
.../__cxx03/__type_traits/is_assignable.h | 15 -
.../__cxx03/__type_traits/is_base_of.h | 5 -
.../__cxx03/__type_traits/is_bounded_array.h | 12 -
.../include/__cxx03/__type_traits/is_class.h | 5 -
.../__cxx03/__type_traits/is_compound.h | 10 -
.../include/__cxx03/__type_traits/is_const.h | 10 -
.../__type_traits/is_constant_evaluated.h | 6 -
.../__cxx03/__type_traits/is_constructible.h | 20 -
.../__cxx03/__type_traits/is_convertible.h | 5 -
.../__cxx03/__type_traits/is_destructible.h | 10 -
.../include/__cxx03/__type_traits/is_empty.h | 5 -
.../include/__cxx03/__type_traits/is_enum.h | 15 -
.../__type_traits/is_execution_policy.h | 40 -
.../include/__cxx03/__type_traits/is_final.h | 10 -
.../__cxx03/__type_traits/is_floating_point.h | 5 -
.../__cxx03/__type_traits/is_function.h | 5 -
.../__cxx03/__type_traits/is_fundamental.h | 10 -
.../is_implicitly_default_constructible.h | 22 -
.../__cxx03/__type_traits/is_integral.h | 10 -
.../__cxx03/__type_traits/is_literal_type.h | 7 -
.../__cxx03/__type_traits/is_member_pointer.h | 11 -
.../__type_traits/is_nothrow_assignable.h | 15 -
.../__type_traits/is_nothrow_constructible.h | 20 -
.../__type_traits/is_nothrow_destructible.h | 5 -
.../__cxx03/__type_traits/is_null_pointer.h | 10 -
.../include/__cxx03/__type_traits/is_object.h | 5 -
libcxx/include/__cxx03/__type_traits/is_pod.h | 5 -
.../__cxx03/__type_traits/is_pointer.h | 10 -
.../__cxx03/__type_traits/is_polymorphic.h | 5 -
.../__cxx03/__type_traits/is_reference.h | 20 -
.../include/__cxx03/__type_traits/is_same.h | 5 -
.../include/__cxx03/__type_traits/is_scalar.h | 10 -
.../include/__cxx03/__type_traits/is_signed.h | 10 -
.../__cxx03/__type_traits/is_specialization.h | 10 -
.../__type_traits/is_standard_layout.h | 5 -
.../__cxx03/__type_traits/is_swappable.h | 42 -
.../__cxx03/__type_traits/is_trivial.h | 5 -
.../__type_traits/is_trivially_assignable.h | 15 -
.../is_trivially_constructible.h | 20 -
.../__type_traits/is_trivially_copyable.h | 10 -
.../__type_traits/is_trivially_destructible.h | 5 -
.../__type_traits/is_unbounded_array.h | 12 -
.../include/__cxx03/__type_traits/is_union.h | 5 -
.../__cxx03/__type_traits/is_unsigned.h | 10 -
.../include/__cxx03/__type_traits/is_void.h | 5 -
.../__cxx03/__type_traits/is_volatile.h | 10 -
.../__type_traits/make_32_64_or_128_bit.h | 3 -
.../__cxx03/__type_traits/make_signed.h | 5 -
.../__cxx03/__type_traits/make_unsigned.h | 12 -
libcxx/include/__cxx03/__type_traits/nat.h | 9 +-
.../include/__cxx03/__type_traits/negation.h | 7 -
.../noexcept_move_assign_container.h | 10 +-
libcxx/include/__cxx03/__type_traits/rank.h | 5 -
.../__type_traits/remove_all_extents.h | 5 -
.../__cxx03/__type_traits/remove_const.h | 5 -
.../include/__cxx03/__type_traits/remove_cv.h | 5 -
.../__cxx03/__type_traits/remove_cvref.h | 10 -
.../__cxx03/__type_traits/remove_extent.h | 5 -
.../__cxx03/__type_traits/remove_pointer.h | 5 -
.../__cxx03/__type_traits/remove_reference.h | 5 -
.../__cxx03/__type_traits/remove_volatile.h | 5 -
.../include/__cxx03/__type_traits/result_of.h | 7 -
.../__cxx03/__type_traits/strip_signature.h | 63 -
.../__cxx03/__type_traits/type_identity.h | 9 -
.../__cxx03/__type_traits/underlying_type.h | 5 -
.../__cxx03/__type_traits/unwrap_ref.h | 23 +-
libcxx/include/__cxx03/__type_traits/void_t.h | 5 -
libcxx/include/__cxx03/__utility/as_lvalue.h | 9 -
.../__cxx03/__utility/integer_sequence.h | 42 -
libcxx/include/__cxx03/__utility/pair.h | 430 +------
.../__cxx03/__utility/piecewise_construct.h | 6 -
.../include/__cxx03/__utility/small_buffer.h | 73 --
libcxx/include/__cxx03/__utility/swap.h | 5 -
.../include/__cxx03/__utility/unreachable.h | 6 -
libcxx/include/__cxx03/__variant/monostate.h | 38 -
libcxx/include/__cxx03/algorithm | 6 +-
libcxx/include/__cxx03/array | 51 +-
libcxx/include/__cxx03/atomic | 4 +-
libcxx/include/__cxx03/bitset | 53 +-
libcxx/include/__cxx03/chrono | 14 +-
libcxx/include/__cxx03/cmath | 41 +-
libcxx/include/__cxx03/codecvt | 6 +-
libcxx/include/__cxx03/complex | 146 +--
libcxx/include/__cxx03/condition_variable | 100 +-
libcxx/include/__cxx03/cstddef | 69 --
libcxx/include/__cxx03/cstdio | 2 -
libcxx/include/__cxx03/cstdlib | 7 -
libcxx/include/__cxx03/ctime | 6 -
libcxx/include/__cxx03/cuchar | 16 -
libcxx/include/__cxx03/cwchar | 6 +-
libcxx/include/__cxx03/deque | 460 +------
libcxx/include/__cxx03/exception | 2 +-
libcxx/include/__cxx03/ext/hash_map | 10 +-
libcxx/include/__cxx03/ext/hash_set | 3 +-
libcxx/include/__cxx03/forward_list | 307 +----
libcxx/include/__cxx03/fstream | 114 +-
libcxx/include/__cxx03/functional | 25 +-
libcxx/include/__cxx03/future | 120 +-
libcxx/include/__cxx03/iomanip | 32 -
libcxx/include/__cxx03/ios | 13 +-
libcxx/include/__cxx03/iosfwd | 20 -
libcxx/include/__cxx03/istream | 30 +-
libcxx/include/__cxx03/iterator | 6 +-
libcxx/include/__cxx03/limits | 2 +-
libcxx/include/__cxx03/list | 347 +-----
libcxx/include/__cxx03/locale | 34 +-
libcxx/include/__cxx03/map | 815 +------------
libcxx/include/__cxx03/memory | 20 +-
libcxx/include/__cxx03/mutex | 141 +--
libcxx/include/__cxx03/new | 40 +-
libcxx/include/__cxx03/numeric | 5 +-
libcxx/include/__cxx03/ostream | 6 +-
libcxx/include/__cxx03/queue | 353 +-----
libcxx/include/__cxx03/random | 2 +-
libcxx/include/__cxx03/ratio | 58 +-
libcxx/include/__cxx03/regex | 182 +--
libcxx/include/__cxx03/set | 558 +--------
libcxx/include/__cxx03/sstream | 386 +-----
libcxx/include/__cxx03/stack | 119 +-
libcxx/include/__cxx03/stdatomic.h | 4 +-
libcxx/include/__cxx03/stdexcept | 2 +-
libcxx/include/__cxx03/streambuf | 2 +-
libcxx/include/__cxx03/string | 630 +---------
libcxx/include/__cxx03/string_view | 155 +--
libcxx/include/__cxx03/strstream | 84 --
libcxx/include/__cxx03/system_error | 2 +-
libcxx/include/__cxx03/thread | 4 +-
libcxx/include/__cxx03/type_traits | 26 -
libcxx/include/__cxx03/typeindex | 13 +-
libcxx/include/__cxx03/typeinfo | 6 +-
libcxx/include/__cxx03/uchar.h | 15 -
libcxx/include/__cxx03/unordered_map | 1055 +----------------
libcxx/include/__cxx03/unordered_set | 755 +-----------
libcxx/include/__cxx03/utility | 24 +-
libcxx/include/__cxx03/valarray | 163 +--
libcxx/include/__cxx03/vector | 392 +-----
libcxx/include/__cxx03/version | 293 -----
308 files changed, 109 insertions(+), 15447 deletions(-)
diff --git a/libcxx/include/__cxx03/__algorithm/equal.h b/libcxx/include/__cxx03/__algorithm/equal.h
index 4e478932981e7..e1724ad5c111b 100644
--- a/libcxx/include/__cxx03/__algorithm/equal.h
+++ b/libcxx/include/__cxx03/__algorithm/equal.h
@@ -67,65 +67,6 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
return std::equal(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER >= 14
-
-template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
- _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __comp, _Proj1& __proj1, _Proj2& __proj2) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (!std::__invoke(__comp, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
- return false;
- ++__first1;
- ++__first2;
- }
- return __first1 == __last1 && __first2 == __last2;
-}
-
-template <class _Tp,
- class _Up,
- class _Pred,
- class _Proj1,
- class _Proj2,
- __enable_if_t<__desugars_to_v<__equal_tag, _Pred, _Tp, _Up> && __is_identity<_Proj1>::value &&
- __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value &&
- __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
- int> = 0>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-__equal_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) {
- return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
-}
-
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-equal(_InputIterator1 __first1,
- _InputIterator1 __last1,
- _InputIterator2 __first2,
- _InputIterator2 __last2,
- _BinaryPredicate __pred) {
- if constexpr (__has_random_access_iterator_category<_InputIterator1>::value &&
- __has_random_access_iterator_category<_InputIterator2>::value) {
- if (std::distance(__first1, __last1) != std::distance(__first2, __last2))
- return false;
- }
- __identity __proj;
- return std::__equal_impl(
- std::__unwrap_iter(__first1),
- std::__unwrap_iter(__last1),
- std::__unwrap_iter(__first2),
- std::__unwrap_iter(__last2),
- __pred,
- __proj,
- __proj);
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
- return std::equal(__first1, __last1, __first2, __last2, __equal_to());
-}
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/for_each.h b/libcxx/include/__cxx03/__algorithm/for_each.h
index a6faf805fe9cf..97c41d1abe577 100644
--- a/libcxx/include/__cxx03/__algorithm/for_each.h
+++ b/libcxx/include/__cxx03/__algorithm/for_each.h
@@ -35,21 +35,6 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f) {
return __f;
}
-// __movable_box is available in C++20, but is actually a copyable-box, so optimization is only correct in C++23
-#if _LIBCPP_STD_VER >= 23
-template <class _SegmentedIterator, class _Function>
- requires __is_segmented_iterator<_SegmentedIterator>::value
-_LIBCPP_HIDE_FROM_ABI constexpr _Function
-for_each(_SegmentedIterator __first, _SegmentedIterator __last, _Function __func) {
- ranges::__movable_box<_Function> __wrapped_func(in_place, std::move(__func));
- std::__for_each_segment(__first, __last, [&](auto __lfirst, auto __llast) {
- __wrapped_func =
- ranges::__movable_box<_Function>(in_place, std::for_each(__lfirst, __llast, std::move(*__wrapped_func)));
- });
- return std::move(*__wrapped_func);
-}
-#endif // _LIBCPP_STD_VER >= 23
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/is_permutation.h b/libcxx/include/__cxx03/__algorithm/is_permutation.h
index fd29e82656a3c..5477d6fce8ee3 100644
--- a/libcxx/include/__cxx03/__algorithm/is_permutation.h
+++ b/libcxx/include/__cxx03/__algorithm/is_permutation.h
@@ -34,18 +34,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class = void>
struct _ConstTimeDistance : false_type {};
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Iter1, class _Sent1, class _Iter2, class _Sent2>
-struct _ConstTimeDistance<_Iter1,
- _Sent1,
- _Iter2,
- _Sent2,
- __enable_if_t< sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2> >>
- : true_type {};
-
-#else
-
template <class _Iter1, class _Iter2>
struct _ConstTimeDistance<
_Iter1,
@@ -56,8 +44,6 @@ struct _ConstTimeDistance<
is_same<typename iterator_traits<_Iter2>::iterator_category, random_access_iterator_tag>::value > >
: true_type {};
-#endif // _LIBCPP_STD_VER >= 20
-
// Internal functions
// For each element in [f1, l1) see if there are the same number of equal elements in [f2, l2)
@@ -262,45 +248,6 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
return std::is_permutation(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER >= 14
-
-// 2+2 iterators
-template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation(
- _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
- return std::__is_permutation<_ClassicAlgPolicy>(
- std::move(__first1),
- std::move(__last1),
- std::move(__first2),
- std::move(__last2),
- __equal_to(),
- __identity(),
- __identity());
-}
-
-// 2+2 iterators, predicate
-template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation(
- _ForwardIterator1 __first1,
- _ForwardIterator1 __last1,
- _ForwardIterator2 __first2,
- _ForwardIterator2 __last2,
- _BinaryPredicate __pred) {
- static_assert(__is_callable<_BinaryPredicate, decltype(*__first1), decltype(*__first2)>::value,
- "The predicate has to be callable");
-
- return std::__is_permutation<_ClassicAlgPolicy>(
- std::move(__first1),
- std::move(__last1),
- std::move(__first2),
- std::move(__last2),
- __pred,
- __identity(),
- __identity());
-}
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/iterator_operations.h b/libcxx/include/__cxx03/__algorithm/iterator_operations.h
index 24973b66e4f96..863741112db3f 100644
--- a/libcxx/include/__cxx03/__algorithm/iterator_operations.h
+++ b/libcxx/include/__cxx03/__algorithm/iterator_operations.h
@@ -42,31 +42,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy>
struct _IterOps;
-#if _LIBCPP_STD_VER >= 20
-struct _RangeAlgPolicy {};
-
-template <>
-struct _IterOps<_RangeAlgPolicy> {
- template <class _Iter>
- using __value_type = iter_value_t<_Iter>;
-
- template <class _Iter>
- using __iterator_category = ranges::__iterator_concept<_Iter>;
-
- template <class _Iter>
- using __difference_type = iter_difference_t<_Iter>;
-
- static constexpr auto advance = ranges::advance;
- static constexpr auto distance = ranges::distance;
- static constexpr auto __iter_move = ranges::iter_move;
- static constexpr auto iter_swap = ranges::iter_swap;
- static constexpr auto next = ranges::next;
- static constexpr auto prev = ranges::prev;
- static constexpr auto __advance_to = ranges::advance;
-};
-
-#endif
-
struct _ClassicAlgPolicy {};
template <>
diff --git a/libcxx/include/__cxx03/__algorithm/make_projected.h b/libcxx/include/__cxx03/__algorithm/make_projected.h
index ac17c2bba7ba8..50fa3099c48f9 100644
--- a/libcxx/include/__cxx03/__algorithm/make_projected.h
+++ b/libcxx/include/__cxx03/__algorithm/make_projected.h
@@ -74,33 +74,4 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Pred& __make_projected(_Pred& __pred, _
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-namespace ranges {
-
-template <class _Comp, class _Proj1, class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __proj2) {
- if constexpr (__is_identity<decay_t<_Proj1>>::value && __is_identity<decay_t<_Proj2>>::value &&
- !is_member_pointer_v<decay_t<_Comp>>) {
- // Avoid creating the lambda and just use the pristine comparator -- for certain algorithms, this would enable
- // optimizations that rely on the type of the comparator.
- return __comp;
-
- } else {
- return [&](auto&& __lhs, auto&& __rhs) -> bool {
- return std::invoke(__comp,
- std::invoke(__proj1, std::forward<decltype(__lhs)>(__lhs)),
- std::invoke(__proj2, std::forward<decltype(__rhs)>(__rhs)));
- };
- }
-}
-
-} // namespace ranges
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER >= 20
-
#endif // _LIBCPP___CXX03___ALGORITHM_MAKE_PROJECTED_H
diff --git a/libcxx/include/__cxx03/__algorithm/max.h b/libcxx/include/__cxx03/__algorithm/max.h
index 7726d16827157..2eb0ff00e0df0 100644
--- a/libcxx/include/__cxx03/__algorithm/max.h
+++ b/libcxx/include/__cxx03/__algorithm/max.h
@@ -36,21 +36,6 @@ max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
return std::max(__a, __b, __less<>());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp
-max(initializer_list<_Tp> __t, _Compare __comp) {
- return *std::__max_element<__comp_ref_type<_Compare> >(__t.begin(), __t.end(), __comp);
-}
-
-template <class _Tp>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp max(initializer_list<_Tp> __t) {
- return *std::max_element(__t.begin(), __t.end(), __less<>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/min.h b/libcxx/include/__cxx03/__algorithm/min.h
index d4801ab3330da..c81a3af0efa33 100644
--- a/libcxx/include/__cxx03/__algorithm/min.h
+++ b/libcxx/include/__cxx03/__algorithm/min.h
@@ -36,21 +36,6 @@ min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
return std::min(__a, __b, __less<>());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp
-min(initializer_list<_Tp> __t, _Compare __comp) {
- return *std::__min_element<__comp_ref_type<_Compare> >(__t.begin(), __t.end(), __comp);
-}
-
-template <class _Tp>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp min(initializer_list<_Tp> __t) {
- return *std::min_element(__t.begin(), __t.end(), __less<>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/minmax.h b/libcxx/include/__cxx03/__algorithm/minmax.h
index e09a5b04104aa..027f5c831c3af 100644
--- a/libcxx/include/__cxx03/__algorithm/minmax.h
+++ b/libcxx/include/__cxx03/__algorithm/minmax.h
@@ -35,25 +35,6 @@ minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __
return std::minmax(__a, __b, __less<>());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp>
-minmax(initializer_list<_Tp> __t, _Compare __comp) {
- static_assert(__is_callable<_Compare, _Tp, _Tp>::value, "The comparator has to be callable");
- __identity __proj;
- auto __ret = std::__minmax_element_impl(__t.begin(), __t.end(), __comp, __proj);
- return pair<_Tp, _Tp>(*__ret.first, *__ret.second);
-}
-
-template <class _Tp>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp>
-minmax(initializer_list<_Tp> __t) {
- return std::minmax(__t, __less<>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ALGORITHM_MINMAX_H
diff --git a/libcxx/include/__cxx03/__algorithm/mismatch.h b/libcxx/include/__cxx03/__algorithm/mismatch.h
index 163bc8fb165c0..baf464c25e86f 100644
--- a/libcxx/include/__cxx03/__algorithm/mismatch.h
+++ b/libcxx/include/__cxx03/__algorithm/mismatch.h
@@ -164,52 +164,6 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
return std::mismatch(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER >= 14
-template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
-_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter2> __mismatch(
- _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (!std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
- break;
- ++__first1;
- ++__first2;
- }
- return {std::move(__first1), std::move(__first2)};
-}
-
-template <class _Tp, class _Pred, class _Proj1, class _Proj2>
-_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*>
-__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
- auto __len = std::min(__last1 - __first1, __last2 - __first2);
- return std::__mismatch(__first1, __first1 + __len, __first2, __pred, __proj1, __proj2);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1,
- _InputIterator1 __last1,
- _InputIterator2 __first2,
- _InputIterator2 __last2,
- _BinaryPredicate __pred) {
- __identity __proj;
- auto __res = std::__mismatch(
- std::__unwrap_iter(__first1),
- std::__unwrap_iter(__last1),
- std::__unwrap_iter(__first2),
- std::__unwrap_iter(__last2),
- __pred,
- __proj,
- __proj);
- return {std::__rewrap_iter(__first1, __res.first), std::__rewrap_iter(__first2, __res.second)};
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
- return std::mismatch(__first1, __last1, __first2, __last2, __equal_to());
-}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__algorithm/search.h b/libcxx/include/__cxx03/__algorithm/search.h
index 7ca6bdbc2beb5..14a0d448e1004 100644
--- a/libcxx/include/__cxx03/__algorithm/search.h
+++ b/libcxx/include/__cxx03/__algorithm/search.h
@@ -178,15 +178,6 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2
return std::search(__first1, __last1, __first2, __last2, __equal_to());
}
-#if _LIBCPP_STD_VER >= 17
-template <class _ForwardIterator, class _Searcher>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
-search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) {
- return __s(__f, __l).first;
-}
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ALGORITHM_SEARCH_H
diff --git a/libcxx/include/__cxx03/__algorithm/shuffle.h b/libcxx/include/__cxx03/__algorithm/shuffle.h
index abb96bce40236..173af1bf25290 100644
--- a/libcxx/include/__cxx03/__algorithm/shuffle.h
+++ b/libcxx/include/__cxx03/__algorithm/shuffle.h
@@ -62,7 +62,6 @@ class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {
}
};
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) || defined(_LIBCPP_BUILDING_LIBRARY)
class _LIBCPP_EXPORTED_FROM_ABI __rs_default;
_LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
@@ -111,14 +110,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) {
template <class _RandomAccessIterator, class _RandomNumberGenerator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX14 void
-random_shuffle(_RandomAccessIterator __first,
- _RandomAccessIterator __last,
-# ifndef _LIBCPP_CXX03_LANG
- _RandomNumberGenerator&& __rand)
-# else
- _RandomNumberGenerator& __rand)
-# endif
-{
+random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomNumberGenerator&& __rand) {
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
difference_type __d = __last - __first;
if (__d > 1) {
@@ -129,7 +121,6 @@ random_shuffle(_RandomAccessIterator __first,
}
}
}
-#endif
template <class _AlgPolicy, class _RandomAccessIterator, class _Sentinel, class _UniformRandomNumberGenerator>
_LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
diff --git a/libcxx/include/__cxx03/__algorithm/simd_utils.h b/libcxx/include/__cxx03/__algorithm/simd_utils.h
index db2e20fb65ece..5f0a85fbe1230 100644
--- a/libcxx/include/__cxx03/__algorithm/simd_utils.h
+++ b/libcxx/include/__cxx03/__algorithm/simd_utils.h
@@ -28,11 +28,7 @@ _LIBCPP_PUSH_MACROS
#include <__cxx03/__undef_macros>
// TODO: Find out how altivec changes things and allow vectorizations there too.
-#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__)
-# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1
-#else
-# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0
-#endif
+#define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0
#if _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS && !defined(__OPTIMIZE_SIZE__)
# define _LIBCPP_VECTORIZE_ALGORITHMS 1
diff --git a/libcxx/include/__cxx03/__algorithm/sort.h b/libcxx/include/__cxx03/__algorithm/sort.h
index 009ebf717bbd8..a1a08d22eee76 100644
--- a/libcxx/include/__cxx03/__algorithm/sort.h
+++ b/libcxx/include/__cxx03/__algorithm/sort.h
@@ -136,12 +136,6 @@ template <class _Tp>
struct __is_simple_comparator<less<_Tp>&> : true_type {};
template <class _Tp>
struct __is_simple_comparator<greater<_Tp>&> : true_type {};
-#if _LIBCPP_STD_VER >= 20
-template <>
-struct __is_simple_comparator<ranges::less&> : true_type {};
-template <>
-struct __is_simple_comparator<ranges::greater&> : true_type {};
-#endif
template <class _Compare, class _Iter, class _Tp = typename iterator_traits<_Iter>::value_type>
using __use_branchless_sort =
@@ -967,22 +961,6 @@ _LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<_
std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
}
-#if _LIBCPP_STD_VER >= 14
-template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<>&) {
- __less<_Type> __comp;
- std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, ranges::less&) {
- __less<_Type> __comp;
- std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
-}
-#endif
-
template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
__sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
diff --git a/libcxx/include/__cxx03/__algorithm/three_way_comp_ref_type.h b/libcxx/include/__cxx03/__algorithm/three_way_comp_ref_type.h
index 4463bd2115482..7e978b8df3fae 100644
--- a/libcxx/include/__cxx03/__algorithm/three_way_comp_ref_type.h
+++ b/libcxx/include/__cxx03/__algorithm/three_way_comp_ref_type.h
@@ -21,54 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Comp>
-struct __debug_three_way_comp {
- _Comp& __comp_;
- _LIBCPP_HIDE_FROM_ABI constexpr __debug_three_way_comp(_Comp& __c) : __comp_(__c) {}
-
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(const _Tp& __x, const _Up& __y) {
- auto __r = __comp_(__x, __y);
- if constexpr (__comparison_category<decltype(__comp_(__x, __y))>)
- __do_compare_assert(__y, __x, __r);
- return __r;
- }
-
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __x, _Up& __y) {
- auto __r = __comp_(__x, __y);
- if constexpr (__comparison_category<decltype(__comp_(__x, __y))>)
- __do_compare_assert(__y, __x, __r);
- return __r;
- }
-
- template <class _LHS, class _RHS, class _Order>
- _LIBCPP_HIDE_FROM_ABI constexpr void __do_compare_assert(_LHS& __l, _RHS& __r, _Order __o) {
- _Order __expected = __o;
- if (__o == _Order::less)
- __expected = _Order::greater;
- if (__o == _Order::greater)
- __expected = _Order::less;
- _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
- __comp_(__l, __r) == __expected, "Comparator does not induce a strict weak ordering");
- (void)__l;
- (void)__r;
- }
-};
-
-// Pass the comparator by lvalue reference. Or in the debug mode, using a debugging wrapper that stores a reference.
-# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
-template <class _Comp>
-using __three_way_comp_ref_type = __debug_three_way_comp<_Comp>;
-# else
-template <class _Comp>
-using __three_way_comp_ref_type = _Comp&;
-# endif
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
diff --git a/libcxx/include/__cxx03/__algorithm/uniform_random_bit_generator_adaptor.h b/libcxx/include/__cxx03/__algorithm/uniform_random_bit_generator_adaptor.h
index 8d3858226b992..ef789bf138f62 100644
--- a/libcxx/include/__cxx03/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/libcxx/include/__cxx03/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -17,42 +17,4 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_PUSH_MACROS
-# include <__cxx03/__undef_macros>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// Range versions of random algorithms (e.g. `std::shuffle`) are less constrained than their classic counterparts.
-// Range algorithms only require the given generator to satisfy the `std::uniform_random_bit_generator` concept.
-// Classic algorithms require the given generator to meet the uniform random bit generator requirements; these
-// requirements include satisfying `std::uniform_random_bit_generator` and add a requirement for the generator to
-// provide a nested `result_type` typedef (see `[rand.req.urng]`).
-//
-// To be able to reuse classic implementations, make the given generator meet the classic requirements by wrapping
-// it into an adaptor type that forwards all of its interface and adds the required typedef.
-template <class _Gen>
-class _ClassicGenAdaptor {
-private:
- // The generator is not required to be copyable or movable, so it has to be stored as a reference.
- _Gen& __gen_;
-
-public:
- using result_type = invoke_result_t<_Gen&>;
-
- _LIBCPP_HIDE_FROM_ABI static constexpr auto min() { return __remove_cvref_t<_Gen>::min(); }
- _LIBCPP_HIDE_FROM_ABI static constexpr auto max() { return __remove_cvref_t<_Gen>::max(); }
-
- _LIBCPP_HIDE_FROM_ABI constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen_(__g) {}
-
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator()() const { return __gen_(); }
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-_LIBCPP_POP_MACROS
-
-#endif // _LIBCPP_STD_VER >= 20
-
#endif // _LIBCPP___CXX03___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
diff --git a/libcxx/include/__cxx03/__algorithm/unwrap_iter.h b/libcxx/include/__cxx03/__algorithm/unwrap_iter.h
index 055f56b9db155..b79dcd46b1fa2 100644
--- a/libcxx/include/__cxx03/__algorithm/unwrap_iter.h
+++ b/libcxx/include/__cxx03/__algorithm/unwrap_iter.h
@@ -65,14 +65,6 @@ __unwrap_iter(_Iter __i) _NOEXCEPT {
return _Impl::__unwrap(__i);
}
-// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter, __enable_if_t<!is_copy_constructible<_Iter>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _Iter __unwrap_iter(_Iter __i) noexcept {
- return __i;
-}
-#endif
-
template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
diff --git a/libcxx/include/__cxx03/__algorithm/unwrap_range.h b/libcxx/include/__cxx03/__algorithm/unwrap_range.h
index 0b81f1e805c8a..2afc526f0c2a9 100644
--- a/libcxx/include/__cxx03/__algorithm/unwrap_range.h
+++ b/libcxx/include/__cxx03/__algorithm/unwrap_range.h
@@ -31,56 +31,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// __unwrap_iter and __rewrap_iter don't work for this, because they assume that the iterator and sentinel have
// the same type. __unwrap_range tries to get two iterators and then forward to __unwrap_iter.
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter, class _Sent>
-struct __unwrap_range_impl {
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)
- requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
- {
- auto __last = ranges::next(__first, __sent);
- return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __last) {
- return pair{std::move(__first), std::move(__last)};
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(std::move(__orig_iter))) __iter)
- requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
- {
- return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __rewrap(const _Iter&, _Iter __iter)
- requires(!(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>))
- {
- return __iter;
- }
-};
-
-template <class _Iter>
-struct __unwrap_range_impl<_Iter, _Iter> {
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Iter __last) {
- return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter) {
- return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
- }
-};
-
-template <class _Iter, class _Sent>
-_LIBCPP_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
- return __unwrap_range_impl<_Iter, _Sent>::__unwrap(std::move(__first), std::move(__last));
-}
-
-template < class _Sent, class _Iter, class _Unwrapped>
-_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
- return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));
-}
-#else // _LIBCPP_STD_VER >= 20
template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair<_Unwrapped, _Unwrapped> __unwrap_range(_Iter __first, _Iter __last) {
return std::make_pair(std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last)));
@@ -90,7 +40,6 @@ template <class _Iter, class _Unwrapped>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
}
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__atomic/aliases.h b/libcxx/include/__cxx03/__atomic/aliases.h
index 918ffc35ccf63..4cb75ee8712fd 100644
--- a/libcxx/include/__cxx03/__atomic/aliases.h
+++ b/libcxx/include/__cxx03/__atomic/aliases.h
@@ -80,31 +80,6 @@ using atomic_ptrdiff_t = atomic<ptrdiff_t>;
using atomic_intmax_t = atomic<intmax_t>;
using atomic_uintmax_t = atomic<uintmax_t>;
-// C++20 atomic_{signed,unsigned}_lock_free: prefer the contention type most highly, then the largest lock-free type
-#if _LIBCPP_STD_VER >= 20
-# if ATOMIC_LLONG_LOCK_FREE == 2
-using __largest_lock_free_type = long long;
-# elif ATOMIC_INT_LOCK_FREE == 2
-using __largest_lock_free_type = int;
-# elif ATOMIC_SHORT_LOCK_FREE == 2
-using __largest_lock_free_type = short;
-# elif ATOMIC_CHAR_LOCK_FREE == 2
-using __largest_lock_free_type = char;
-# else
-# define _LIBCPP_NO_LOCK_FREE_TYPES // There are no lockfree types (this can happen on unusual platforms)
-# endif
-
-# ifndef _LIBCPP_NO_LOCK_FREE_TYPES
-using __contention_t_or_largest =
- __conditional_t<__libcpp_is_always_lock_free<__cxx_contention_t>::__value,
- __cxx_contention_t,
- __largest_lock_free_type>;
-
-using atomic_signed_lock_free = atomic<__contention_t_or_largest>;
-using atomic_unsigned_lock_free = atomic<make_unsigned_t<__contention_t_or_largest>>;
-# endif // !_LIBCPP_NO_LOCK_FREE_TYPES
-#endif // C++20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ATOMIC_ALIASES_H
diff --git a/libcxx/include/__cxx03/__atomic/atomic.h b/libcxx/include/__cxx03/__atomic/atomic.h
index 9ac800613f824..f275ee32723f9 100644
--- a/libcxx/include/__cxx03/__atomic/atomic.h
+++ b/libcxx/include/__cxx03/__atomic/atomic.h
@@ -38,11 +38,7 @@ struct atomic : public __atomic_base<_Tp> {
using value_type = _Tp;
using difference_type = value_type;
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI atomic() = default;
-#else
_LIBCPP_HIDE_FROM_ABI atomic() _NOEXCEPT = default;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
@@ -121,136 +117,6 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {
atomic& operator=(const atomic&) volatile = delete;
};
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
- requires is_floating_point_v<_Tp>
-struct atomic<_Tp> : __atomic_base<_Tp> {
-private:
- _LIBCPP_HIDE_FROM_ABI static constexpr bool __is_fp80_long_double() {
- // Only x87-fp80 long double has 64-bit mantissa
- return __LDBL_MANT_DIG__ == 64 && std::is_same_v<_Tp, long double>;
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr bool __has_rmw_builtin() {
-# ifndef _LIBCPP_COMPILER_CLANG_BASED
- return false;
-# else
- // The builtin __cxx_atomic_fetch_add errors during compilation for
- // long double on platforms with fp80 format.
- // For more details, see
- // lib/Sema/SemaChecking.cpp function IsAllowedValueType
- // LLVM Parser does not allow atomicrmw with x86_fp80 type.
- // if (ValType->isSpecificBuiltinType(BuiltinType::LongDouble) &&
- // &Context.getTargetInfo().getLongDoubleFormat() ==
- // &llvm::APFloat::x87DoubleExtended())
- // For more info
- // https://github.com/llvm/llvm-project/issues/68602
- // https://reviews.llvm.org/D53965
- return !__is_fp80_long_double();
-# endif
- }
-
- template <class _This, class _Operation, class _BuiltinOp>
- _LIBCPP_HIDE_FROM_ABI static _Tp
- __rmw_op(_This&& __self, _Tp __operand, memory_order __m, _Operation __operation, _BuiltinOp __builtin_op) {
- if constexpr (__has_rmw_builtin()) {
- return __builtin_op(std::addressof(std::forward<_This>(__self).__a_), __operand, __m);
- } else {
- _Tp __old = __self.load(memory_order_relaxed);
- _Tp __new = __operation(__old, __operand);
- while (!__self.compare_exchange_weak(__old, __new, __m, memory_order_relaxed)) {
-# ifdef _LIBCPP_COMPILER_CLANG_BASED
- if constexpr (__is_fp80_long_double()) {
- // https://github.com/llvm/llvm-project/issues/47978
- // clang bug: __old is not updated on failure for atomic<long double>::compare_exchange_weak
- // Note __old = __self.load(memory_order_relaxed) will not work
- std::__cxx_atomic_load_inplace(std::addressof(__self.__a_), &__old, memory_order_relaxed);
- }
-# endif
- __new = __operation(__old, __operand);
- }
- return __old;
- }
- }
-
- template <class _This>
- _LIBCPP_HIDE_FROM_ABI static _Tp __fetch_add(_This&& __self, _Tp __operand, memory_order __m) {
- auto __builtin_op = [](auto __a, auto __builtin_operand, auto __order) {
- return std::__cxx_atomic_fetch_add(__a, __builtin_operand, __order);
- };
- return __rmw_op(std::forward<_This>(__self), __operand, __m, std::plus<>{}, __builtin_op);
- }
-
- template <class _This>
- _LIBCPP_HIDE_FROM_ABI static _Tp __fetch_sub(_This&& __self, _Tp __operand, memory_order __m) {
- auto __builtin_op = [](auto __a, auto __builtin_operand, auto __order) {
- return std::__cxx_atomic_fetch_sub(__a, __builtin_operand, __order);
- };
- return __rmw_op(std::forward<_This>(__self), __operand, __m, std::minus<>{}, __builtin_op);
- }
-
-public:
- using __base = __atomic_base<_Tp>;
- using value_type = _Tp;
- using difference_type = value_type;
-
- _LIBCPP_HIDE_FROM_ABI constexpr atomic() noexcept = default;
- _LIBCPP_HIDE_FROM_ABI constexpr atomic(_Tp __d) noexcept : __base(__d) {}
-
- atomic(const atomic&) = delete;
- atomic& operator=(const atomic&) = delete;
- atomic& operator=(const atomic&) volatile = delete;
-
- _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __d) volatile noexcept
- requires __base::is_always_lock_free
- {
- __base::store(__d);
- return __d;
- }
- _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __d) noexcept {
- __base::store(__d);
- return __d;
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept
- requires __base::is_always_lock_free
- {
- return __fetch_add(*this, __op, __m);
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept {
- return __fetch_add(*this, __op, __m);
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept
- requires __base::is_always_lock_free
- {
- return __fetch_sub(*this, __op, __m);
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept {
- return __fetch_sub(*this, __op, __m);
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __op) volatile noexcept
- requires __base::is_always_lock_free
- {
- return fetch_add(__op) + __op;
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp operator+=(_Tp __op) noexcept { return fetch_add(__op) + __op; }
-
- _LIBCPP_HIDE_FROM_ABI _Tp operator-=(_Tp __op) volatile noexcept
- requires __base::is_always_lock_free
- {
- return fetch_sub(__op) - __op;
- }
-
- _LIBCPP_HIDE_FROM_ABI _Tp operator-=(_Tp __op) noexcept { return fetch_sub(__op) - __op; }
-};
-
-#endif // _LIBCPP_STD_VER >= 20
-
// atomic_is_lock_free
template <class _Tp>
diff --git a/libcxx/include/__cxx03/__atomic/atomic_base.h b/libcxx/include/__cxx03/__atomic/atomic_base.h
index e4d4929b8912e..81424bc40938d 100644
--- a/libcxx/include/__cxx03/__atomic/atomic_base.h
+++ b/libcxx/include/__cxx03/__atomic/atomic_base.h
@@ -32,10 +32,6 @@ struct __atomic_base // false
{
mutable __cxx_atomic_impl<_Tp> __a_;
-#if _LIBCPP_STD_VER >= 17
- static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
-#endif
-
_LIBCPP_HIDE_FROM_ABI bool is_lock_free() const volatile _NOEXCEPT {
return __cxx_atomic_is_lock_free(sizeof(__cxx_atomic_impl<_Tp>));
}
@@ -118,11 +114,7 @@ struct __atomic_base // false
}
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
-#else
_LIBCPP_HIDE_FROM_ABI __atomic_base() _NOEXCEPT = default;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
diff --git a/libcxx/include/__cxx03/__atomic/atomic_flag.h b/libcxx/include/__cxx03/__atomic/atomic_flag.h
index c119e9bc498e6..fb2aac4ca9f78 100644
--- a/libcxx/include/__cxx03/__atomic/atomic_flag.h
+++ b/libcxx/include/__cxx03/__atomic/atomic_flag.h
@@ -68,12 +68,7 @@ struct atomic_flag {
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT {
std::__atomic_notify_all(*this);
}
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr atomic_flag() _NOEXCEPT : __a_(false) {}
-#else
atomic_flag() _NOEXCEPT = default;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
diff --git a/libcxx/include/__cxx03/__atomic/atomic_init.h b/libcxx/include/__cxx03/__atomic/atomic_init.h
index edabfe1a12bb4..16b275243aa6c 100644
--- a/libcxx/include/__cxx03/__atomic/atomic_init.h
+++ b/libcxx/include/__cxx03/__atomic/atomic_init.h
@@ -18,8 +18,4 @@
#define ATOMIC_FLAG_INIT {false}
#define ATOMIC_VAR_INIT(__v) {__v}
-#if _LIBCPP_STD_VER >= 20 && defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# pragma clang deprecated(ATOMIC_VAR_INIT)
-#endif
-
#endif // _LIBCPP___CXX03___ATOMIC_ATOMIC_INIT_H
diff --git a/libcxx/include/__cxx03/__atomic/cxx_atomic_impl.h b/libcxx/include/__cxx03/__atomic/cxx_atomic_impl.h
index 990d283c62d1a..c8dd6e788216a 100644
--- a/libcxx/include/__cxx03/__atomic/cxx_atomic_impl.h
+++ b/libcxx/include/__cxx03/__atomic/cxx_atomic_impl.h
@@ -45,12 +45,8 @@ _LIBCPP_HIDE_FROM_ABI void __cxx_atomic_assign_volatile(_Tp volatile& __a_value,
template <typename _Tp>
struct __cxx_atomic_base_impl {
_LIBCPP_HIDE_FROM_ABI
-# ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-# else
__cxx_atomic_base_impl() _NOEXCEPT : __a_value() {
}
-# endif // _LIBCPP_CXX03_LANG
_LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT : __a_value(value) {}
_Tp __a_value;
};
@@ -264,12 +260,8 @@ __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern, memory_o
template <typename _Tp>
struct __cxx_atomic_base_impl {
_LIBCPP_HIDE_FROM_ABI
-# ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-# else
__cxx_atomic_base_impl() _NOEXCEPT : __a_value() {
}
-# endif // _LIBCPP_CXX03_LANG
_LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT : __a_value(__value) {}
_LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
};
diff --git a/libcxx/include/__cxx03/__atomic/memory_order.h b/libcxx/include/__cxx03/__atomic/memory_order.h
index b8b9dda3d1150..d610c8609e8a3 100644
--- a/libcxx/include/__cxx03/__atomic/memory_order.h
+++ b/libcxx/include/__cxx03/__atomic/memory_order.h
@@ -26,29 +26,6 @@ enum __legacy_memory_order { __mo_relaxed, __mo_consume, __mo_acquire, __mo_rele
using __memory_order_underlying_t = underlying_type<__legacy_memory_order>::type;
-#if _LIBCPP_STD_VER >= 20
-
-enum class memory_order : __memory_order_underlying_t {
- relaxed = __mo_relaxed,
- consume = __mo_consume,
- acquire = __mo_acquire,
- release = __mo_release,
- acq_rel = __mo_acq_rel,
- seq_cst = __mo_seq_cst
-};
-
-static_assert(is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value,
- "unexpected underlying type for std::memory_order");
-
-inline constexpr auto memory_order_relaxed = memory_order::relaxed;
-inline constexpr auto memory_order_consume = memory_order::consume;
-inline constexpr auto memory_order_acquire = memory_order::acquire;
-inline constexpr auto memory_order_release = memory_order::release;
-inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
-inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
-
-#else
-
enum memory_order {
memory_order_relaxed = __mo_relaxed,
memory_order_consume = __mo_consume,
@@ -58,8 +35,6 @@ enum memory_order {
memory_order_seq_cst = __mo_seq_cst,
};
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ATOMIC_MEMORY_ORDER_H
diff --git a/libcxx/include/__cxx03/__bit/countl.h b/libcxx/include/__cxx03/__bit/countl.h
index 0c8181b53408c..7d39426262b1d 100644
--- a/libcxx/include/__cxx03/__bit/countl.h
+++ b/libcxx/include/__cxx03/__bit/countl.h
@@ -92,20 +92,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _
#endif // __has_builtin(__builtin_clzg)
}
-#if _LIBCPP_STD_VER >= 20
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
- return std::__countl_zero(__t);
-}
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
- return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__bit/countr.h b/libcxx/include/__cxx03/__bit/countr.h
index d9306a234cb30..d176402c0c4df 100644
--- a/libcxx/include/__cxx03/__bit/countr.h
+++ b/libcxx/include/__cxx03/__bit/countr.h
@@ -63,20 +63,6 @@ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __coun
#endif // __has_builtin(__builtin_ctzg)
}
-#if _LIBCPP_STD_VER >= 20
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
- return std::__countr_zero(__t);
-}
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
- return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__bit/popcount.h b/libcxx/include/__cxx03/__bit/popcount.h
index 835c07703f233..3c45cf8d56e81 100644
--- a/libcxx/include/__cxx03/__bit/popcount.h
+++ b/libcxx/include/__cxx03/__bit/popcount.h
@@ -38,32 +38,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_popcount(unsigned lo
return __builtin_popcountll(__x);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
-# if __has_builtin(__builtin_popcountg)
- return __builtin_popcountg(__t);
-# else // __has_builtin(__builtin_popcountg)
- if (sizeof(_Tp) <= sizeof(unsigned int))
- return std::__libcpp_popcount(static_cast<unsigned int>(__t));
- else if (sizeof(_Tp) <= sizeof(unsigned long))
- return std::__libcpp_popcount(static_cast<unsigned long>(__t));
- else if (sizeof(_Tp) <= sizeof(unsigned long long))
- return std::__libcpp_popcount(static_cast<unsigned long long>(__t));
- else {
- int __ret = 0;
- while (__t != 0) {
- __ret += std::__libcpp_popcount(static_cast<unsigned long long>(__t));
- __t >>= numeric_limits<unsigned long long>::digits;
- }
- return __ret;
- }
-# endif // __has_builtin(__builtin_popcountg)
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__bit/rotate.h b/libcxx/include/__cxx03/__bit/rotate.h
index 0ce3d2c7629db..1350e434835db 100644
--- a/libcxx/include/__cxx03/__bit/rotate.h
+++ b/libcxx/include/__cxx03/__bit/rotate.h
@@ -53,20 +53,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotr(_Tp __x, int __s)
return (__x << -__r) | (__x >> (__N + __r));
}
-#if _LIBCPP_STD_VER >= 20
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, int __cnt) noexcept {
- return std::__rotl(__t, __cnt);
-}
-
-template <__libcpp_unsigned_integer _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {
- return std::__rotr(__t, __cnt);
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___BIT_ROTATE_H
diff --git a/libcxx/include/__cxx03/__bit_reference b/libcxx/include/__cxx03/__bit_reference
index bf86f9a76e24a..d269076ec5f2a 100644
--- a/libcxx/include/__cxx03/__bit_reference
+++ b/libcxx/include/__cxx03/__bit_reference
@@ -76,16 +76,6 @@ public:
return *this;
}
-#if _LIBCPP_STD_VER >= 23
- _LIBCPP_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
- if (__x)
- *__seg_ |= __mask_;
- else
- *__seg_ &= ~__mask_;
- return *this;
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT {
return operator=(static_cast<bool>(__x));
}
@@ -802,13 +792,7 @@ private:
unsigned __ctz_;
public:
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER >= 14
- : __seg_(nullptr),
- __ctz_(0)
-#endif
- {
- }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator() _NOEXCEPT {}
// When _IsConst=false, this is the copy constructor.
// It is non-trivial. Making it trivial would break ABI.
@@ -914,7 +898,6 @@ public:
return __x.__seg_ == __y.__seg_ && __x.__ctz_ == __y.__ctz_;
}
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend bool
operator!=(const __bit_iterator& __x, const __bit_iterator& __y) {
return !(__x == __y);
@@ -939,18 +922,6 @@ public:
operator>=(const __bit_iterator& __x, const __bit_iterator& __y) {
return !(__x < __y);
}
-#else // _LIBCPP_STD_VER <= 17
- _LIBCPP_HIDE_FROM_ABI constexpr friend strong_ordering
- operator<=>(const __bit_iterator& __x, const __bit_iterator& __y) {
- if (__x.__seg_ < __y.__seg_)
- return strong_ordering::less;
-
- if (__x.__seg_ == __y.__seg_)
- return __x.__ctz_ <=> __y.__ctz_;
-
- return strong_ordering::greater;
- }
-#endif // _LIBCPP_STD_VER <= 17
private:
_LIBCPP_HIDE_FROM_ABI
diff --git a/libcxx/include/__cxx03/__chrono/duration.h b/libcxx/include/__cxx03/__chrono/duration.h
index fd936eda44eef..ca425e030899e 100644
--- a/libcxx/include/__cxx03/__chrono/duration.h
+++ b/libcxx/include/__cxx03/__chrono/duration.h
@@ -110,11 +110,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration duration_cast(const d
template <class _Rep>
struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Rep>
-inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
-#endif
-
template <class _Rep>
struct _LIBCPP_TEMPLATE_VIS duration_values {
public:
@@ -123,37 +118,6 @@ struct _LIBCPP_TEMPLATE_VIS duration_values {
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR _Rep min() _NOEXCEPT { return numeric_limits<_Rep>::lowest(); }
};
-#if _LIBCPP_STD_VER >= 17
-template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration floor(const duration<_Rep, _Period>& __d) {
- _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
- if (__t > __d)
- __t = __t - _ToDuration{1};
- return __t;
-}
-
-template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration ceil(const duration<_Rep, _Period>& __d) {
- _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
- if (__t < __d)
- __t = __t + _ToDuration{1};
- return __t;
-}
-
-template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToDuration round(const duration<_Rep, _Period>& __d) {
- _ToDuration __lower = chrono::floor<_ToDuration>(__d);
- _ToDuration __upper = __lower + _ToDuration{1};
- auto __lower_diff = __d - __lower;
- auto __upper_diff = __upper - __d;
- if (__lower_diff < __upper_diff)
- return __lower;
- if (__lower_diff > __upper_diff)
- return __upper;
- return __lower.count() & 1 ? __upper : __lower;
-}
-#endif
-
// duration
template <class _Rep, class _Period>
@@ -197,11 +161,7 @@ class _LIBCPP_TEMPLATE_VIS duration {
rep __rep_;
public:
-#ifndef _LIBCPP_CXX03_LANG
- constexpr duration() = default;
-#else
_LIBCPP_HIDE_FROM_ABI duration() {}
-#endif
template <class _Rep2,
__enable_if_t<is_convertible<const _Rep2&, rep>::value &&
@@ -287,12 +247,7 @@ typedef duration<long long, milli> milliseconds;
typedef duration<long long > seconds;
typedef duration< long, ratio< 60> > minutes;
typedef duration< long, ratio<3600> > hours;
-#if _LIBCPP_STD_VER >= 20
-typedef duration< int, ratio_multiply<ratio<24>, hours::period>> days;
-typedef duration< int, ratio_multiply<ratio<7>, days::period>> weeks;
-typedef duration< int, ratio_multiply<ratio<146097, 400>, days::period>> years;
-typedef duration< int, ratio_divide<years::period, ratio<12>>> months;
-#endif
+
// Duration ==
template <class _LhsDuration, class _RhsDuration>
@@ -316,8 +271,6 @@ operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
}
-#if _LIBCPP_STD_VER <= 17
-
// Duration !=
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -326,8 +279,6 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return !(__lhs == __rhs);
}
-#endif // _LIBCPP_STD_VER <= 17
-
// Duration <
template <class _LhsDuration, class _RhsDuration>
@@ -375,18 +326,6 @@ operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return !(__lhs < __rhs);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Rep1, class _Period1, class _Rep2, class _Period2>
- requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
-_LIBCPP_HIDE_FROM_ABI constexpr auto
-operator<=>(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
- using _Ct = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
- return _Ct(__lhs).count() <=> _Ct(__rhs).count();
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
// Duration +
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -477,73 +416,11 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
} // namespace chrono
-#if _LIBCPP_STD_VER >= 14
-// Suffixes for duration literals [time.duration.literals]
-inline namespace literals {
-inline namespace chrono_literals {
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::hours operator""h(unsigned long long __h) {
- return chrono::hours(static_cast<chrono::hours::rep>(__h));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<3600, 1>> operator""h(long double __h) {
- return chrono::duration<long double, ratio<3600, 1>>(__h);
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes operator""min(unsigned long long __m) {
- return chrono::minutes(static_cast<chrono::minutes::rep>(__m));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, ratio<60, 1>> operator""min(long double __m) {
- return chrono::duration<long double, ratio<60, 1>>(__m);
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds operator""s(unsigned long long __s) {
- return chrono::seconds(static_cast<chrono::seconds::rep>(__s));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double> operator""s(long double __s) {
- return chrono::duration<long double>(__s);
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::milliseconds operator""ms(unsigned long long __ms) {
- return chrono::milliseconds(static_cast<chrono::milliseconds::rep>(__ms));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, milli> operator""ms(long double __ms) {
- return chrono::duration<long double, milli>(__ms);
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::microseconds operator""us(unsigned long long __us) {
- return chrono::microseconds(static_cast<chrono::microseconds::rep>(__us));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, micro> operator""us(long double __us) {
- return chrono::duration<long double, micro>(__us);
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::nanoseconds operator""ns(unsigned long long __ns) {
- return chrono::nanoseconds(static_cast<chrono::nanoseconds::rep>(__ns));
-}
-
-_LIBCPP_HIDE_FROM_ABI constexpr chrono::duration<long double, nano> operator""ns(long double __ns) {
- return chrono::duration<long double, nano>(__ns);
-}
-
-} // namespace chrono_literals
-} // namespace literals
-
-namespace chrono { // hoist the literals into namespace std::chrono
-using namespace literals::chrono_literals;
-} // namespace chrono
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/__chrono/system_clock.h b/libcxx/include/__cxx03/__chrono/system_clock.h
index 7ae053f3bb409..28cf3562036b1 100644
--- a/libcxx/include/__cxx03/__chrono/system_clock.h
+++ b/libcxx/include/__cxx03/__chrono/system_clock.h
@@ -36,15 +36,6 @@ class _LIBCPP_EXPORTED_FROM_ABI system_clock {
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Duration>
-using sys_time = time_point<system_clock, _Duration>;
-using sys_seconds = sys_time<seconds>;
-using sys_days = sys_time<days>;
-
-#endif
-
} // namespace chrono
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__chrono/time_point.h b/libcxx/include/__cxx03/__chrono/time_point.h
index 8703275a75ea7..b4e6b15ba1aab 100644
--- a/libcxx/include/__cxx03/__chrono/time_point.h
+++ b/libcxx/include/__cxx03/__chrono/time_point.h
@@ -90,28 +90,6 @@ time_point_cast(const time_point<_Clock, _Duration>& __t) {
return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
-#if _LIBCPP_STD_VER >= 17
-template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> floor(const time_point<_Clock, _Duration>& __t) {
- return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};
-}
-
-template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> ceil(const time_point<_Clock, _Duration>& __t) {
- return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};
-}
-
-template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> round(const time_point<_Clock, _Duration>& __t) {
- return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};
-}
-
-template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI constexpr duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) {
- return __d >= __d.zero() ? +__d : -__d;
-}
-#endif // _LIBCPP_STD_VER >= 17
-
// time_point ==
template <class _Clock, class _Duration1, class _Duration2>
@@ -120,8 +98,6 @@ operator==(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return __lhs.time_since_epoch() == __rhs.time_since_epoch();
}
-#if _LIBCPP_STD_VER <= 17
-
// time_point !=
template <class _Clock, class _Duration1, class _Duration2>
@@ -130,8 +106,6 @@ operator!=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return !(__lhs == __rhs);
}
-#endif // _LIBCPP_STD_VER <= 17
-
// time_point <
template <class _Clock, class _Duration1, class _Duration2>
@@ -164,16 +138,6 @@ operator>=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return !(__lhs < __rhs);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Clock, class _Duration1, three_way_comparable_with<_Duration1> _Duration2>
-_LIBCPP_HIDE_FROM_ABI constexpr auto
-operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
- return __lhs.time_since_epoch() <=> __rhs.time_since_epoch();
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
// time_point operator+(time_point x, duration y);
template <class _Clock, class _Duration1, class _Rep2, class _Period2>
diff --git a/libcxx/include/__cxx03/__config b/libcxx/include/__cxx03/__config
index 880d14a50a052..0172f76cef912 100644
--- a/libcxx/include/__cxx03/__config
+++ b/libcxx/include/__cxx03/__config
@@ -157,11 +157,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define _LIBCPP_TOSTRING2(x) #x
# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
-// NOLINTNEXTLINE(libcpp-cpp-version-check)
-# if __cplusplus < 201103L
-# define _LIBCPP_CXX03_LANG
-# endif
-
# ifndef __has_constexpr_builtin
# define __has_constexpr_builtin(x) 0
# endif
@@ -307,18 +302,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define _LIBCPP_USING_DEV_RANDOM
# endif
-# ifndef _LIBCPP_CXX03_LANG
-
-# define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
-# define _ALIGNAS_TYPE(x) alignas(x)
-# define _ALIGNAS(x) alignas(x)
-# define _LIBCPP_NORETURN [[noreturn]]
-# define _NOEXCEPT noexcept
-# define _NOEXCEPT_(...) noexcept(__VA_ARGS__)
-# define _LIBCPP_CONSTEXPR constexpr
-
-# else
-
# define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)
# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -334,8 +317,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
typedef __char16_t char16_t;
typedef __char32_t char32_t;
-# endif
-
# define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
// Objective-C++ features (opt-in)
@@ -613,7 +594,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_HAS_NO_INT128
# endif
-# ifdef _LIBCPP_CXX03_LANG
# define _LIBCPP_DECLARE_STRONG_ENUM(x) \
struct _LIBCPP_EXPORTED_FROM_ABI x { \
enum __lx
@@ -626,11 +606,6 @@ typedef __char32_t char32_t;
};
// clang-format on
-# else // _LIBCPP_CXX03_LANG
-# define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class x
-# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
-# endif // _LIBCPP_CXX03_LANG
-
# if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || defined(__NetBSD__)
# define _LIBCPP_LOCALE__L_EXTENSIONS 1
# endif
@@ -675,73 +650,29 @@ typedef __char32_t char32_t;
# define _LIBCPP_WCTYPE_IS_MASK
# endif
-# if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
-# define _LIBCPP_HAS_NO_CHAR8_T
-# endif
+# define _LIBCPP_HAS_NO_CHAR8_T
// Deprecation macros.
//
// Deprecations warnings are always enabled, except when users explicitly opt-out
// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
# if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if __has_attribute(__deprecated__)
-# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
-# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
-# elif _LIBCPP_STD_VER >= 14
-# define _LIBCPP_DEPRECATED [[deprecated]]
-# define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
-# else
-# define _LIBCPP_DEPRECATED
-# define _LIBCPP_DEPRECATED_(m)
-# endif
+# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
+# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
# else
# define _LIBCPP_DEPRECATED
# define _LIBCPP_DEPRECATED_(m)
# endif
-# if _LIBCPP_STD_VER < 20
-# define _LIBCPP_DEPRECATED_ATOMIC_SYNC \
- _LIBCPP_DEPRECATED_("The C++20 synchronization library has been deprecated prior to C++20. Please update to " \
- "using -std=c++20 if you need to use these facilities.")
-# else
-# define _LIBCPP_DEPRECATED_ATOMIC_SYNC /* nothing */
-# endif
-
-# if !defined(_LIBCPP_CXX03_LANG)
-# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX11
-# endif
+# define _LIBCPP_DEPRECATED_ATOMIC_SYNC /* nothing */
-# if _LIBCPP_STD_VER >= 14
-# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX14
-# endif
+# define _LIBCPP_DEPRECATED_IN_CXX11
-# if _LIBCPP_STD_VER >= 17
-# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX17
-# endif
-
-# if _LIBCPP_STD_VER >= 20
-# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX20
-# endif
-
-# if _LIBCPP_STD_VER >= 23
-# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX23
-# endif
-
-# if _LIBCPP_STD_VER >= 26
-# define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
-# else
-# define _LIBCPP_DEPRECATED_IN_CXX26
-# endif
+# define _LIBCPP_DEPRECATED_IN_CXX14
+# define _LIBCPP_DEPRECATED_IN_CXX17
+# define _LIBCPP_DEPRECATED_IN_CXX20
+# define _LIBCPP_DEPRECATED_IN_CXX23
+# define _LIBCPP_DEPRECATED_IN_CXX26
# if !defined(_LIBCPP_HAS_NO_CHAR8_T)
# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
@@ -760,41 +691,12 @@ typedef __char32_t char32_t;
# define _LIBCPP_SUPPRESS_DEPRECATED_POP
# endif
-# if _LIBCPP_STD_VER <= 11
-# define _LIBCPP_EXPLICIT_SINCE_CXX14
-# else
-# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
-# endif
-
-# if _LIBCPP_STD_VER >= 23
-# define _LIBCPP_EXPLICIT_SINCE_CXX23 explicit
-# else
-# define _LIBCPP_EXPLICIT_SINCE_CXX23
-# endif
-
-# if _LIBCPP_STD_VER >= 14
-# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
-# else
-# define _LIBCPP_CONSTEXPR_SINCE_CXX14
-# endif
-
-# if _LIBCPP_STD_VER >= 17
-# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
-# else
-# define _LIBCPP_CONSTEXPR_SINCE_CXX17
-# endif
-
-# if _LIBCPP_STD_VER >= 20
-# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
-# else
-# define _LIBCPP_CONSTEXPR_SINCE_CXX20
-# endif
-
-# if _LIBCPP_STD_VER >= 23
-# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
-# else
-# define _LIBCPP_CONSTEXPR_SINCE_CXX23
-# endif
+# define _LIBCPP_EXPLICIT_SINCE_CXX14
+# define _LIBCPP_EXPLICIT_SINCE_CXX23
+# define _LIBCPP_CONSTEXPR_SINCE_CXX14
+# define _LIBCPP_CONSTEXPR_SINCE_CXX17
+# define _LIBCPP_CONSTEXPR_SINCE_CXX20
+# define _LIBCPP_CONSTEXPR_SINCE_CXX23
# ifndef _LIBCPP_WEAK
# define _LIBCPP_WEAK __attribute__((__weak__))
@@ -933,9 +835,7 @@ typedef __char32_t char32_t;
# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
# endif
-# if _LIBCPP_STD_VER >= 20
-# define _LIBCPP_CONSTINIT constinit
-# elif __has_attribute(__require_constant_initialization__)
+# if __has_attribute(__require_constant_initialization__)
# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
# else
# define _LIBCPP_CONSTINIT
@@ -1037,19 +937,7 @@ typedef __char32_t char32_t;
// macro is used to mark them as such, which suppresses the
// '-Wctad-maybe-unsupported' compiler warning when CTAD is used in user code
// with these classes.
-# if _LIBCPP_STD_VER >= 17
-# ifdef _LIBCPP_COMPILER_CLANG_BASED
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
- template <class... _Tag> \
- [[maybe_unused]] _ClassName(typename _Tag::__allow_ctad...)->_ClassName<_Tag...>
-# else
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(ClassName) \
- template <class... _Tag> \
- ClassName(typename _Tag::__allow_ctad...)->ClassName<_Tag...>
-# endif
-# else
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
-# endif
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
// TODO(varconst): currently, there are bugs in Clang's intrinsics when handling Objective-C++ `id`, so don't use
// compiler intrinsics in the Objective-C++ mode.
diff --git a/libcxx/include/__cxx03/__configuration/language.h b/libcxx/include/__cxx03/__configuration/language.h
index 8fd09f4b22554..adc98a8dc9a1a 100644
--- a/libcxx/include/__cxx03/__configuration/language.h
+++ b/libcxx/include/__cxx03/__configuration/language.h
@@ -16,25 +16,6 @@
# pragma GCC system_header
#endif
-// NOLINTBEGIN(libcpp-cpp-version-check)
-#ifdef __cplusplus
-# if __cplusplus <= 201103L
-# define _LIBCPP_STD_VER 11
-# elif __cplusplus <= 201402L
-# define _LIBCPP_STD_VER 14
-# elif __cplusplus <= 201703L
-# define _LIBCPP_STD_VER 17
-# elif __cplusplus <= 202002L
-# define _LIBCPP_STD_VER 20
-# elif __cplusplus <= 202302L
-# define _LIBCPP_STD_VER 23
-# else
-// Expected release year of the next C++ standard
-# define _LIBCPP_STD_VER 26
-# endif
-#endif // __cplusplus
-// NOLINTEND(libcpp-cpp-version-check)
-
#if !defined(__cpp_rtti) || __cpp_rtti < 199711L
# define _LIBCPP_HAS_NO_RTTI
#endif
diff --git a/libcxx/include/__cxx03/__debug_utils/randomize_range.h b/libcxx/include/__cxx03/__debug_utils/randomize_range.h
index 1baf4f5361ffd..dec21a01ce3fc 100644
--- a/libcxx/include/__cxx03/__debug_utils/randomize_range.h
+++ b/libcxx/include/__cxx03/__debug_utils/randomize_range.h
@@ -25,9 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Iterator, class _Sentinel>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __debug_randomize_range(_Iterator __first, _Sentinel __last) {
#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
-# ifdef _LIBCPP_CXX03_LANG
-# error Support for unspecified stability is only for C++11 and higher
-# endif
+# error Support for unspecified stability is only for C++11 and higher
if (!__libcpp_is_constant_evaluated())
std::__shuffle<_AlgPolicy>(__first, __last, __libcpp_debug_randomizer());
diff --git a/libcxx/include/__cxx03/__exception/operations.h b/libcxx/include/__cxx03/__exception/operations.h
index 9049a0f313fae..da8abba56198e 100644
--- a/libcxx/include/__cxx03/__exception/operations.h
+++ b/libcxx/include/__cxx03/__exception/operations.h
@@ -17,13 +17,10 @@
#endif
namespace std { // purposefully not using versioning namespace
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
- defined(_LIBCPP_BUILDING_LIBRARY)
using unexpected_handler = void (*)();
_LIBCPP_EXPORTED_FROM_ABI unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
_LIBCPP_EXPORTED_FROM_ABI unexpected_handler get_unexpected() _NOEXCEPT;
_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void unexpected();
-#endif
using terminate_handler = void (*)();
_LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
diff --git a/libcxx/include/__cxx03/__functional/binary_function.h b/libcxx/include/__cxx03/__functional/binary_function.h
index cc247eacb8e37..61329bb7316c2 100644
--- a/libcxx/include/__cxx03/__functional/binary_function.h
+++ b/libcxx/include/__cxx03/__functional/binary_function.h
@@ -18,8 +18,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-
template <class _Arg1, class _Arg2, class _Result>
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binary_function {
typedef _Arg1 first_argument_type;
@@ -27,27 +25,18 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binary_function {
typedef _Result result_type;
};
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-
template <class _Arg1, class _Arg2, class _Result>
struct __binary_function_keep_layout_base {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using first_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg1;
using second_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg2;
using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;
-#endif
};
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
template <class _Arg1, class _Arg2, class _Result>
using __binary_function = binary_function<_Arg1, _Arg2, _Result>;
_LIBCPP_DIAGNOSTIC_POP
-#else
-template <class _Arg1, class _Arg2, class _Result>
-using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__functional/binary_negate.h b/libcxx/include/__cxx03/__functional/binary_negate.h
index e2173d72dc404..aa9ef71ffd262 100644
--- a/libcxx/include/__cxx03/__functional/binary_negate.h
+++ b/libcxx/include/__cxx03/__functional/binary_negate.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
-
template <class _Predicate>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
: public __binary_function<typename _Predicate::first_argument_type,
@@ -44,8 +42,6 @@ not2(const _Predicate& __pred) {
return binary_negate<_Predicate>(__pred);
}
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_BINARY_NEGATE_H
diff --git a/libcxx/include/__cxx03/__functional/bind.h b/libcxx/include/__cxx03/__functional/bind.h
index 70c4be05ce65e..50ff585c01644 100644
--- a/libcxx/include/__cxx03/__functional/bind.h
+++ b/libcxx/include/__cxx03/__functional/bind.h
@@ -30,22 +30,12 @@ template <class _Tp>
struct is_bind_expression
: _If< _IsSame<_Tp, __remove_cvref_t<_Tp> >::value, false_type, is_bind_expression<__remove_cvref_t<_Tp> > > {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_bind_expression_v = is_bind_expression<_Tp>::value;
-#endif
-
template <class _Tp>
struct is_placeholder
: _If< _IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
integral_constant<int, 0>,
is_placeholder<__remove_cvref_t<_Tp> > > {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr int is_placeholder_v = is_placeholder<_Tp>::value;
-#endif
-
namespace placeholders {
template <int _Np>
@@ -75,222 +65,6 @@ _LIBCPP_EXPORTED_FROM_ABI extern const __ph<10> _10;
template <int _Np>
struct is_placeholder<placeholders::__ph<_Np> > : public integral_constant<int, _Np> {};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Uj>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __mu(reference_wrapper<_Tp> __t, _Uj&) {
- return __t.get();
-}
-
-template <class _Ti, class... _Uj, size_t... _Indx>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<_Ti&, _Uj...>::type
-__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) {
- return __ti(std::forward<_Uj>(std::get<_Indx>(__uj))...);
-}
-
-template <class _Ti, class... _Uj, __enable_if_t<is_bind_expression<_Ti>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<_Ti&, _Uj...>::type
-__mu(_Ti& __ti, tuple<_Uj...>& __uj) {
- typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
- return std::__mu_expand(__ti, __uj, __indices());
-}
-
-template <bool _IsPh, class _Ti, class _Uj>
-struct __mu_return2 {};
-
-template <class _Ti, class _Uj>
-struct __mu_return2<true, _Ti, _Uj> {
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
-};
-
-template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
-__mu(_Ti&, _Uj& __uj) {
- const size_t __indx = is_placeholder<_Ti>::value - 1;
- return std::forward<typename tuple_element<__indx, _Uj>::type>(std::get<__indx>(__uj));
-}
-
-template <class _Ti,
- class _Uj,
- __enable_if_t<!is_bind_expression<_Ti>::value && is_placeholder<_Ti>::value == 0 &&
- !__is_reference_wrapper<_Ti>::value,
- int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti, _Uj&) {
- return __ti;
-}
-
-template <class _Ti, bool _IsReferenceWrapper, bool _IsBindEx, bool _IsPh, class _TupleUj>
-struct __mu_return_impl;
-
-template <bool _Invokable, class _Ti, class... _Uj>
-struct __mu_return_invokable // false
-{
- typedef __nat type;
-};
-
-template <class _Ti, class... _Uj>
-struct __mu_return_invokable<true, _Ti, _Uj...> {
- typedef typename __invoke_of<_Ti&, _Uj...>::type type;
-};
-
-template <class _Ti, class... _Uj>
-struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> >
- : public __mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...> {};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, false, false, true, _TupleUj> {
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _TupleUj>::type&& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, true, false, false, _TupleUj> {
- typedef typename _Ti::type& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, false, false, false, _TupleUj> {
- typedef _Ti& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return
- : public __mu_return_impl<
- _Ti,
- __is_reference_wrapper<_Ti>::value,
- is_bind_expression<_Ti>::value,
- 0 < is_placeholder<_Ti>::value && is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
- _TupleUj> {};
-
-template <class _Fp, class _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return {
- static const bool value = false;
-};
-
-template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> {
- static const bool value = __invokable<_Fp, typename __mu_return<_BoundArgs, _TupleUj>::type...>::value;
-};
-
-template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> {
- static const bool value = __invokable<_Fp, typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value;
-};
-
-template <class _Fp, class _BoundArgs, class _TupleUj, bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
-struct __bind_return;
-
-template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true> {
- typedef typename __invoke_of< _Fp&, typename __mu_return< _BoundArgs, _TupleUj >::type... >::type type;
-};
-
-template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> {
- typedef typename __invoke_of< _Fp&, typename __mu_return< const _BoundArgs, _TupleUj >::type... >::type type;
-};
-
-template <class _Fp, class _BoundArgs, size_t... _Indx, class _Args>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fp, _BoundArgs, _Args>::type
-__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) {
- return std::__invoke(__f, std::__mu(std::get<_Indx>(__bound_args), __args)...);
-}
-
-template <class _Fp, class... _BoundArgs>
-class __bind : public __weak_result_type<__decay_t<_Fp> > {
-protected:
- using _Fd = __decay_t<_Fp>;
- typedef tuple<__decay_t<_BoundArgs>...> _Td;
-
-private:
- _Fd __f_;
- _Td __bound_args_;
-
- typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
-
-public:
- template <
- class _Gp,
- class... _BA,
- __enable_if_t<is_constructible<_Fd, _Gp>::value && !is_same<__libcpp_remove_reference_t<_Gp>, __bind>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bind(_Gp&& __f, _BA&&... __bound_args)
- : __f_(std::forward<_Gp>(__f)), __bound_args_(std::forward<_BA>(__bound_args)...) {}
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
- operator()(_Args&&... __args) {
- return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
- operator()(_Args&&... __args) const {
- return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...));
- }
-};
-
-template <class _Fp, class... _BoundArgs>
-struct is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {};
-
-template <class _Rp, class _Fp, class... _BoundArgs>
-class __bind_r : public __bind<_Fp, _BoundArgs...> {
- typedef __bind<_Fp, _BoundArgs...> base;
- typedef typename base::_Fd _Fd;
- typedef typename base::_Td _Td;
-
-public:
- typedef _Rp result_type;
-
- template <
- class _Gp,
- class... _BA,
- __enable_if_t<is_constructible<_Fd, _Gp>::value && !is_same<__libcpp_remove_reference_t<_Gp>, __bind_r>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bind_r(_Gp&& __f, _BA&&... __bound_args)
- : base(std::forward<_Gp>(__f), std::forward<_BA>(__bound_args)...) {}
-
- template <
- class... _Args,
- __enable_if_t<is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type, result_type>::value ||
- is_void<_Rp>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 result_type operator()(_Args&&... __args) {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base&>(*this), std::forward<_Args>(__args)...);
- }
-
- template <class... _Args,
- __enable_if_t<is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
- result_type>::value ||
- is_void<_Rp>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 result_type operator()(_Args&&... __args) const {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base const&>(*this), std::forward<_Args>(__args)...);
- }
-};
-
-template <class _Rp, class _Fp, class... _BoundArgs>
-struct is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
-
-template <class _Fp, class... _BoundArgs>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind<_Fp, _BoundArgs...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args) {
- typedef __bind<_Fp, _BoundArgs...> type;
- return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);
-}
-
-template <class _Rp, class _Fp, class... _BoundArgs>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind_r<_Rp, _Fp, _BoundArgs...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args) {
- typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
- return type(std::forward<_Fp>(__f), std::forward<_BoundArgs>(__bound_args)...);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_BIND_H
diff --git a/libcxx/include/__cxx03/__functional/binder1st.h b/libcxx/include/__cxx03/__functional/binder1st.h
index 21c136ff16d8c..1a4a2ed81c04d 100644
--- a/libcxx/include/__cxx03/__functional/binder1st.h
+++ b/libcxx/include/__cxx03/__functional/binder1st.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
template <class _Operation>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
: public __unary_function<typename _Operation::second_argument_type, typename _Operation::result_type> {
@@ -47,8 +45,6 @@ bind1st(const _Operation& __op, const _Tp& __x) {
return binder1st<_Operation>(__op, __x);
}
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_BINDER1ST_H
diff --git a/libcxx/include/__cxx03/__functional/binder2nd.h b/libcxx/include/__cxx03/__functional/binder2nd.h
index 397215b3d9e11..06600946e3e96 100644
--- a/libcxx/include/__cxx03/__functional/binder2nd.h
+++ b/libcxx/include/__cxx03/__functional/binder2nd.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
template <class _Operation>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
: public __unary_function<typename _Operation::first_argument_type, typename _Operation::result_type> {
@@ -47,8 +45,6 @@ bind2nd(const _Operation& __op, const _Tp& __x) {
return binder2nd<_Operation>(__op, __x);
}
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_BINDER2ND_H
diff --git a/libcxx/include/__cxx03/__functional/hash.h b/libcxx/include/__cxx03/__functional/hash.h
index 15473a8572435..b2c3bee1c75bf 100644
--- a/libcxx/include/__cxx03/__functional/hash.h
+++ b/libcxx/include/__cxx03/__functional/hash.h
@@ -504,39 +504,6 @@ struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp> {};
-#if _LIBCPP_STD_VER >= 17
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t> : public __unary_function<nullptr_t, size_t> {
- _LIBCPP_HIDE_FROM_ABI size_t operator()(nullptr_t) const _NOEXCEPT { return 662607004ull; }
-};
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Hash>
-using __check_hash_requirements _LIBCPP_NODEBUG =
- integral_constant<bool,
- is_copy_constructible<_Hash>::value && is_move_constructible<_Hash>::value &&
- __invokable_r<size_t, _Hash, _Key const&>::value >;
-
-template <class _Key, class _Hash = hash<_Key> >
-using __has_enabled_hash _LIBCPP_NODEBUG =
- integral_constant<bool, __check_hash_requirements<_Key, _Hash>::value && is_default_constructible<_Hash>::value >;
-
-# if _LIBCPP_STD_VER >= 17
-template <class _Type, class>
-using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;
-
-template <class _Type, class... _Keys>
-using __enable_hash_helper _LIBCPP_NODEBUG =
- __enable_hash_helper_imp<_Type, __enable_if_t<__all<__has_enabled_hash<_Keys>::value...>::value> >;
-# else
-template <class _Type, class...>
-using __enable_hash_helper _LIBCPP_NODEBUG = _Type;
-# endif
-
-#endif // !_LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_HASH_H
diff --git a/libcxx/include/__cxx03/__functional/identity.h b/libcxx/include/__cxx03/__functional/identity.h
index 61e5ebdb31e6e..6af22948a1f19 100644
--- a/libcxx/include/__cxx03/__functional/identity.h
+++ b/libcxx/include/__cxx03/__functional/identity.h
@@ -40,26 +40,6 @@ struct __is_identity<reference_wrapper<__identity> > : true_type {};
template <>
struct __is_identity<reference_wrapper<const __identity> > : true_type {};
-#if _LIBCPP_STD_VER >= 20
-
-struct identity {
- template <class _Tp>
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept {
- return std::forward<_Tp>(__t);
- }
-
- using is_transparent = void;
-};
-
-template <>
-struct __is_identity<identity> : true_type {};
-template <>
-struct __is_identity<reference_wrapper<identity> > : true_type {};
-template <>
-struct __is_identity<reference_wrapper<const identity> > : true_type {};
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_IDENTITY_H
diff --git a/libcxx/include/__cxx03/__functional/mem_fun_ref.h b/libcxx/include/__cxx03/__functional/mem_fun_ref.h
index ef962231dc92b..7a15d19b32f7f 100644
--- a/libcxx/include/__cxx03/__functional/mem_fun_ref.h
+++ b/libcxx/include/__cxx03/__functional/mem_fun_ref.h
@@ -20,8 +20,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
template <class _Sp, class _Tp>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t : public __unary_function<_Tp*, _Sp> {
_Sp (_Tp::*__p_)();
@@ -139,8 +137,6 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) {
return const_mem_fun1_ref_t<_Sp, _Tp, _Ap>(__f);
}
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_MEM_FUN_REF_H
diff --git a/libcxx/include/__cxx03/__functional/operations.h b/libcxx/include/__cxx03/__functional/operations.h
index ddbe71bdc8b68..9c40a198fee15 100644
--- a/libcxx/include/__cxx03/__functional/operations.h
+++ b/libcxx/include/__cxx03/__functional/operations.h
@@ -24,11 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Arithmetic operations
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS plus : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -45,24 +41,7 @@ inline const bool __desugars_to_v<__plus_tag, plus<_Tp>, _Tp, _Tp> = true;
template <class _Tp, class _Up>
inline const bool __desugars_to_v<__plus_tag, plus<void>, _Tp, _Up> = true;
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS plus<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) + std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) + std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) + std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS minus : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -71,24 +50,7 @@ struct _LIBCPP_TEMPLATE_VIS minus : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(minus);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS minus<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) - std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) - std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) - std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS multiplies : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -97,24 +59,7 @@ struct _LIBCPP_TEMPLATE_VIS multiplies : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(multiplies);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS multiplies<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) * std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) * std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) * std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS divides : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -123,24 +68,7 @@ struct _LIBCPP_TEMPLATE_VIS divides : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(divides);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS divides<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) / std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) / std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) / std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS modulus : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -149,50 +77,16 @@ struct _LIBCPP_TEMPLATE_VIS modulus : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS modulus<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) % std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) % std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) % std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS negate : __unary_function<_Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x) const { return -__x; }
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(negate);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS negate<void> {
- template <class _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
- noexcept(noexcept(-std::forward<_Tp>(__x))) //
- -> decltype(-std::forward<_Tp>(__x)) {
- return -std::forward<_Tp>(__x);
- }
- typedef void is_transparent;
-};
-#endif
-
// Bitwise operations
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS bit_and : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -201,43 +95,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_and : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_and);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_and<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) &
- std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) & std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) & std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-struct _LIBCPP_TEMPLATE_VIS bit_not : __unary_function<_Tp, _Tp> {
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x) const { return ~__x; }
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_not);
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_not<void> {
- template <class _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
- noexcept(noexcept(~std::forward<_Tp>(__x))) //
- -> decltype(~std::forward<_Tp>(__x)) {
- return ~std::forward<_Tp>(__x);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS bit_or : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -246,24 +104,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_or : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_or<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) | std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) | std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) | std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS bit_xor : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const {
@@ -272,26 +113,9 @@ struct _LIBCPP_TEMPLATE_VIS bit_xor : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_xor);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_xor<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) ^ std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) ^ std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) ^ std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
// Comparison operations
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS equal_to : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -300,19 +124,6 @@ struct _LIBCPP_TEMPLATE_VIS equal_to : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(equal_to);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS equal_to<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) == std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) == std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) == std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
// The non-transparent std::equal_to specialization is only equivalent to a raw equality
// comparison when we don't perform an implicit conversion when calling it.
template <class _Tp>
@@ -322,11 +133,7 @@ inline const bool __desugars_to_v<__equal_tag, equal_to<_Tp>, _Tp, _Tp> = true;
template <class _Tp, class _Up>
inline const bool __desugars_to_v<__equal_tag, equal_to<void>, _Tp, _Up> = true;
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS not_equal_to : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -335,24 +142,7 @@ struct _LIBCPP_TEMPLATE_VIS not_equal_to : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(not_equal_to);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS not_equal_to<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) != std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) != std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) != std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS less : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -364,27 +154,7 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less);
template <class _Tp>
inline const bool __desugars_to_v<__less_tag, less<_Tp>, _Tp, _Tp> = true;
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS less<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) < std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) < std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) < std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-
-template <class _Tp>
-inline const bool __desugars_to_v<__less_tag, less<>, _Tp, _Tp> = true;
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS less_equal : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -393,24 +163,7 @@ struct _LIBCPP_TEMPLATE_VIS less_equal : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less_equal);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS less_equal<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) <= std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) <= std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) <= std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS greater_equal : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -419,24 +172,7 @@ struct _LIBCPP_TEMPLATE_VIS greater_equal : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater_equal);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS greater_equal<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) >=
- std::forward<_T2>(__u))) -> decltype(std::forward<_T1>(__t) >= std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) >= std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS greater : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -445,26 +181,9 @@ struct _LIBCPP_TEMPLATE_VIS greater : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS greater<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) > std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) > std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) > std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
// Logical operations
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS logical_and : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -473,48 +192,14 @@ struct _LIBCPP_TEMPLATE_VIS logical_and : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_and);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_and<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) && std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) && std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) && std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS logical_not : __unary_function<_Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x) const { return !__x; }
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_not);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_not<void> {
- template <class _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_Tp&& __x) const
- noexcept(noexcept(!std::forward<_Tp>(__x))) //
- -> decltype(!std::forward<_Tp>(__x)) {
- return !std::forward<_Tp>(__x);
- }
- typedef void is_transparent;
-};
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp = void>
-#else
template <class _Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS logical_or : __binary_function<_Tp, _Tp, bool> {
typedef bool __result_type; // used by valarray
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Tp& __y) const {
@@ -523,19 +208,6 @@ struct _LIBCPP_TEMPLATE_VIS logical_or : __binary_function<_Tp, _Tp, bool> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_or);
-#if _LIBCPP_STD_VER >= 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_or<void> {
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
- noexcept(noexcept(std::forward<_T1>(__t) || std::forward<_T2>(__u))) //
- -> decltype(std::forward<_T1>(__t) || std::forward<_T2>(__u)) {
- return std::forward<_T1>(__t) || std::forward<_T2>(__u);
- }
- typedef void is_transparent;
-};
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_OPERATIONS_H
diff --git a/libcxx/include/__cxx03/__functional/pointer_to_binary_function.h b/libcxx/include/__cxx03/__functional/pointer_to_binary_function.h
index 72474255d7fe2..69ec2c8f8b801 100644
--- a/libcxx/include/__cxx03/__functional/pointer_to_binary_function.h
+++ b/libcxx/include/__cxx03/__functional/pointer_to_binary_function.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
template <class _Arg1, class _Arg2, class _Result>
class _LIBCPP_TEMPLATE_VIS
_LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function : public __binary_function<_Arg1, _Arg2, _Result> {
@@ -37,8 +35,6 @@ ptr_fun(_Result (*__f)(_Arg1, _Arg2)) {
return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__f);
}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
diff --git a/libcxx/include/__cxx03/__functional/pointer_to_unary_function.h b/libcxx/include/__cxx03/__functional/pointer_to_unary_function.h
index 8540ad07f3ec0..217ce3ff6c957 100644
--- a/libcxx/include/__cxx03/__functional/pointer_to_unary_function.h
+++ b/libcxx/include/__cxx03/__functional/pointer_to_unary_function.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
template <class _Arg, class _Result>
class _LIBCPP_TEMPLATE_VIS
_LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function : public __unary_function<_Arg, _Result> {
@@ -37,8 +35,6 @@ ptr_fun(_Result (*__f)(_Arg)) {
return pointer_to_unary_function<_Arg, _Result>(__f);
}
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
diff --git a/libcxx/include/__cxx03/__functional/reference_wrapper.h b/libcxx/include/__cxx03/__functional/reference_wrapper.h
index e217bdf543351..73e17d87c22e0 100644
--- a/libcxx/include/__cxx03/__functional/reference_wrapper.h
+++ b/libcxx/include/__cxx03/__functional/reference_wrapper.h
@@ -59,69 +59,11 @@ class _LIBCPP_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp> {
template <class... _ArgTypes>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<type&, _ArgTypes...>::type
operator()(_ArgTypes&&... __args) const
-#if _LIBCPP_STD_VER >= 17
- // Since is_nothrow_invocable requires C++17 LWG3764 is not backported
- // to earlier versions.
- noexcept(is_nothrow_invocable_v<_Tp&, _ArgTypes...>)
-#endif
{
return std::__invoke(get(), std::forward<_ArgTypes>(__args)...);
}
-
-#if _LIBCPP_STD_VER >= 26
-
- // [refwrap.comparisons], comparisons
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper __y)
- requires requires {
- { __x.get() == __y.get() } -> __boolean_testable;
- }
- {
- return __x.get() == __y.get();
- }
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, const _Tp& __y)
- requires requires {
- { __x.get() == __y } -> __boolean_testable;
- }
- {
- return __x.get() == __y;
- }
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper<const _Tp> __y)
- requires(!is_const_v<_Tp>) && requires {
- { __x.get() == __y.get() } -> __boolean_testable;
- }
- {
- return __x.get() == __y.get();
- }
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, reference_wrapper __y)
- requires requires { std::__synth_three_way(__x.get(), __y.get()); }
- {
- return std::__synth_three_way(__x.get(), __y.get());
- }
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, const _Tp& __y)
- requires requires { std::__synth_three_way(__x.get(), __y); }
- {
- return std::__synth_three_way(__x.get(), __y);
- }
-
- _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, reference_wrapper<const _Tp> __y)
- requires(!is_const_v<_Tp>) && requires { std::__synth_three_way(__x.get(), __y.get()); }
- {
- return std::__synth_three_way(__x.get(), __y.get());
- }
-
-#endif // _LIBCPP_STD_VER >= 26
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
-#endif
-
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper<_Tp> ref(_Tp& __t) _NOEXCEPT {
return reference_wrapper<_Tp>(__t);
diff --git a/libcxx/include/__cxx03/__functional/unary_function.h b/libcxx/include/__cxx03/__functional/unary_function.h
index 45ba29ee2cac5..8bf305a4dfe9f 100644
--- a/libcxx/include/__cxx03/__functional/unary_function.h
+++ b/libcxx/include/__cxx03/__functional/unary_function.h
@@ -17,34 +17,23 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-
template <class _Arg, class _Result>
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 unary_function {
typedef _Arg argument_type;
typedef _Result result_type;
};
-#endif // _LIBCPP_STD_VER <= 14
-
template <class _Arg, class _Result>
struct __unary_function_keep_layout_base {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg;
using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;
-#endif
};
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
template <class _Arg, class _Result>
using __unary_function = unary_function<_Arg, _Result>;
_LIBCPP_DIAGNOSTIC_POP
-#else
-template <class _Arg, class _Result>
-using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__functional/unary_negate.h b/libcxx/include/__cxx03/__functional/unary_negate.h
index 4d527865f378c..87abbe88e0e75 100644
--- a/libcxx/include/__cxx03/__functional/unary_negate.h
+++ b/libcxx/include/__cxx03/__functional/unary_negate.h
@@ -19,8 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
-
template <class _Predicate>
class _LIBCPP_TEMPLATE_VIS
_LIBCPP_DEPRECATED_IN_CXX17 unary_negate : public __unary_function<typename _Predicate::argument_type, bool> {
@@ -41,8 +39,6 @@ not1(const _Predicate& __pred) {
return unary_negate<_Predicate>(__pred);
}
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_UNARY_NEGATE_H
diff --git a/libcxx/include/__cxx03/__functional/weak_result_type.h b/libcxx/include/__cxx03/__functional/weak_result_type.h
index 539989dda2d97..1b1a0881014f8 100644
--- a/libcxx/include/__cxx03/__functional/weak_result_type.h
+++ b/libcxx/include/__cxx03/__functional/weak_result_type.h
@@ -88,9 +88,7 @@ template <class _Tp, bool = __has_result_type<_Tp>::value>
struct __weak_result_type_imp // bool is true
: public __maybe_derive_from_unary_function<_Tp>,
public __maybe_derive_from_binary_function<_Tp> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = typename _Tp::result_type;
-#endif
};
template <class _Tp>
@@ -104,23 +102,17 @@ struct __weak_result_type : public __weak_result_type_imp<_Tp> {};
template <class _Rp>
struct __weak_result_type<_Rp()> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp>
struct __weak_result_type<_Rp (&)()> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp>
struct __weak_result_type<_Rp (*)()> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
// 1 argument case
@@ -174,51 +166,37 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> : public __binary_fu
template <class _Rp, class _A1, class _A2, class _A3, class... _A4>
struct __weak_result_type<_Rp(_A1, _A2, _A3, _A4...)> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _A1, class _A2, class _A3, class... _A4>
struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _A1, class _A2, class _A3, class... _A4>
struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _Cp, class _A1, class _A2, class... _A3>
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _Cp, class _A1, class _A2, class... _A3>
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _Cp, class _A1, class _A2, class... _A3>
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Rp, class _Cp, class _A1, class _A2, class... _A3>
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
-#endif
};
template <class _Tp, class... _Args>
diff --git a/libcxx/include/__cxx03/__fwd/array.h b/libcxx/include/__cxx03/__fwd/array.h
index f2648a1986e27..aea35f29c6423 100644
--- a/libcxx/include/__cxx03/__fwd/array.h
+++ b/libcxx/include/__cxx03/__fwd/array.h
@@ -27,14 +27,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& get(array<_Tp, _Size>&)
template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& get(const array<_Tp, _Size>&) _NOEXCEPT;
-#ifndef _LIBCPP_CXX03_LANG
-template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&& get(array<_Tp, _Size>&&) _NOEXCEPT;
-
-template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT;
-#endif
-
template <class>
struct __is_std_array : false_type {};
diff --git a/libcxx/include/__cxx03/__fwd/complex.h b/libcxx/include/__cxx03/__fwd/complex.h
index bb1ae20ab3bf8..0959f941affb7 100644
--- a/libcxx/include/__cxx03/__fwd/complex.h
+++ b/libcxx/include/__cxx03/__fwd/complex.h
@@ -21,22 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
class _LIBCPP_TEMPLATE_VIS complex;
-#if _LIBCPP_STD_VER >= 26
-
-template <size_t _Ip, class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp& get(complex<_Tp>&) noexcept;
-
-template <size_t _Ip, class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp&& get(complex<_Tp>&&) noexcept;
-
-template <size_t _Ip, class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& get(const complex<_Tp>&) noexcept;
-
-template <size_t _Ip, class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& get(const complex<_Tp>&&) noexcept;
-
-#endif // _LIBCPP_STD_VER >= 26
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FWD_COMPLEX_H
diff --git a/libcxx/include/__cxx03/__fwd/pair.h b/libcxx/include/__cxx03/__fwd/pair.h
index 092374b509606..56d5bae5a90f3 100644
--- a/libcxx/include/__cxx03/__fwd/pair.h
+++ b/libcxx/include/__cxx03/__fwd/pair.h
@@ -30,16 +30,6 @@ template <size_t _Ip, class _T1, class _T2>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>&) _NOEXCEPT;
-#ifndef _LIBCPP_CXX03_LANG
-template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
-get(pair<_T1, _T2>&&) _NOEXCEPT;
-
-template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
-get(const pair<_T1, _T2>&&) _NOEXCEPT;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FWD_PAIR_H
diff --git a/libcxx/include/__cxx03/__fwd/string.h b/libcxx/include/__cxx03/__fwd/string.h
index 21c2584c6e95b..a74b039576b71 100644
--- a/libcxx/include/__cxx03/__fwd/string.h
+++ b/libcxx/include/__cxx03/__fwd/string.h
@@ -55,28 +55,6 @@ using u8string = basic_string<char8_t>;
using u16string = basic_string<char16_t>;
using u32string = basic_string<char32_t>;
-#if _LIBCPP_STD_VER >= 17
-
-namespace pmr {
-template <class _CharT, class _Traits = char_traits<_CharT>>
-using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
-
-using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;
-
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;
-# endif
-
-# ifndef _LIBCPP_HAS_NO_CHAR8_T
-using u8string _LIBCPP_AVAILABILITY_PMR = basic_string<char8_t>;
-# endif
-
-using u16string _LIBCPP_AVAILABILITY_PMR = basic_string<char16_t>;
-using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;
-} // namespace pmr
-
-#endif // _LIBCPP_STD_VER >= 17
-
// clang-format off
template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_PREFERRED_NAME(string)
@@ -88,17 +66,6 @@ class _LIBCPP_PREFERRED_NAME(string)
#endif
_LIBCPP_PREFERRED_NAME(u16string)
_LIBCPP_PREFERRED_NAME(u32string)
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_PREFERRED_NAME(pmr::string)
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- _LIBCPP_PREFERRED_NAME(pmr::wstring)
-# endif
-# ifndef _LIBCPP_HAS_NO_CHAR8_T
- _LIBCPP_PREFERRED_NAME(pmr::u8string)
-# endif
- _LIBCPP_PREFERRED_NAME(pmr::u16string)
- _LIBCPP_PREFERRED_NAME(pmr::u32string)
-#endif
basic_string;
// clang-format on
diff --git a/libcxx/include/__cxx03/__fwd/tuple.h b/libcxx/include/__cxx03/__fwd/tuple.h
index fed99583f199f..55b46eeb18930 100644
--- a/libcxx/include/__cxx03/__fwd/tuple.h
+++ b/libcxx/include/__cxx03/__fwd/tuple.h
@@ -21,32 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <size_t, class>
struct _LIBCPP_TEMPLATE_VIS tuple_element;
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class...>
-class _LIBCPP_TEMPLATE_VIS tuple;
-
-template <class>
-struct _LIBCPP_TEMPLATE_VIS tuple_size;
-
-template <size_t _Ip, class... _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&
-get(tuple<_Tp...>&) _NOEXCEPT;
-
-template <size_t _Ip, class... _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
-get(const tuple<_Tp...>&) _NOEXCEPT;
-
-template <size_t _Ip, class... _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&&
-get(tuple<_Tp...>&&) _NOEXCEPT;
-
-template <size_t _Ip, class... _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
-get(const tuple<_Tp...>&&) _NOEXCEPT;
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FWD_TUPLE_H
diff --git a/libcxx/include/__cxx03/__hash_table b/libcxx/include/__cxx03/__hash_table
index 4a27681442c27..82e3a433e2f7e 100644
--- a/libcxx/include/__cxx03/__hash_table
+++ b/libcxx/include/__cxx03/__hash_table
@@ -110,23 +110,12 @@ struct __hash_node : public __hash_node_base< __rebind_pointer_t<_VoidPtr, __has
// We allow starting the lifetime of nodes without initializing the value held by the node,
// since that is handled by the hash table itself in order to be allocator-aware.
-#ifndef _LIBCPP_CXX03_LANG
-
-private:
- union {
- _Tp __value_;
- };
-
-public:
- _LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return __value_; }
-#else
private:
_ALIGNAS_TYPE(_Tp) char __buffer_[sizeof(_Tp)];
public:
_LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return *std::__launder(reinterpret_cast<_Tp*>(&__buffer_)); }
-#endif
_LIBCPP_HIDE_FROM_ABI explicit __hash_node(__next_pointer __next, size_t __hash) : _Base(__next), __hash_(__hash) {}
_LIBCPP_HIDE_FROM_ABI ~__hash_node() {}
@@ -620,33 +609,12 @@ public:
friend class __hash_map_node_destructor;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _NodeType, class _Alloc>
-struct __generic_container_node_destructor;
-
-template <class _Tp, class _VoidPtr, class _Alloc>
-struct __generic_container_node_destructor<__hash_node<_Tp, _VoidPtr>, _Alloc> : __hash_node_destructor<_Alloc> {
- using __hash_node_destructor<_Alloc>::__hash_node_destructor;
-};
-#endif
-
template <class _Key, class _Hash, class _Equal>
struct __enforce_unordered_container_requirements {
-#ifndef _LIBCPP_CXX03_LANG
- static_assert(__check_hash_requirements<_Key, _Hash>::value,
- "the specified hash does not meet the Hash requirements");
- static_assert(is_copy_constructible<_Equal>::value, "the specified comparator is required to be copy constructible");
-#endif
typedef int type;
};
template <class _Key, class _Hash, class _Equal>
-#ifndef _LIBCPP_CXX03_LANG
-_LIBCPP_DIAGNOSE_WARNING(!__invokable<_Equal const&, _Key const&, _Key const&>::value,
- "the specified comparator type does not provide a viable const call operator")
-_LIBCPP_DIAGNOSE_WARNING(!__invokable<_Hash const&, _Key const&>::value,
- "the specified hash functor does not provide a viable const call operator")
-#endif
typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type
__diagnose_unordered_container_requirements(int);
@@ -850,27 +818,6 @@ public:
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
}
-#if _LIBCPP_STD_VER >= 17
- template <class _NodeHandle, class _InsertReturnType>
- _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&& __nh);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_unique(const_iterator __hint, _NodeHandle&& __nh);
- template <class _Table>
- _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_unique(_Table& __source);
-
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(_NodeHandle&& __nh);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh);
- template <class _Table>
- _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_multi(_Table& __source);
-
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(key_type const& __key);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(const_iterator __it);
-#endif
-
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI void __rehash_unique(size_type __n) { __rehash<true>(__n); }
_LIBCPP_HIDE_FROM_ABI void __rehash_multi(size_type __n) { __rehash<false>(__n); }
@@ -927,14 +874,10 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const;
_LIBCPP_HIDE_FROM_ABI void swap(__hash_table& __u)
-#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> &&
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
__is_nothrow_swappable_v<__pointer_allocator>) &&
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
-#else
- _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>);
-#endif
_LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return max_size(); }
_LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const;
@@ -1099,10 +1042,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u, const
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() {
-#if defined(_LIBCPP_CXX03_LANG)
static_assert(is_copy_constructible<key_equal>::value, "Predicate must be copy-constructible.");
static_assert(is_copy_constructible<hasher>::value, "Hasher must be copy-constructible.");
-#endif
__deallocate_node(__p1_.first().__next_);
}
@@ -1581,104 +1522,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(const_iterator __
return __r;
}
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle, class _InsertReturnType>
-_LIBCPP_HIDE_FROM_ABI _InsertReturnType
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(_NodeHandle&& __nh) {
- if (__nh.empty())
- return _InsertReturnType{end(), false, _NodeHandle()};
- pair<iterator, bool> __result = __node_insert_unique(__nh.__ptr_);
- if (__result.second)
- __nh.__release_ptr();
- return _InsertReturnType{__result.first, __result.second, std::move(__nh)};
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(const_iterator, _NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
- pair<iterator, bool> __result = __node_insert_unique(__nh.__ptr_);
- if (__result.second)
- __nh.__release_ptr();
- return __result.first;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI _NodeHandle
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(key_type const& __key) {
- iterator __i = find(__key);
- if (__i == end())
- return _NodeHandle();
- return __node_handle_extract<_NodeHandle>(__i);
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI _NodeHandle __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(const_iterator __p) {
- allocator_type __alloc(__node_alloc());
- return _NodeHandle(remove(__p).release(), __alloc);
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Table>
-_LIBCPP_HIDE_FROM_ABI void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_unique(_Table& __source) {
- static_assert(is_same<__node, typename _Table::__node>::value, "");
-
- for (typename _Table::iterator __it = __source.begin(); __it != __source.end();) {
- __node_pointer __src_ptr = __it.__node_->__upcast();
- size_t __hash = hash_function()(__src_ptr->__get_value());
- __next_pointer __existing_node = __node_insert_unique_prepare(__hash, __src_ptr->__get_value());
- auto __prev_iter = __it++;
- if (__existing_node == nullptr) {
- (void)__source.remove(__prev_iter).release();
- __src_ptr->__hash_ = __hash;
- __node_insert_unique_perform(__src_ptr);
- }
- }
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(_NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
- iterator __result = __node_insert_multi(__nh.__ptr_);
- __nh.__release_ptr();
- return __result;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
- iterator __result = __node_insert_multi(__hint, __nh.__ptr_);
- __nh.__release_ptr();
- return __result;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Table>
-_LIBCPP_HIDE_FROM_ABI void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_multi(_Table& __source) {
- static_assert(is_same<typename _Table::__node, __node>::value, "");
-
- for (typename _Table::iterator __it = __source.begin(); __it != __source.end();) {
- __node_pointer __src_ptr = __it.__node_->__upcast();
- size_t __src_hash = hash_function()(__src_ptr->__get_value());
- __next_pointer __pn = __node_insert_multi_prepare(__src_hash, __src_ptr->__get_value());
- (void)__source.remove(__it++).release();
- __src_ptr->__hash_ = __src_hash;
- __node_insert_multi_perform(__src_ptr, __pn);
- }
-}
-#endif // _LIBCPP_STD_VER >= 17
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <bool _UniqueKeys>
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __n) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK {
@@ -1983,14 +1826,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(const _Key& __k) c
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
-#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> &&
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
__is_nothrow_swappable_v<__pointer_allocator>) &&
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
-#else
- _NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>)
-#endif
{
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__node_traits::propagate_on_container_swap::value || this->__node_alloc() == __u.__node_alloc(),
diff --git a/libcxx/include/__cxx03/__iterator/access.h b/libcxx/include/__cxx03/__iterator/access.h
index 2d61d4a879d4f..99ba9c4c73d08 100644
--- a/libcxx/include/__cxx03/__iterator/access.h
+++ b/libcxx/include/__cxx03/__iterator/access.h
@@ -29,45 +29,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* end(_Tp (&__array)[_Np]) _NOEXCEPT
return __array + _Np;
}
-#if !defined(_LIBCPP_CXX03_LANG)
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(_Cp& __c) -> decltype(__c.begin()) {
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(const _Cp& __c) -> decltype(__c.begin()) {
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(_Cp& __c) -> decltype(__c.end()) {
- return __c.end();
-}
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(const _Cp& __c) -> decltype(__c.end()) {
- return __c.end();
-}
-
-# if _LIBCPP_STD_VER >= 14
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI constexpr auto
-cbegin(const _Cp& __c) noexcept(noexcept(std::begin(__c))) -> decltype(std::begin(__c)) {
- return std::begin(__c);
-}
-
-template <class _Cp>
-_LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std::end(__c))) -> decltype(std::end(__c)) {
- return std::end(__c);
-}
-
-# endif
-
-#else // defined(_LIBCPP_CXX03_LANG)
-
template <class _Cp>
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) {
return __c.begin();
@@ -88,8 +49,6 @@ _LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) {
return __c.end();
}
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ITERATOR_ACCESS_H
diff --git a/libcxx/include/__cxx03/__iterator/advance.h b/libcxx/include/__cxx03/__iterator/advance.h
index ac4904829b7ee..6dd8fd61f6824 100644
--- a/libcxx/include/__cxx03/__iterator/advance.h
+++ b/libcxx/include/__cxx03/__iterator/advance.h
@@ -71,133 +71,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void advance(_InputIter& __i
std::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER >= 20
-
-// [range.iter.op.advance]
-
-namespace ranges {
-namespace __advance {
-
-struct __fn {
-private:
- template <class _Ip>
- _LIBCPP_HIDE_FROM_ABI static constexpr void __advance_forward(_Ip& __i, iter_difference_t<_Ip> __n) {
- while (__n > 0) {
- --__n;
- ++__i;
- }
- }
-
- template <class _Ip>
- _LIBCPP_HIDE_FROM_ABI static constexpr void __advance_backward(_Ip& __i, iter_difference_t<_Ip> __n) {
- while (__n < 0) {
- ++__n;
- --__i;
- }
- }
-
-public:
- // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative.
- template <input_or_output_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const {
- // Calling `advance` with a negative value on a non-bidirectional iterator is a no-op in the current implementation.
- _LIBCPP_ASSERT_PEDANTIC(
- __n >= 0 || bidirectional_iterator<_Ip>, "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
-
- // If `I` models `random_access_iterator`, equivalent to `i += n`.
- if constexpr (random_access_iterator<_Ip>) {
- __i += __n;
- return;
- } else if constexpr (bidirectional_iterator<_Ip>) {
- // Otherwise, if `n` is non-negative, increments `i` by `n`.
- __advance_forward(__i, __n);
- // Otherwise, decrements `i` by `-n`.
- __advance_backward(__i, __n);
- return;
- } else {
- // Otherwise, if `n` is non-negative, increments `i` by `n`.
- __advance_forward(__i, __n);
- return;
- }
- }
-
- // Preconditions: Either `assignable_from<I&, S> || sized_sentinel_for<S, I>` is modeled, or [i, bound_sentinel)
- // denotes a range.
- template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
- _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, _Sp __bound_sentinel) const {
- // If `I` and `S` model `assignable_from<I&, S>`, equivalent to `i = std::move(bound_sentinel)`.
- if constexpr (assignable_from<_Ip&, _Sp>) {
- __i = std::move(__bound_sentinel);
- }
- // Otherwise, if `S` and `I` model `sized_sentinel_for<S, I>`, equivalent to `ranges::advance(i, bound_sentinel -
- // i)`.
- else if constexpr (sized_sentinel_for<_Sp, _Ip>) {
- (*this)(__i, __bound_sentinel - __i);
- }
- // Otherwise, while `bool(i != bound_sentinel)` is true, increments `i`.
- else {
- while (__i != __bound_sentinel) {
- ++__i;
- }
- }
- }
-
- // Preconditions:
- // * If `n > 0`, [i, bound_sentinel) denotes a range.
- // * If `n == 0`, [i, bound_sentinel) or [bound_sentinel, i) denotes a range.
- // * If `n < 0`, [bound_sentinel, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model
- // `same_as<I, S>`.
- // Returns: `n - M`, where `M` is the difference between the ending and starting position.
- template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
- _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip>
- operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const {
- // Calling `advance` with a negative value on a non-bidirectional iterator is a no-op in the current implementation.
- _LIBCPP_ASSERT_PEDANTIC((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
- "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
- // If `S` and `I` model `sized_sentinel_for<S, I>`:
- if constexpr (sized_sentinel_for<_Sp, _Ip>) {
- // If |n| >= |bound_sentinel - i|, equivalent to `ranges::advance(i, bound_sentinel)`.
- // __magnitude_geq(a, b) returns |a| >= |b|, assuming they have the same sign.
- auto __magnitude_geq = [](auto __a, auto __b) { return __a == 0 ? __b == 0 : __a > 0 ? __a >= __b : __a <= __b; };
- if (const auto __m = __bound_sentinel - __i; __magnitude_geq(__n, __m)) {
- (*this)(__i, __bound_sentinel);
- return __n - __m;
- }
-
- // Otherwise, equivalent to `ranges::advance(i, n)`.
- (*this)(__i, __n);
- return 0;
- } else {
- // Otherwise, if `n` is non-negative, while `bool(i != bound_sentinel)` is true, increments `i` but at
- // most `n` times.
- while (__n > 0 && __i != __bound_sentinel) {
- ++__i;
- --__n;
- }
-
- // Otherwise, while `bool(i != bound_sentinel)` is true, decrements `i` but at most `-n` times.
- if constexpr (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>) {
- while (__n < 0 && __i != __bound_sentinel) {
- --__i;
- ++__n;
- }
- }
- return __n;
- }
-
- __libcpp_unreachable();
- }
-};
-
-} // namespace __advance
-
-inline namespace __cpo {
-inline constexpr auto advance = __advance::__fn{};
-} // namespace __cpo
-} // namespace ranges
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__iterator/back_insert_iterator.h b/libcxx/include/__cxx03/__iterator/back_insert_iterator.h
index 962639a2746bf..a9e3370c6a042 100644
--- a/libcxx/include/__cxx03/__iterator/back_insert_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/back_insert_iterator.h
@@ -29,9 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Container>
class _LIBCPP_TEMPLATE_VIS back_insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -41,11 +39,7 @@ class _LIBCPP_TEMPLATE_VIS back_insert_iterator
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-#else
typedef void difference_type;
-#endif
typedef void pointer;
typedef void reference;
typedef _Container container_type;
@@ -57,13 +51,6 @@ class _LIBCPP_TEMPLATE_VIS back_insert_iterator
container->push_back(__value);
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator&
- operator=(typename _Container::value_type&& __value) {
- container->push_back(std::move(__value));
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator*() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator++() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator operator++(int) { return *this; }
diff --git a/libcxx/include/__cxx03/__iterator/bounded_iter.h b/libcxx/include/__cxx03/__iterator/bounded_iter.h
index d361e74283de7..7c3ed3a6a6d3a 100644
--- a/libcxx/include/__cxx03/__iterator/bounded_iter.h
+++ b/libcxx/include/__cxx03/__iterator/bounded_iter.h
@@ -54,9 +54,6 @@ struct __bounded_iter {
using pointer = typename iterator_traits<_Iterator>::pointer;
using reference = typename iterator_traits<_Iterator>::reference;
using iterator_category = typename iterator_traits<_Iterator>::iterator_category;
-#if _LIBCPP_STD_VER >= 20
- using iterator_concept = contiguous_iterator_tag;
-#endif
// Create a singular iterator.
//
@@ -204,12 +201,10 @@ struct __bounded_iter {
return __x.__current_ == __y.__current_;
}
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
operator!=(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
return __x.__current_ != __y.__current_;
}
-#endif
// TODO(mordante) disable these overloads in the LLVM 20 release.
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
@@ -229,23 +224,6 @@ struct __bounded_iter {
return __x.__current_ >= __y.__current_;
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr friend strong_ordering
- operator<=>(__bounded_iter const& __x, __bounded_iter const& __y) noexcept {
- if constexpr (three_way_comparable<_Iterator, strong_ordering>) {
- return __x.__current_ <=> __y.__current_;
- } else {
- if (__x.__current_ < __y.__current_)
- return strong_ordering::less;
-
- if (__x.__current_ == __y.__current_)
- return strong_ordering::equal;
-
- return strong_ordering::greater;
- }
- }
-#endif // _LIBCPP_STD_VER >= 20
-
private:
template <class>
friend struct pointer_traits;
@@ -260,10 +238,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter<_It> __make_bounded_iter(
return __bounded_iter<_It>(std::move(__it), std::move(__begin), std::move(__end));
}
-#if _LIBCPP_STD_VER <= 17
template <class _Iterator>
struct __libcpp_is_contiguous_iterator<__bounded_iter<_Iterator> > : true_type {};
-#endif
template <class _Iterator>
struct pointer_traits<__bounded_iter<_Iterator> > {
diff --git a/libcxx/include/__cxx03/__iterator/cpp17_iterator_concepts.h b/libcxx/include/__cxx03/__iterator/cpp17_iterator_concepts.h
index aed3527aee08a..ff6c76a359032 100644
--- a/libcxx/include/__cxx03/__iterator/cpp17_iterator_concepts.h
+++ b/libcxx/include/__cxx03/__iterator/cpp17_iterator_concepts.h
@@ -30,161 +30,12 @@
_LIBCPP_PUSH_MACROS
#include <__cxx03/__undef_macros>
-#if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp>
-concept __cpp17_move_constructible = is_move_constructible_v<_Tp>;
-
-template <class _Tp>
-concept __cpp17_copy_constructible = __cpp17_move_constructible<_Tp> && is_copy_constructible_v<_Tp>;
-
-template <class _Tp>
-concept __cpp17_move_assignable = requires(_Tp __lhs, _Tp __rhs) {
- { __lhs = std::move(__rhs) } -> same_as<_Tp&>;
-};
-
-template <class _Tp>
-concept __cpp17_copy_assignable = __cpp17_move_assignable<_Tp> && requires(_Tp __lhs, _Tp __rhs) {
- { __lhs = __rhs } -> same_as<_Tp&>;
- { __lhs = std::as_const(__rhs) } -> same_as<_Tp&>;
-};
-
-template <class _Tp>
-concept __cpp17_destructible = requires(_Tp __v) { __v.~_Tp(); };
-
-template <class _Tp>
-concept __cpp17_equality_comparable = requires(_Tp __lhs, _Tp __rhs) {
- { __lhs == __rhs } -> __boolean_testable;
- { std::as_const(__lhs) == __rhs } -> __boolean_testable;
- { __lhs == std::as_const(__rhs) } -> __boolean_testable;
- { std::as_const(__lhs) == std::as_const(__rhs) } -> __boolean_testable;
-};
-
-template <class _Tp>
-concept __cpp17_default_constructible = is_default_constructible_v<_Tp>;
-
-template <class _Iter>
-concept __cpp17_iterator =
- __cpp17_copy_constructible<_Iter> && __cpp17_copy_assignable<_Iter> && __cpp17_destructible<_Iter> &&
- (is_signed_v<__iter_diff_t<_Iter>> || is_void_v<__iter_diff_t<_Iter>>) && requires(_Iter __iter) {
- { *__iter };
- { ++__iter } -> same_as<_Iter&>;
- };
-
-template <class _Iter>
-concept __cpp17_input_iterator =
- __cpp17_iterator<_Iter> && __cpp17_equality_comparable<_Iter> && requires(_Iter __lhs, _Iter __rhs) {
- { __lhs != __rhs } -> __boolean_testable;
- { std::as_const(__lhs) != __rhs } -> __boolean_testable;
- { __lhs != std::as_const(__rhs) } -> __boolean_testable;
- { std::as_const(__lhs) != std::as_const(__rhs) } -> __boolean_testable;
-
- { *__lhs } -> same_as<__iter_reference<_Iter>>;
- { *std::as_const(__lhs) } -> same_as<__iter_reference<_Iter>>;
-
- { ++__lhs } -> same_as<_Iter&>;
- { (void)__lhs++ };
- { *__lhs++ };
- };
-
-template <class _Iter, class _WriteTo>
-concept __cpp17_output_iterator = __cpp17_iterator<_Iter> && requires(_Iter __iter, _WriteTo __write) {
- { *__iter = std::forward<_WriteTo>(__write) };
- { ++__iter } -> same_as<_Iter&>;
- { __iter++ } -> convertible_to<const _Iter&>;
- { *__iter++ = std::forward<_WriteTo>(__write) };
-};
-
-template <class _Iter>
-concept __cpp17_forward_iterator =
- __cpp17_input_iterator<_Iter> && __cpp17_default_constructible<_Iter> && requires(_Iter __iter) {
- { __iter++ } -> convertible_to<const _Iter&>;
- { *__iter++ } -> same_as<__iter_reference<_Iter>>;
- };
-
-template <class _Iter>
-concept __cpp17_bidirectional_iterator = __cpp17_forward_iterator<_Iter> && requires(_Iter __iter) {
- { --__iter } -> same_as<_Iter&>;
- { __iter-- } -> convertible_to<const _Iter&>;
- { *__iter-- } -> same_as<__iter_reference<_Iter>>;
-};
-
-template <class _Iter>
-concept __cpp17_random_access_iterator =
- __cpp17_bidirectional_iterator<_Iter> && requires(_Iter __iter, __iter_diff_t<_Iter> __n) {
- { __iter += __n } -> same_as<_Iter&>;
-
- { __iter + __n } -> same_as<_Iter>;
- { __n + __iter } -> same_as<_Iter>;
- { std::as_const(__iter) + __n } -> same_as<_Iter>;
- { __n + std::as_const(__iter) } -> same_as<_Iter>;
-
- { __iter -= __n } -> same_as<_Iter&>;
- { __iter - __n } -> same_as<_Iter>;
- { std::as_const(__iter) - __n } -> same_as<_Iter>;
-
- { __iter - __iter } -> same_as<__iter_diff_t<_Iter>>;
- { std::as_const(__iter) - __iter } -> same_as<__iter_diff_t<_Iter>>;
- { __iter - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;
- { std::as_const(__iter) - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;
-
- { __iter[__n] } -> convertible_to<__iter_reference<_Iter>>;
- { std::as_const(__iter)[__n] } -> convertible_to<__iter_reference<_Iter>>;
-
- { __iter < __iter } -> __boolean_testable;
- { std::as_const(__iter) < __iter } -> __boolean_testable;
- { __iter < std::as_const(__iter) } -> __boolean_testable;
- { std::as_const(__iter) < std::as_const(__iter) } -> __boolean_testable;
-
- { __iter > __iter } -> __boolean_testable;
- { std::as_const(__iter) > __iter } -> __boolean_testable;
- { __iter > std::as_const(__iter) } -> __boolean_testable;
- { std::as_const(__iter) > std::as_const(__iter) } -> __boolean_testable;
-
- { __iter >= __iter } -> __boolean_testable;
- { std::as_const(__iter) >= __iter } -> __boolean_testable;
- { __iter >= std::as_const(__iter) } -> __boolean_testable;
- { std::as_const(__iter) >= std::as_const(__iter) } -> __boolean_testable;
-
- { __iter <= __iter } -> __boolean_testable;
- { std::as_const(__iter) <= __iter } -> __boolean_testable;
- { __iter <= std::as_const(__iter) } -> __boolean_testable;
- { std::as_const(__iter) <= std::as_const(__iter) } -> __boolean_testable;
- };
-
-_LIBCPP_END_NAMESPACE_STD
-
-# ifndef _LIBCPP_DISABLE_ITERATOR_CHECKS
-# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) \
- static_assert(::std::__cpp17_input_iterator<iter_t>, message)
-# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) \
- static_assert(::std::__cpp17_output_iterator<iter_t, write_t>, message)
-# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) \
- static_assert(::std::__cpp17_forward_iterator<iter_t>, message)
-# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) \
- static_assert(::std::__cpp17_bidirectional_iterator<iter_t>, message)
-# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) \
- static_assert(::std::__cpp17_random_access_iterator<iter_t>, message)
-# else
-# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) static_assert(true)
-# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) static_assert(true)
-# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) static_assert(true)
-# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) static_assert(true)
-# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) static_assert(true)
-# endif
-
-#else // _LIBCPP_STD_VER >= 20
-
# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t, message) static_assert(true)
# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t, message) static_assert(true)
# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t, message) static_assert(true)
# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t, message) static_assert(true)
# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t, message) static_assert(true)
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_POP_MACROS
#endif // _LIBCPP___CXX03___ITERATOR_CPP17_ITERATOR_CONCEPTS_H
diff --git a/libcxx/include/__cxx03/__iterator/distance.h b/libcxx/include/__cxx03/__iterator/distance.h
index 91dcc32913799..2be8113a1c666 100644
--- a/libcxx/include/__cxx03/__iterator/distance.h
+++ b/libcxx/include/__cxx03/__iterator/distance.h
@@ -47,53 +47,6 @@ distance(_InputIter __first, _InputIter __last) {
return std::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER >= 20
-
-// [range.iter.op.distance]
-
-namespace ranges {
-namespace __distance {
-
-struct __fn {
- template <class _Ip, sentinel_for<_Ip> _Sp>
- requires(!sized_sentinel_for<_Sp, _Ip>)
- _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const {
- iter_difference_t<_Ip> __n = 0;
- while (__first != __last) {
- ++__first;
- ++__n;
- }
- return __n;
- }
-
- template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
- _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
- if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {
- return __last - __first;
- } else {
- return __last - decay_t<_Ip>(__first);
- }
- }
-
- template <range _Rp>
- _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Rp> operator()(_Rp&& __r) const {
- if constexpr (sized_range<_Rp>) {
- return static_cast<range_difference_t<_Rp>>(ranges::size(__r));
- } else {
- return operator()(ranges::begin(__r), ranges::end(__r));
- }
- }
-};
-
-} // namespace __distance
-
-inline namespace __cpo {
-inline constexpr auto distance = __distance::__fn{};
-} // namespace __cpo
-} // namespace ranges
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ITERATOR_DISTANCE_H
diff --git a/libcxx/include/__cxx03/__iterator/front_insert_iterator.h b/libcxx/include/__cxx03/__iterator/front_insert_iterator.h
index 9c2b987806f5b..ffc4d0eae8d8c 100644
--- a/libcxx/include/__cxx03/__iterator/front_insert_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/front_insert_iterator.h
@@ -29,9 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Container>
class _LIBCPP_TEMPLATE_VIS front_insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -41,11 +39,7 @@ class _LIBCPP_TEMPLATE_VIS front_insert_iterator
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-#else
typedef void difference_type;
-#endif
typedef void pointer;
typedef void reference;
typedef _Container container_type;
@@ -57,13 +51,6 @@ class _LIBCPP_TEMPLATE_VIS front_insert_iterator
container->push_front(__value);
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator&
- operator=(typename _Container::value_type&& __value) {
- container->push_front(std::move(__value));
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator*() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator++() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator operator++(int) { return *this; }
diff --git a/libcxx/include/__cxx03/__iterator/insert_iterator.h b/libcxx/include/__cxx03/__iterator/insert_iterator.h
index ef063ab73fced..311a6e46f975f 100644
--- a/libcxx/include/__cxx03/__iterator/insert_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/insert_iterator.h
@@ -27,20 +27,13 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-template <class _Container>
-using __insert_iterator_iter_t = ranges::iterator_t<_Container>;
-#else
template <class _Container>
using __insert_iterator_iter_t = typename _Container::iterator;
-#endif
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Container>
class _LIBCPP_TEMPLATE_VIS insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -51,11 +44,7 @@ class _LIBCPP_TEMPLATE_VIS insert_iterator
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-#else
typedef void difference_type;
-#endif
typedef void pointer;
typedef void reference;
typedef _Container container_type;
@@ -69,14 +58,6 @@ class _LIBCPP_TEMPLATE_VIS insert_iterator
++iter;
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator&
- operator=(typename _Container::value_type&& __value) {
- iter = container->insert(iter, std::move(__value));
- ++iter;
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator*() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++() { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++(int) { return *this; }
diff --git a/libcxx/include/__cxx03/__iterator/istream_iterator.h b/libcxx/include/__cxx03/__iterator/istream_iterator.h
index 71ca4ebc4a384..42924235b67ac 100644
--- a/libcxx/include/__cxx03/__iterator/istream_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/istream_iterator.h
@@ -28,9 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
class _LIBCPP_TEMPLATE_VIS istream_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -50,9 +48,6 @@ class _LIBCPP_TEMPLATE_VIS istream_iterator
public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr istream_iterator(default_sentinel_t) : istream_iterator() {}
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI istream_iterator(istream_type& __s) : __in_stream_(std::addressof(__s)) {
if (!(*__in_stream_ >> __value_))
__in_stream_ = nullptr;
@@ -74,12 +69,6 @@ class _LIBCPP_TEMPLATE_VIS istream_iterator
template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
-
-#if _LIBCPP_STD_VER >= 20
- friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator& __i, default_sentinel_t) {
- return __i.__in_stream_ == nullptr;
- }
-#endif // _LIBCPP_STD_VER >= 20
};
template <class _Tp, class _CharT, class _Traits, class _Distance>
@@ -88,13 +77,11 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator<_Tp, _CharT,
return __x.__in_stream_ == __y.__in_stream_;
}
-#if _LIBCPP_STD_VER <= 17
template <class _Tp, class _CharT, class _Traits, class _Distance>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y) {
return !(__x == __y);
}
-#endif // _LIBCPP_STD_VER <= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__iterator/istreambuf_iterator.h b/libcxx/include/__cxx03/__iterator/istreambuf_iterator.h
index 768747d490cc0..2493d77b9b120 100644
--- a/libcxx/include/__cxx03/__iterator/istreambuf_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/istreambuf_iterator.h
@@ -26,9 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _CharT, class _Traits>
class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<input_iterator_tag, _CharT, typename _Traits::off_type, _CharT*, _CharT>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -65,9 +63,6 @@ class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr istreambuf_iterator(default_sentinel_t) noexcept : istreambuf_iterator() {}
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI istreambuf_iterator(istream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {}
_LIBCPP_HIDE_FROM_ABI istreambuf_iterator(streambuf_type* __s) _NOEXCEPT : __sbuf_(__s) {}
_LIBCPP_HIDE_FROM_ABI istreambuf_iterator(const __proxy& __p) _NOEXCEPT : __sbuf_(__p.__sbuf_) {}
@@ -82,12 +77,6 @@ class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
_LIBCPP_HIDE_FROM_ABI bool equal(const istreambuf_iterator& __b) const {
return __test_for_eof() == __b.__test_for_eof();
}
-
-#if _LIBCPP_STD_VER >= 20
- friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istreambuf_iterator& __i, default_sentinel_t) {
- return __i.__test_for_eof();
- }
-#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits>
@@ -96,13 +85,11 @@ operator==(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_ite
return __a.equal(__b);
}
-#if _LIBCPP_STD_VER <= 17
template <class _CharT, class _Traits>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) {
return !__a.equal(__b);
}
-#endif // _LIBCPP_STD_VER <= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__iterator/iterator_traits.h b/libcxx/include/__cxx03/__iterator/iterator_traits.h
index 66bab3ddd7e57..37909a666cc31 100644
--- a/libcxx/include/__cxx03/__iterator/iterator_traits.h
+++ b/libcxx/include/__cxx03/__iterator/iterator_traits.h
@@ -42,25 +42,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-using __with_reference = _Tp&;
-
-template <class _Tp>
-concept __can_reference = requires { typename __with_reference<_Tp>; };
-
-template <class _Tp>
-concept __dereferenceable = requires(_Tp& __t) {
- { *__t } -> __can_reference; // not required to be equality-preserving
-};
-
-// [iterator.traits]
-template <__dereferenceable _Tp>
-using iter_reference_t = decltype(*std::declval<_Tp&>());
-
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _Iter>
struct _LIBCPP_TEMPLATE_VIS iterator_traits;
@@ -69,9 +50,6 @@ struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
-#if _LIBCPP_STD_VER >= 20
-struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag : public random_access_iterator_tag {};
-#endif
template <class _Iter>
struct __iter_traits_cache {
@@ -147,226 +125,6 @@ struct __has_iterator_concept {
static const bool value = decltype(__test<_Tp>(nullptr))::value;
};
-#if _LIBCPP_STD_VER >= 20
-
-// The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements
-// from `[iterator.cpp17]`. To avoid confusion between the two, the exposition-only concepts have been banished to
-// a "detail" namespace indicating they have a niche use-case.
-namespace __iterator_traits_detail {
-template <class _Ip>
-concept __cpp17_iterator = requires(_Ip __i) {
- { *__i } -> __can_reference;
- { ++__i } -> same_as<_Ip&>;
- { *__i++ } -> __can_reference;
-} && copyable<_Ip>;
-
-template <class _Ip>
-concept __cpp17_input_iterator = __cpp17_iterator<_Ip> && equality_comparable<_Ip> && requires(_Ip __i) {
- typename incrementable_traits<_Ip>::difference_type;
- typename indirectly_readable_traits<_Ip>::value_type;
- typename common_reference_t<iter_reference_t<_Ip>&&, typename indirectly_readable_traits<_Ip>::value_type&>;
- typename common_reference_t<decltype(*__i++)&&, typename indirectly_readable_traits<_Ip>::value_type&>;
- requires signed_integral<typename incrementable_traits<_Ip>::difference_type>;
-};
-
-template <class _Ip>
-concept __cpp17_forward_iterator =
- __cpp17_input_iterator<_Ip> && constructible_from<_Ip> && is_reference_v<iter_reference_t<_Ip>> &&
- same_as<remove_cvref_t<iter_reference_t<_Ip>>, typename indirectly_readable_traits<_Ip>::value_type> &&
- requires(_Ip __i) {
- { __i++ } -> convertible_to<_Ip const&>;
- { *__i++ } -> same_as<iter_reference_t<_Ip>>;
- };
-
-template <class _Ip>
-concept __cpp17_bidirectional_iterator = __cpp17_forward_iterator<_Ip> && requires(_Ip __i) {
- { --__i } -> same_as<_Ip&>;
- { __i-- } -> convertible_to<_Ip const&>;
- { *__i-- } -> same_as<iter_reference_t<_Ip>>;
-};
-
-template <class _Ip>
-concept __cpp17_random_access_iterator =
- __cpp17_bidirectional_iterator<_Ip> && totally_ordered<_Ip> &&
- requires(_Ip __i, typename incrementable_traits<_Ip>::difference_type __n) {
- { __i += __n } -> same_as<_Ip&>;
- { __i -= __n } -> same_as<_Ip&>;
- { __i + __n } -> same_as<_Ip>;
- { __n + __i } -> same_as<_Ip>;
- { __i - __n } -> same_as<_Ip>;
- { __i - __i } -> same_as<decltype(__n)>; // NOLINT(misc-redundant-expression) ; This is llvm.org/PR54114
- { __i[__n] } -> convertible_to<iter_reference_t<_Ip>>;
- };
-} // namespace __iterator_traits_detail
-
-template <class _Ip>
-concept __has_member_reference = requires { typename _Ip::reference; };
-
-template <class _Ip>
-concept __has_member_pointer = requires { typename _Ip::pointer; };
-
-template <class _Ip>
-concept __has_member_iterator_category = requires { typename _Ip::iterator_category; };
-
-template <class _Ip>
-concept __specifies_members = requires {
- typename _Ip::value_type;
- typename _Ip::difference_type;
- requires __has_member_reference<_Ip>;
- requires __has_member_iterator_category<_Ip>;
-};
-
-template <class>
-struct __iterator_traits_member_pointer_or_void {
- using type = void;
-};
-
-template <__has_member_pointer _Tp>
-struct __iterator_traits_member_pointer_or_void<_Tp> {
- using type = typename _Tp::pointer;
-};
-
-template <class _Tp>
-concept __cpp17_iterator_missing_members = !__specifies_members<_Tp> && __iterator_traits_detail::__cpp17_iterator<_Tp>;
-
-template <class _Tp>
-concept __cpp17_input_iterator_missing_members =
- __cpp17_iterator_missing_members<_Tp> && __iterator_traits_detail::__cpp17_input_iterator<_Tp>;
-
-// Otherwise, `pointer` names `void`.
-template <class>
-struct __iterator_traits_member_pointer_or_arrow_or_void {
- using type = void;
-};
-
-// [iterator.traits]/3.2.1
-// If the qualified-id `I::pointer` is valid and denotes a type, `pointer` names that type.
-template <__has_member_pointer _Ip>
-struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> {
- using type = typename _Ip::pointer;
-};
-
-// Otherwise, if `decltype(declval<I&>().operator->())` is well-formed, then `pointer` names that
-// type.
-template <class _Ip>
- requires requires(_Ip& __i) { __i.operator->(); } && (!__has_member_pointer<_Ip>)
-struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> {
- using type = decltype(std::declval<_Ip&>().operator->());
-};
-
-// Otherwise, `reference` names `iter-reference-t<I>`.
-template <class _Ip>
-struct __iterator_traits_member_reference {
- using type = iter_reference_t<_Ip>;
-};
-
-// [iterator.traits]/3.2.2
-// If the qualified-id `I::reference` is valid and denotes a type, `reference` names that type.
-template <__has_member_reference _Ip>
-struct __iterator_traits_member_reference<_Ip> {
- using type = typename _Ip::reference;
-};
-
-// [iterator.traits]/3.2.3.4
-// input_iterator_tag
-template <class _Ip>
-struct __deduce_iterator_category {
- using type = input_iterator_tag;
-};
-
-// [iterator.traits]/3.2.3.1
-// `random_access_iterator_tag` if `I` satisfies `cpp17-random-access-iterator`, or otherwise
-template <__iterator_traits_detail::__cpp17_random_access_iterator _Ip>
-struct __deduce_iterator_category<_Ip> {
- using type = random_access_iterator_tag;
-};
-
-// [iterator.traits]/3.2.3.2
-// `bidirectional_iterator_tag` if `I` satisfies `cpp17-bidirectional-iterator`, or otherwise
-template <__iterator_traits_detail::__cpp17_bidirectional_iterator _Ip>
-struct __deduce_iterator_category<_Ip> {
- using type = bidirectional_iterator_tag;
-};
-
-// [iterator.traits]/3.2.3.3
-// `forward_iterator_tag` if `I` satisfies `cpp17-forward-iterator`, or otherwise
-template <__iterator_traits_detail::__cpp17_forward_iterator _Ip>
-struct __deduce_iterator_category<_Ip> {
- using type = forward_iterator_tag;
-};
-
-template <class _Ip>
-struct __iterator_traits_iterator_category : __deduce_iterator_category<_Ip> {};
-
-// [iterator.traits]/3.2.3
-// If the qualified-id `I::iterator-category` is valid and denotes a type, `iterator-category` names
-// that type.
-template <__has_member_iterator_category _Ip>
-struct __iterator_traits_iterator_category<_Ip> {
- using type = typename _Ip::iterator_category;
-};
-
-// otherwise, it names void.
-template <class>
-struct __iterator_traits_difference_type {
- using type = void;
-};
-
-// If the qualified-id `incrementable_traits<I>::difference_type` is valid and denotes a type, then
-// `difference_type` names that type;
-template <class _Ip>
- requires requires { typename incrementable_traits<_Ip>::difference_type; }
-struct __iterator_traits_difference_type<_Ip> {
- using type = typename incrementable_traits<_Ip>::difference_type;
-};
-
-// [iterator.traits]/3.4
-// Otherwise, `iterator_traits<I>` has no members by any of the above names.
-template <class>
-struct __iterator_traits {};
-
-// [iterator.traits]/3.1
-// If `I` has valid ([temp.deduct]) member types `difference-type`, `value-type`, `reference`, and
-// `iterator-category`, then `iterator-traits<I>` has the following publicly accessible members:
-template <__specifies_members _Ip>
-struct __iterator_traits<_Ip> {
- using iterator_category = typename _Ip::iterator_category;
- using value_type = typename _Ip::value_type;
- using difference_type = typename _Ip::difference_type;
- using pointer = typename __iterator_traits_member_pointer_or_void<_Ip>::type;
- using reference = typename _Ip::reference;
-};
-
-// [iterator.traits]/3.2
-// Otherwise, if `I` satisfies the exposition-only concept `cpp17-input-iterator`,
-// `iterator-traits<I>` has the following publicly accessible members:
-template <__cpp17_input_iterator_missing_members _Ip>
-struct __iterator_traits<_Ip> {
- using iterator_category = typename __iterator_traits_iterator_category<_Ip>::type;
- using value_type = typename indirectly_readable_traits<_Ip>::value_type;
- using difference_type = typename incrementable_traits<_Ip>::difference_type;
- using pointer = typename __iterator_traits_member_pointer_or_arrow_or_void<_Ip>::type;
- using reference = typename __iterator_traits_member_reference<_Ip>::type;
-};
-
-// Otherwise, if `I` satisfies the exposition-only concept `cpp17-iterator`, then
-// `iterator_traits<I>` has the following publicly accessible members:
-template <__cpp17_iterator_missing_members _Ip>
-struct __iterator_traits<_Ip> {
- using iterator_category = output_iterator_tag;
- using value_type = void;
- using difference_type = typename __iterator_traits_difference_type<_Ip>::type;
- using pointer = void;
- using reference = void;
-};
-
-template <class _Ip>
-struct iterator_traits : __iterator_traits<_Ip> {
- using __primary_template = iterator_traits;
-};
-
-#else // _LIBCPP_STD_VER >= 20
-
template <class _Iter, bool>
struct __iterator_traits {};
@@ -397,21 +155,14 @@ template <class _Iter>
struct _LIBCPP_TEMPLATE_VIS iterator_traits : __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> {
using __primary_template = iterator_traits;
};
-#endif // _LIBCPP_STD_VER >= 20
template <class _Tp>
-#if _LIBCPP_STD_VER >= 20
- requires is_object_v<_Tp>
-#endif
struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*> {
typedef ptrdiff_t difference_type;
typedef __remove_cv_t<_Tp> value_type;
typedef _Tp* pointer;
typedef _Tp& reference;
typedef random_access_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER >= 20
- typedef contiguous_iterator_tag iterator_concept;
-#endif
};
template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value>
@@ -446,15 +197,8 @@ using __has_random_access_iterator_category = __has_iterator_category_convertibl
// Such iterators receive special "contiguous" optimizations in
// std::copy and std::sort.
//
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-struct __libcpp_is_contiguous_iterator
- : _Or< __has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>,
- __has_iterator_concept_convertible_to<_Tp, contiguous_iterator_tag> > {};
-#else
template <class _Tp>
struct __libcpp_is_contiguous_iterator : false_type {};
-#endif
// Any native pointer which is an iterator is also a contiguous iterator.
template <class _Up>
@@ -507,22 +251,6 @@ using __iter_diff_t = typename iterator_traits<_Iter>::difference_type;
template <class _Iter>
using __iter_reference = typename iterator_traits<_Iter>::reference;
-#if _LIBCPP_STD_VER >= 20
-
-// [readable.traits]
-
-// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes
-// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization
-// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise.
-// This has to be in this file and not readable_traits.h to break the include cycle between the two.
-template <class _Ip>
-using iter_value_t =
- typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
- indirectly_readable_traits<remove_cvref_t<_Ip> >,
- iterator_traits<remove_cvref_t<_Ip> > >::value_type;
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ITERATOR_ITERATOR_TRAITS_H
diff --git a/libcxx/include/__cxx03/__iterator/move_iterator.h b/libcxx/include/__cxx03/__iterator/move_iterator.h
index 0fbcfdd0c1d9f..2fa32b220e415 100644
--- a/libcxx/include/__cxx03/__iterator/move_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/move_iterator.h
@@ -44,57 +44,10 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter, class = void>
-struct __move_iter_category_base {};
-
-template <class _Iter>
- requires requires { typename iterator_traits<_Iter>::iterator_category; }
-struct __move_iter_category_base<_Iter> {
- using iterator_category =
- _If< derived_from<typename iterator_traits<_Iter>::iterator_category, random_access_iterator_tag>,
- random_access_iterator_tag,
- typename iterator_traits<_Iter>::iterator_category >;
-};
-
-template <class _Iter, class _Sent>
-concept __move_iter_comparable = requires {
- { std::declval<const _Iter&>() == std::declval<_Sent>() } -> convertible_to<bool>;
-};
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _Iter>
class _LIBCPP_TEMPLATE_VIS move_iterator
-#if _LIBCPP_STD_VER >= 20
- : public __move_iter_category_base<_Iter>
-#endif
{
-#if _LIBCPP_STD_VER >= 20
-
-private:
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __get_iter_concept() {
- if constexpr (random_access_iterator<_Iter>) {
- return random_access_iterator_tag{};
- } else if constexpr (bidirectional_iterator<_Iter>) {
- return bidirectional_iterator_tag{};
- } else if constexpr (forward_iterator<_Iter>) {
- return forward_iterator_tag{};
- } else {
- return input_iterator_tag{};
- }
- }
-#endif // _LIBCPP_STD_VER >= 20
-
public:
-#if _LIBCPP_STD_VER >= 20
- using iterator_type = _Iter;
- using iterator_concept = decltype(__get_iter_concept());
- // iterator_category is inherited and not always present
- using value_type = iter_value_t<_Iter>;
- using difference_type = iter_difference_t<_Iter>;
- using pointer = _Iter;
- using reference = iter_rvalue_reference_t<_Iter>;
-#else
typedef _Iter iterator_type;
typedef _If< __has_random_access_iterator_category<_Iter>::value,
random_access_iterator_tag,
@@ -107,7 +60,6 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
typedef typename iterator_traits<iterator_type>::reference __reference;
typedef __conditional_t<is_reference<__reference>::value, __libcpp_remove_reference_t<__reference>&&, __reference>
reference;
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit move_iterator(_Iter __i) : __current_(std::move(__i)) {}
@@ -120,40 +72,6 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
return __current_;
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr move_iterator()
- requires is_constructible_v<_Iter>
- : __current_() {}
-
- template <class _Up>
- requires(!_IsSame<_Up, _Iter>::value) && convertible_to<const _Up&, _Iter>
- _LIBCPP_HIDE_FROM_ABI constexpr move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {}
-
- template <class _Up>
- requires(!_IsSame<_Up, _Iter>::value) && convertible_to<const _Up&, _Iter> && assignable_from<_Iter&, const _Up&>
- _LIBCPP_HIDE_FROM_ABI constexpr move_iterator& operator=(const move_iterator<_Up>& __u) {
- __current_ = __u.base();
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const& noexcept { return __current_; }
- _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
-
- _LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const { return ranges::iter_move(__current_); }
- _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const {
- return ranges::iter_move(__current_ + __n);
- }
-
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator++(int)
- requires forward_iterator<_Iter>
- {
- move_iterator __tmp(*this);
- ++__current_;
- return __tmp;
- }
-
- _LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) { ++__current_; }
-#else
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator() : __current_() {}
template <class _Up, __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value, int> = 0>
@@ -183,7 +101,6 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
++__current_;
return __tmp;
}
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator--() {
--__current_;
@@ -209,39 +126,6 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
return *this;
}
-#if _LIBCPP_STD_VER >= 20
- template <sentinel_for<_Iter> _Sent>
- friend _LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y)
- requires __move_iter_comparable<_Iter, _Sent>
- {
- return __x.base() == __y.base();
- }
-
- template <sized_sentinel_for<_Iter> _Sent>
- friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
- operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) {
- return __x.base() - __y.base();
- }
-
- template <sized_sentinel_for<_Iter> _Sent>
- friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
- operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) {
- return __x.base() - __y.base();
- }
-
- friend _LIBCPP_HIDE_FROM_ABI constexpr iter_rvalue_reference_t<_Iter>
- iter_move(const move_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_))) {
- return ranges::iter_move(__i.__current_);
- }
-
- template <indirectly_swappable<_Iter> _It2>
- friend _LIBCPP_HIDE_FROM_ABI constexpr void
- iter_swap(const move_iterator& __x,
- const move_iterator<_It2>& __y) noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_))) {
- return ranges::iter_swap(__x.__current_, __y.__current_);
- }
-#endif // _LIBCPP_STD_VER >= 20
-
private:
template <class _It2>
friend class move_iterator;
@@ -256,13 +140,11 @@ operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
return __x.base() == __y.base();
}
-#if _LIBCPP_STD_VER <= 17
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
return __x.base() != __y.base();
}
-#endif // _LIBCPP_STD_VER <= 17
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
@@ -288,52 +170,17 @@ operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr auto
-operator<=>(const move_iterator<_Iter1>& __x,
- const move_iterator<_Iter2>& __y) -> compare_three_way_result_t<_Iter1, _Iter2> {
- return __x.base() <=> __y.base();
-}
-#endif // _LIBCPP_STD_VER >= 20
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto
-operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) -> decltype(__x.base() - __y.base()) {
- return __x.base() - __y.base();
-}
-#else
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI typename move_iterator<_Iter1>::difference_type
operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
return __x.base() - __y.base();
}
-#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter>
-inline _LIBCPP_HIDE_FROM_ABI constexpr move_iterator<_Iter>
-operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)
- requires requires {
- { __x.base() + __n } -> same_as<_Iter>;
- }
-{
- return __x + __n;
-}
-#else
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter>
operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) {
return move_iterator<_Iter>(__x.base() + __n);
}
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter1, class _Iter2>
- requires(!sized_sentinel_for<_Iter1, _Iter2>)
-inline constexpr bool disable_sized_sentinel_for<move_iterator<_Iter1>, move_iterator<_Iter2>> = true;
-#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter> make_move_iterator(_Iter __i) {
diff --git a/libcxx/include/__cxx03/__iterator/next.h b/libcxx/include/__cxx03/__iterator/next.h
index 459702fd43743..7fc2d8348a572 100644
--- a/libcxx/include/__cxx03/__iterator/next.h
+++ b/libcxx/include/__cxx03/__iterator/next.h
@@ -36,48 +36,6 @@ next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n =
return __x;
}
-#if _LIBCPP_STD_VER >= 20
-
-// [range.iter.op.next]
-
-namespace ranges {
-namespace __next {
-
-struct __fn {
- template <input_or_output_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const {
- ++__x;
- return __x;
- }
-
- template <input_or_output_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const {
- ranges::advance(__x, __n);
- return __x;
- }
-
- template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, _Sp __bound_sentinel) const {
- ranges::advance(__x, __bound_sentinel);
- return __x;
- }
-
- template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const {
- ranges::advance(__x, __n, __bound_sentinel);
- return __x;
- }
-};
-
-} // namespace __next
-
-inline namespace __cpo {
-inline constexpr auto next = __next::__fn{};
-} // namespace __cpo
-} // namespace ranges
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ITERATOR_NEXT_H
diff --git a/libcxx/include/__cxx03/__iterator/ostream_iterator.h b/libcxx/include/__cxx03/__iterator/ostream_iterator.h
index 100cc54045bb3..924ec6cc26a5e 100644
--- a/libcxx/include/__cxx03/__iterator/ostream_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/ostream_iterator.h
@@ -27,20 +27,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS ostream_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-#else
typedef void difference_type;
-#endif
typedef void pointer;
typedef void reference;
typedef _CharT char_type;
diff --git a/libcxx/include/__cxx03/__iterator/ostreambuf_iterator.h b/libcxx/include/__cxx03/__iterator/ostreambuf_iterator.h
index b5472b33b7711..d5b4f1d7ea8f0 100644
--- a/libcxx/include/__cxx03/__iterator/ostreambuf_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/ostreambuf_iterator.h
@@ -25,20 +25,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _CharT, class _Traits>
class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-#else
typedef void difference_type;
-#endif
typedef void pointer;
typedef void reference;
typedef _CharT char_type;
diff --git a/libcxx/include/__cxx03/__iterator/prev.h b/libcxx/include/__cxx03/__iterator/prev.h
index c272e52a9349b..87362aadd3274 100644
--- a/libcxx/include/__cxx03/__iterator/prev.h
+++ b/libcxx/include/__cxx03/__iterator/prev.h
@@ -35,42 +35,6 @@ prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n =
return __x;
}
-#if _LIBCPP_STD_VER >= 20
-
-// [range.iter.op.prev]
-
-namespace ranges {
-namespace __prev {
-
-struct __fn {
- template <bidirectional_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const {
- --__x;
- return __x;
- }
-
- template <bidirectional_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const {
- ranges::advance(__x, -__n);
- return __x;
- }
-
- template <bidirectional_iterator _Ip>
- _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Ip __bound_iter) const {
- ranges::advance(__x, -__n, __bound_iter);
- return __x;
- }
-};
-
-} // namespace __prev
-
-inline namespace __cpo {
-inline constexpr auto prev = __prev::__fn{};
-} // namespace __cpo
-} // namespace ranges
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___ITERATOR_PREV_H
diff --git a/libcxx/include/__cxx03/__iterator/reverse_iterator.h b/libcxx/include/__cxx03/__iterator/reverse_iterator.h
index b95ca27ff5fb0..5eebde222be51 100644
--- a/libcxx/include/__cxx03/__iterator/reverse_iterator.h
+++ b/libcxx/include/__cxx03/__iterator/reverse_iterator.h
@@ -49,13 +49,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Iter>
class _LIBCPP_TEMPLATE_VIS reverse_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<typename iterator_traits<_Iter>::iterator_category,
typename iterator_traits<_Iter>::value_type,
typename iterator_traits<_Iter>::difference_type,
typename iterator_traits<_Iter>::pointer,
typename iterator_traits<_Iter>::reference>
-#endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -64,11 +62,6 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
_Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break
#endif
-#if _LIBCPP_STD_VER >= 20
- static_assert(__has_bidirectional_iterator_category<_Iter>::value || bidirectional_iterator<_Iter>,
- "reverse_iterator<It> requires It to be a bidirectional iterator.");
-#endif // _LIBCPP_STD_VER >= 20
-
protected:
_Iter current;
@@ -80,16 +73,9 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
random_access_iterator_tag,
typename iterator_traits<_Iter>::iterator_category>;
using pointer = typename iterator_traits<_Iter>::pointer;
-#if _LIBCPP_STD_VER >= 20
- using iterator_concept = _If<random_access_iterator<_Iter>, random_access_iterator_tag, bidirectional_iterator_tag>;
- using value_type = iter_value_t<_Iter>;
- using difference_type = iter_difference_t<_Iter>;
- using reference = iter_reference_t<_Iter>;
-#else
using value_type = typename iterator_traits<_Iter>::value_type;
using difference_type = typename iterator_traits<_Iter>::difference_type;
using reference = typename iterator_traits<_Iter>::reference;
-#endif
#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator() : __t_(), current() {}
@@ -132,19 +118,7 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
return *--__tmp;
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr pointer operator->() const
- requires is_pointer_v<_Iter> || requires(const _Iter __i) { __i.operator->(); }
- {
- if constexpr (is_pointer_v<_Iter>) {
- return std::prev(current);
- } else {
- return std::prev(current).operator->();
- }
- }
-#else
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pointer operator->() const { return std::addressof(operator*()); }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator++() {
--current;
@@ -181,34 +155,11 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {
return *(*this + __n);
}
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i) noexcept(
- is_nothrow_copy_constructible_v<_Iter> && noexcept(ranges::iter_move(--std::declval<_Iter&>()))) {
- auto __tmp = __i.base();
- return ranges::iter_move(--__tmp);
- }
-
- template <indirectly_swappable<_Iter> _Iter2>
- _LIBCPP_HIDE_FROM_ABI friend constexpr void
- iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y) noexcept(
- is_nothrow_copy_constructible_v<_Iter> && is_nothrow_copy_constructible_v<_Iter2> &&
- noexcept(ranges::iter_swap(--std::declval<_Iter&>(), --std::declval<_Iter2&>()))) {
- auto __xtmp = __x.base();
- auto __ytmp = __y.base();
- ranges::iter_swap(--__xtmp, --__ytmp);
- }
-#endif // _LIBCPP_STD_VER >= 20
};
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() == __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() == __y.base();
}
@@ -216,11 +167,6 @@ operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() > __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() > __y.base();
}
@@ -228,11 +174,6 @@ operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() != __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() != __y.base();
}
@@ -240,11 +181,6 @@ operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() < __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() < __y.base();
}
@@ -252,11 +188,6 @@ operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() <= __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() <= __y.base();
}
@@ -264,37 +195,15 @@ operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 bool
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER >= 20
- requires requires {
- { __x.base() >= __y.base() } -> convertible_to<bool>;
- }
-#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
-_LIBCPP_HIDE_FROM_ABI constexpr compare_three_way_result_t<_Iter1, _Iter2>
-operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) {
- return __y.base() <=> __x.base();
-}
-#endif // _LIBCPP_STD_VER >= 20
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto
-operator-(const reverse_iterator<_Iter1>& __x,
- const reverse_iterator<_Iter2>& __y) -> decltype(__y.base() - __x.base()) {
- return __y.base() - __x.base();
-}
-#else
template <class _Iter1, class _Iter2>
inline _LIBCPP_HIDE_FROM_ABI typename reverse_iterator<_Iter1>::difference_type
operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) {
return __y.base() - __x.base();
}
-#endif
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter>
@@ -302,29 +211,6 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
return reverse_iterator<_Iter>(__x.base() - __n);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Iter1, class _Iter2>
- requires(!sized_sentinel_for<_Iter1, _Iter2>)
-inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, reverse_iterator<_Iter2>> = true;
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 14
-template <class _Iter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter> make_reverse_iterator(_Iter __i) {
- return reverse_iterator<_Iter>(__i);
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-template <ranges::bidirectional_range _Range>
-_LIBCPP_HIDE_FROM_ABI constexpr ranges::subrange<reverse_iterator<ranges::iterator_t<_Range>>,
- reverse_iterator<ranges::iterator_t<_Range>>>
-__reverse_range(_Range&& __range) {
- auto __first = ranges::begin(__range);
- return {std::make_reverse_iterator(ranges::next(__first, ranges::end(__range))), std::make_reverse_iterator(__first)};
-}
-#endif
-
template <class _Iter, bool __b>
struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b> {
using _UnwrappedIter = decltype(__unwrap_iter_impl<_Iter>::__unwrap(std::declval<_Iter>()));
diff --git a/libcxx/include/__cxx03/__iterator/wrap_iter.h b/libcxx/include/__cxx03/__iterator/wrap_iter.h
index 8e7df13490974..60c0d11f0a8ef 100644
--- a/libcxx/include/__cxx03/__iterator/wrap_iter.h
+++ b/libcxx/include/__cxx03/__iterator/wrap_iter.h
@@ -35,9 +35,6 @@ class __wrap_iter {
typedef typename iterator_traits<iterator_type>::pointer pointer;
typedef typename iterator_traits<iterator_type>::reference reference;
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
-#if _LIBCPP_STD_VER >= 20
- typedef contiguous_iterator_tag iterator_concept;
-#endif
private:
iterator_type __i_;
@@ -133,7 +130,6 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
return __x.base() < __y.base();
}
-#if _LIBCPP_STD_VER <= 17
template <class _Iter1>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
@@ -145,7 +141,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
return !(__x == __y);
}
-#endif
// TODO(mordante) disable these overloads in the LLVM 20 release.
template <class _Iter1>
@@ -184,35 +179,9 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
return !(__y < __x);
}
-#if _LIBCPP_STD_VER >= 20
template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
-operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept {
- if constexpr (three_way_comparable_with<_Iter1, _Iter2, strong_ordering>) {
- return __x.base() <=> __y.base();
- } else {
- if (__x.base() < __y.base())
- return strong_ordering::less;
-
- if (__x.base() == __y.base())
- return strong_ordering::equal;
-
- return strong_ordering::greater;
- }
-}
-#endif // _LIBCPP_STD_VER >= 20
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
-#ifndef _LIBCPP_CXX03_LANG
- auto
- operator-(const __wrap_iter<_Iter1>& __x,
- const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.base() - __y.base())
-#else
-typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-#endif // C++03
-{
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename __wrap_iter<_Iter1>::difference_type
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
return __x.base() - __y.base();
}
@@ -223,10 +192,8 @@ operator+(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1>
return __x;
}
-#if _LIBCPP_STD_VER <= 17
template <class _It>
struct __libcpp_is_contiguous_iterator<__wrap_iter<_It> > : true_type {};
-#endif
template <class _It>
struct _LIBCPP_TEMPLATE_VIS pointer_traits<__wrap_iter<_It> > {
diff --git a/libcxx/include/__cxx03/__locale b/libcxx/include/__cxx03/__locale
index 383b56a1942e8..1deda8d1149e7 100644
--- a/libcxx/include/__cxx03/__locale
+++ b/libcxx/include/__cxx03/__locale
@@ -84,9 +84,7 @@ public:
// locale operations:
string name() const;
bool operator==(const locale&) const;
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const { return !(*this == __y); }
-#endif
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool
operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const;
diff --git a/libcxx/include/__cxx03/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__cxx03/__locale_dir/locale_base_api/ibm.h
index 0fab9d24d84b6..a24d994e8ea21 100644
--- a/libcxx/include/__cxx03/__locale_dir/locale_base_api/ibm.h
+++ b/libcxx/include/__cxx03/__locale_dir/locale_base_api/ibm.h
@@ -88,7 +88,7 @@ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char
va_list ap_copy;
// va_copy may not be provided by the C library in C++03 mode.
-#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
+#if __has_builtin(__builtin_va_copy)
__builtin_va_copy(ap_copy, ap);
#else
va_copy(ap_copy, ap);
diff --git a/libcxx/include/__cxx03/__math/hypot.h b/libcxx/include/__cxx03/__math/hypot.h
index bd87fef5f5ed5..20b00f38d1e64 100644
--- a/libcxx/include/__cxx03/__math/hypot.h
+++ b/libcxx/include/__cxx03/__math/hypot.h
@@ -50,57 +50,6 @@ inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type hypot(_A1 __x, _
return __math::hypot((__result_type)__x, (__result_type)__y);
}
-#if _LIBCPP_STD_VER >= 17
-// Computes the three-dimensional hypotenuse: `std::hypot(x,y,z)`.
-// The naive implementation might over-/underflow which is why this implementation is more involved:
-// If the square of an argument might run into issues, we scale the arguments appropriately.
-// See https://github.com/llvm/llvm-project/issues/92782 for a detailed discussion and summary.
-template <class _Real>
-_LIBCPP_HIDE_FROM_ABI _Real __hypot(_Real __x, _Real __y, _Real __z) {
- // Factors needed to determine if over-/underflow might happen
- constexpr int __exp = std::numeric_limits<_Real>::max_exponent / 2;
- const _Real __overflow_threshold = __math::ldexp(_Real(1), __exp);
- const _Real __overflow_scale = __math::ldexp(_Real(1), -(__exp + 20));
-
- // Scale arguments depending on their size
- const _Real __max_abs = std::max(__math::fabs(__x), std::max(__math::fabs(__y), __math::fabs(__z)));
- _Real __scale;
- if (__max_abs > __overflow_threshold) { // x*x + y*y + z*z might overflow
- __scale = __overflow_scale;
- } else if (__max_abs < 1 / __overflow_threshold) { // x*x + y*y + z*z might underflow
- __scale = 1 / __overflow_scale;
- } else {
- __scale = 1;
- }
- __x *= __scale;
- __y *= __scale;
- __z *= __scale;
-
- // Compute hypot of scaled arguments and undo scaling
- return __math::sqrt(__x * __x + __y * __y + __z * __z) / __scale;
-}
-
-inline _LIBCPP_HIDE_FROM_ABI float hypot(float __x, float __y, float __z) { return __math::__hypot(__x, __y, __z); }
-
-inline _LIBCPP_HIDE_FROM_ABI double hypot(double __x, double __y, double __z) { return __math::__hypot(__x, __y, __z); }
-
-inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y, long double __z) {
- return __math::__hypot(__x, __y, __z);
-}
-
-template <class _A1,
- class _A2,
- class _A3,
- std::enable_if_t< is_arithmetic_v<_A1> && is_arithmetic_v<_A2> && is_arithmetic_v<_A3>, int> = 0 >
-_LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2, _A3>::type hypot(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT {
- using __result_type = typename __promote<_A1, _A2, _A3>::type;
- static_assert(!(
- std::is_same_v<_A1, __result_type> && std::is_same_v<_A2, __result_type> && std::is_same_v<_A3, __result_type>));
- return __math::__hypot(
- static_cast<__result_type>(__x), static_cast<__result_type>(__y), static_cast<__result_type>(__z));
-}
-#endif
-
} // namespace __math
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__memory/addressof.h b/libcxx/include/__cxx03/__memory/addressof.h
index 6c88ec87be1ac..81c6a696f0631 100644
--- a/libcxx/include/__cxx03/__memory/addressof.h
+++ b/libcxx/include/__cxx03/__memory/addressof.h
@@ -51,11 +51,6 @@ inline _LIBCPP_HIDE_FROM_ABI __unsafe_unretained _Tp* addressof(__unsafe_unretai
}
#endif
-#if !defined(_LIBCPP_CXX03_LANG)
-template <class _Tp>
-_Tp* addressof(const _Tp&&) noexcept = delete;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MEMORY_ADDRESSOF_H
diff --git a/libcxx/include/__cxx03/__memory/aligned_alloc.h b/libcxx/include/__cxx03/__memory/aligned_alloc.h
index af90baeabc140..1efffccffb084 100644
--- a/libcxx/include/__cxx03/__memory/aligned_alloc.h
+++ b/libcxx/include/__cxx03/__memory/aligned_alloc.h
@@ -30,17 +30,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
inline _LIBCPP_HIDE_FROM_ABI void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
# if defined(_LIBCPP_MSVCRT_LIKE)
return ::_aligned_malloc(__size, __alignment);
-# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
- // aligned_alloc() requires that __size is a multiple of __alignment,
- // but for C++ [new.delete.general], only states "if the value of an
- // alignment argument passed to any of these functions is not a valid
- // alignment value, the behavior is undefined".
- // To handle calls such as ::operator new(1, std::align_val_t(128)), we
- // round __size up to the next multiple of __alignment.
- size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
- // Rounding up could have wrapped around to zero, so we have to add another
- // max() ternary to the actual call site to avoid succeeded in that case.
- return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
# else
void* __result = nullptr;
(void)::posix_memalign(&__result, __alignment, __size);
diff --git a/libcxx/include/__cxx03/__memory/allocate_at_least.h b/libcxx/include/__cxx03/__memory/allocate_at_least.h
index cb1810855a01d..3906d88599c74 100644
--- a/libcxx/include/__cxx03/__memory/allocate_at_least.h
+++ b/libcxx/include/__cxx03/__memory/allocate_at_least.h
@@ -19,15 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 23
-
-template <class _Alloc>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto __allocate_at_least(_Alloc& __alloc, size_t __n) {
- return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);
-}
-
-#else
-
template <class _Pointer>
struct __allocation_result {
_Pointer ptr;
@@ -41,8 +32,6 @@ __allocate_at_least(_Alloc& __alloc, size_t __n) {
return {__alloc.allocate(__n), __n};
}
-#endif // _LIBCPP_STD_VER >= 23
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MEMORY_ALLOCATE_AT_LEAST_H
diff --git a/libcxx/include/__cxx03/__memory/allocator.h b/libcxx/include/__cxx03/__memory/allocator.h
index 06f270a0c008c..e527c0582be8f 100644
--- a/libcxx/include/__cxx03/__memory/allocator.h
+++ b/libcxx/include/__cxx03/__memory/allocator.h
@@ -32,7 +32,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
class allocator;
-#if _LIBCPP_STD_VER <= 17
// These specializations shouldn't be marked _LIBCPP_DEPRECATED_IN_CXX17.
// Specializing allocator<void> is deprecated, but not using it.
template <>
@@ -63,7 +62,6 @@ class _LIBCPP_TEMPLATE_VIS allocator<const void> {
};
};
# endif // _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST
-#endif // _LIBCPP_STD_VER <= 17
// This class provides a non-trivial default constructor to the class that derives from it
// if the condition is satisfied.
@@ -100,9 +98,7 @@ class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::v
typedef ptrdiff_t difference_type;
typedef _Tp value_type;
typedef true_type propagate_on_container_move_assignment;
-#if _LIBCPP_STD_VER <= 23 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_ALLOCATOR_MEMBERS)
_LIBCPP_DEPRECATED_IN_CXX23 typedef true_type is_always_equal;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
@@ -119,12 +115,6 @@ class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::v
}
}
-#if _LIBCPP_STD_VER >= 23
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr allocation_result<_Tp*> allocate_at_least(size_t __n) {
- return {allocate(__n), __n};
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
if (__libcpp_is_constant_evaluated()) {
::operator delete(__p);
@@ -134,7 +124,6 @@ class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::v
}
// C++20 Removed members
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
_LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
_LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
@@ -166,103 +155,19 @@ class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::v
}
_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI void destroy(pointer __p) { __p->~_Tp(); }
-#endif
};
-// TODO(LLVM 20): Remove the escape hatch
-#ifdef _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST
-template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
- : private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> > {
- static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types");
-
-public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef const _Tp value_type;
- typedef true_type propagate_on_container_move_assignment;
-# if _LIBCPP_STD_VER <= 23 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX23 typedef true_type is_always_equal;
-# endif
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
-
- template <class _Up>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator(const allocator<_Up>&) _NOEXCEPT {}
-
- _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const _Tp* allocate(size_t __n) {
- if (__n > allocator_traits<allocator>::max_size(*this))
- __throw_bad_array_new_length();
- if (__libcpp_is_constant_evaluated()) {
- return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp)));
- } else {
- return static_cast<const _Tp*>(std::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
- }
- }
-
-# if _LIBCPP_STD_VER >= 23
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr allocation_result<const _Tp*> allocate_at_least(size_t __n) {
- return {allocate(__n), __n};
- }
-# endif
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void deallocate(const _Tp* __p, size_t __n) {
- if (__libcpp_is_constant_evaluated()) {
- ::operator delete(const_cast<_Tp*>(__p));
- } else {
- std::__libcpp_deallocate((void*)const_cast<_Tp*>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
- }
- }
-
- // C++20 Removed members
-# if _LIBCPP_STD_VER <= 17
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
-
- template <class _Up>
- struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
- typedef allocator<_Up> other;
- };
-
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI const_pointer address(const_reference __x) const _NOEXCEPT {
- return std::addressof(__x);
- }
-
- _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 const _Tp* allocate(size_t __n, const void*) {
- return allocate(__n);
- }
-
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
- return size_type(~0) / sizeof(_Tp);
- }
-
- template <class _Up, class... _Args>
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI void construct(_Up* __p, _Args&&... __args) {
- ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
- }
-
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI void destroy(pointer __p) { __p->~_Tp(); }
-# endif
-};
-#endif // _LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST
-
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {
return true;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {
return false;
}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MEMORY_ALLOCATOR_H
diff --git a/libcxx/include/__cxx03/__memory/allocator_arg_t.h b/libcxx/include/__cxx03/__memory/allocator_arg_t.h
index 3646b71e42655..1dbea06785b6b 100644
--- a/libcxx/include/__cxx03/__memory/allocator_arg_t.h
+++ b/libcxx/include/__cxx03/__memory/allocator_arg_t.h
@@ -27,49 +27,6 @@ struct _LIBCPP_TEMPLATE_VIS allocator_arg_t {
explicit allocator_arg_t() = default;
};
-#if _LIBCPP_STD_VER >= 17
-inline constexpr allocator_arg_t allocator_arg = allocator_arg_t();
-#elif !defined(_LIBCPP_CXX03_LANG)
-constexpr allocator_arg_t allocator_arg = allocator_arg_t();
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-// allocator construction
-
-template <class _Tp, class _Alloc, class... _Args>
-struct __uses_alloc_ctor_imp {
- typedef _LIBCPP_NODEBUG __remove_cvref_t<_Alloc> _RawAlloc;
- static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
- static const bool __ic = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
- static const int value = __ua ? 2 - __ic : 0;
-};
-
-template <class _Tp, class _Alloc, class... _Args>
-struct __uses_alloc_ctor : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value> {};
-
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 0>, _Tp* __storage, const _Allocator&, _Args&&... __args) {
- new (__storage) _Tp(std::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 1>, _Tp* __storage, const _Allocator& __a, _Args&&... __args) {
- new (__storage) _Tp(allocator_arg, __a, std::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 2>, _Tp* __storage, const _Allocator& __a, _Args&&... __args) {
- new (__storage) _Tp(std::forward<_Args>(__args)..., __a);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___FUNCTIONAL_ALLOCATOR_ARG_T_H
diff --git a/libcxx/include/__cxx03/__memory/allocator_traits.h b/libcxx/include/__cxx03/__memory/allocator_traits.h
index e70716c070158..8708ed2ccea4c 100644
--- a/libcxx/include/__cxx03/__memory/allocator_traits.h
+++ b/libcxx/include/__cxx03/__memory/allocator_traits.h
@@ -61,11 +61,7 @@ struct __const_pointer {
};
template <class _Tp, class _Ptr, class _Alloc>
struct __const_pointer<_Tp, _Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>::other;
-#else
- using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
-#endif
};
// __void_pointer
@@ -76,11 +72,7 @@ struct __void_pointer {
};
template <class _Ptr, class _Alloc>
struct __void_pointer<_Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>::other;
-#else
- using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>;
-#endif
};
// __const_void_pointer
@@ -91,11 +83,7 @@ struct __const_void_pointer {
};
template <class _Ptr, class _Alloc>
struct __const_void_pointer<_Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>::other;
-#else
- using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>;
-#endif
};
// __size_type
@@ -231,17 +219,6 @@ struct __has_select_on_container_copy_construction<
_LIBCPP_SUPPRESS_DEPRECATED_POP
-#if _LIBCPP_STD_VER >= 23
-
-template <class _Pointer, class _SizeType = size_t>
-struct allocation_result {
- _Pointer ptr;
- _SizeType count;
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(allocation_result);
-
-#endif // _LIBCPP_STD_VER
-
template <class _Alloc>
struct _LIBCPP_TEMPLATE_VIS allocator_traits {
using allocator_type = _Alloc;
@@ -259,12 +236,6 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type;
using is_always_equal = typename __is_always_equal<allocator_type>::type;
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Tp>
- using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>;
- template <class _Tp>
- using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
-#else // _LIBCPP_CXX03_LANG
template <class _Tp>
struct rebind_alloc {
using other = __allocator_traits_rebind_t<allocator_type, _Tp>;
@@ -273,7 +244,6 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
struct rebind_traits {
using other = allocator_traits<typename rebind_alloc<_Tp>::other>;
};
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
allocate(allocator_type& __a, size_type __n) {
@@ -295,18 +265,6 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
return __a.allocate(__n);
}
-#if _LIBCPP_STD_VER >= 23
- template <class _Ap = _Alloc>
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr allocation_result<pointer, size_type>
- allocate_at_least(_Ap& __alloc, size_type __n) {
- if constexpr (requires { __alloc.allocate_at_least(__n); }) {
- return __alloc.allocate_at_least(__n);
- } else {
- return {__alloc.allocate(__n), __n};
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void
deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
__a.deallocate(__p, __n);
@@ -364,13 +322,8 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
}
};
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Traits, class _Tp>
-using __rebind_alloc _LIBCPP_NODEBUG = typename _Traits::template rebind_alloc<_Tp>;
-#else
template <class _Traits, class _Tp>
using __rebind_alloc = typename _Traits::template rebind_alloc<_Tp>::other;
-#endif
template <class _Alloc>
struct __check_valid_allocator : true_type {
diff --git a/libcxx/include/__cxx03/__memory/assume_aligned.h b/libcxx/include/__cxx03/__memory/assume_aligned.h
index 03a495aac580c..f504e95431cd6 100644
--- a/libcxx/include/__cxx03/__memory/assume_aligned.h
+++ b/libcxx/include/__cxx03/__memory/assume_aligned.h
@@ -36,15 +36,6 @@ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __ass
}
}
-#if _LIBCPP_STD_VER >= 20
-
-template <size_t _Np, class _Tp>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* assume_aligned(_Tp* __ptr) {
- return std::__assume_aligned<_Np>(__ptr);
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MEMORY_ASSUME_ALIGNED_H
diff --git a/libcxx/include/__cxx03/__memory/auto_ptr.h b/libcxx/include/__cxx03/__memory/auto_ptr.h
index d5d541e1547a5..b27f5cf49cd1e 100644
--- a/libcxx/include/__cxx03/__memory/auto_ptr.h
+++ b/libcxx/include/__cxx03/__memory/auto_ptr.h
@@ -16,8 +16,6 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
@@ -87,6 +85,4 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr<void> {
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-
#endif // _LIBCPP___CXX03___MEMORY_AUTO_PTR_H
diff --git a/libcxx/include/__cxx03/__memory/compressed_pair.h b/libcxx/include/__cxx03/__memory/compressed_pair.h
index 086621d355d6d..550aa7e62204d 100644
--- a/libcxx/include/__cxx03/__memory/compressed_pair.h
+++ b/libcxx/include/__cxx03/__memory/compressed_pair.h
@@ -52,13 +52,6 @@ struct __compressed_pair_elem {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(_Up&& __u)
: __value_(std::forward<_Up>(__u)) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args, size_t... _Indices>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit __compressed_pair_elem(
- piecewise_construct_t, tuple<_Args...> __args, __tuple_indices<_Indices...>)
- : __value_(std::forward<_Args>(std::get<_Indices>(__args))...) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return __value_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return __value_; }
@@ -81,13 +74,6 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(_Up&& __u)
: __value_type(std::forward<_Up>(__u)) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args, size_t... _Indices>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
- __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, __tuple_indices<_Indices...>)
- : __value_type(std::forward<_Args>(std::get<_Indices>(__args))...) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return *this; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return *this; }
};
@@ -118,14 +104,6 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>, private __comp
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair(_U1&& __t1, _U2&& __t2)
: _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args1, class... _Args2>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit __compressed_pair(
- piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
- : _Base1(__pc, std::move(__first_args), typename __make_tuple_indices<sizeof...(_Args1)>::type()),
- _Base2(__pc, std::move(__second_args), typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base1::reference first() _NOEXCEPT {
return static_cast<_Base1&>(*this).__get();
}
diff --git a/libcxx/include/__cxx03/__memory/construct_at.h b/libcxx/include/__cxx03/__memory/construct_at.h
index 755cdbf9743d1..b2f1a073fdc43 100644
--- a/libcxx/include/__cxx03/__memory/construct_at.h
+++ b/libcxx/include/__cxx03/__memory/construct_at.h
@@ -33,24 +33,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// construct_at
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
- _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at");
- return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
-}
-
-#endif
-
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
-#if _LIBCPP_STD_VER >= 20
- return std::construct_at(__location, std::forward<_Args>(__args)...);
-#else
return _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at"),
::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
-#endif
}
// destroy_at
@@ -67,14 +53,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy_at(_Tp* __loc
__loc->~_Tp();
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, __enable_if_t<is_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT_NON_NULL(__loc != nullptr, "null pointer given to destroy_at");
- std::__destroy(std::begin(*__loc), std::end(*__loc));
-}
-#endif
-
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
__destroy(_ForwardIterator __first, _ForwardIterator __last) {
@@ -93,34 +71,6 @@ __reverse_destroy(_BidirectionalIterator __first, _BidirectionalIterator __last)
return __last;
}
-#if _LIBCPP_STD_VER >= 17
-
-template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy_at(_Tp* __loc) {
- std::__destroy_at(__loc);
-}
-
-# if _LIBCPP_STD_VER >= 20
-template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy_at(_Tp* __loc) {
- std::__destroy_at(__loc);
-}
-# endif
-
-template <class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy(_ForwardIterator __first, _ForwardIterator __last) {
- (void)std::__destroy(std::move(__first), std::move(__last));
-}
-
-template <class _ForwardIterator, class _Size>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
- for (; __n > 0; (void)++__first, --__n)
- std::__destroy_at(std::addressof(*__first));
- return __first;
-}
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__memory/pointer_traits.h b/libcxx/include/__cxx03/__memory/pointer_traits.h
index f1206836676d4..b159515f9722a 100644
--- a/libcxx/include/__cxx03/__memory/pointer_traits.h
+++ b/libcxx/include/__cxx03/__memory/pointer_traits.h
@@ -93,20 +93,12 @@ struct __has_rebind {
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __pointer_traits_rebind {
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up> type;
-#else
typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up>::other type;
-#endif
};
template <template <class, class...> class _Sp, class _Tp, class... _Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true> {
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
-#else
typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
-#endif
};
template <template <class, class...> class _Sp, class _Tp, class... _Args, class _Up>
@@ -123,15 +115,10 @@ struct __pointer_traits_impl<_Ptr, __void_t<typename __pointer_traits_element_ty
typedef typename __pointer_traits_element_type<pointer>::type element_type;
typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Up>
- using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
-#else
template <class _Up>
struct rebind {
typedef typename __pointer_traits_rebind<pointer, _Up>::type other;
};
-#endif // _LIBCPP_CXX03_LANG
private:
struct __nat {};
@@ -152,15 +139,10 @@ struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*> {
typedef _Tp element_type;
typedef ptrdiff_t difference_type;
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Up>
- using rebind = _Up*;
-#else
template <class _Up>
struct rebind {
typedef _Up* other;
};
-#endif
private:
struct __nat {};
@@ -172,13 +154,8 @@ struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*> {
}
};
-#ifndef _LIBCPP_CXX03_LANG
-template <class _From, class _To>
-using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>;
-#else
template <class _From, class _To>
using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>::other;
-#endif
// to_address
@@ -236,70 +213,6 @@ struct __to_address_helper<_Pointer,
}
};
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI constexpr auto to_address(_Tp* __p) noexcept {
- return std::__to_address(__p);
-}
-
-template <class _Pointer>
-inline _LIBCPP_HIDE_FROM_ABI constexpr auto
-to_address(const _Pointer& __p) noexcept -> decltype(std::__to_address(__p)) {
- return std::__to_address(__p);
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-
-template <class _Tp>
-struct __pointer_of {};
-
-template <class _Tp>
- requires(__has_pointer<_Tp>::value)
-struct __pointer_of<_Tp> {
- using type = typename _Tp::pointer;
-};
-
-template <class _Tp>
- requires(!__has_pointer<_Tp>::value && __has_element_type<_Tp>::value)
-struct __pointer_of<_Tp> {
- using type = typename _Tp::element_type*;
-};
-
-template <class _Tp>
- requires(!__has_pointer<_Tp>::value && !__has_element_type<_Tp>::value &&
- __has_element_type<pointer_traits<_Tp>>::value)
-struct __pointer_of<_Tp> {
- using type = typename pointer_traits<_Tp>::element_type*;
-};
-
-template <typename _Tp>
-using __pointer_of_t = typename __pointer_of<_Tp>::type;
-
-template <class _Tp, class _Up>
-struct __pointer_of_or {
- using type _LIBCPP_NODEBUG = _Up;
-};
-
-template <class _Tp, class _Up>
- requires requires { typename __pointer_of_t<_Tp>; }
-struct __pointer_of_or<_Tp, _Up> {
- using type _LIBCPP_NODEBUG = __pointer_of_t<_Tp>;
-};
-
-template <typename _Tp, typename _Up>
-using __pointer_of_or_t = typename __pointer_of_or<_Tp, _Up>::type;
-
-template <class _Smart>
-concept __resettable_smart_pointer = requires(_Smart __s) { __s.reset(); };
-
-template <class _Smart, class _Pointer, class... _Args>
-concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p, _Args... __args) {
- __s.reset(static_cast<__pointer_of_or_t<_Smart, _Pointer>>(__p), std::forward<_Args>(__args)...);
-};
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__memory/raw_storage_iterator.h b/libcxx/include/__cxx03/__memory/raw_storage_iterator.h
index c0f6b9151e5cb..4d9facf513b5e 100644
--- a/libcxx/include/__cxx03/__memory/raw_storage_iterator.h
+++ b/libcxx/include/__cxx03/__memory/raw_storage_iterator.h
@@ -27,14 +27,10 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
-
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _OutputIterator, class _Tp>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
-# if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
: public iterator<output_iterator_tag, void, void, void, void>
-# endif
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -44,11 +40,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-# if _LIBCPP_STD_VER >= 20
- typedef ptrdiff_t difference_type;
-# else
typedef void difference_type;
-# endif
typedef void pointer;
typedef void reference;
@@ -58,12 +50,6 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
::new ((void*)std::addressof(*__x_)) _Tp(__element);
return *this;
}
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator=(_Tp&& __element) {
- ::new ((void*)std::addressof(*__x_)) _Tp(std::move(__element));
- return *this;
- }
-# endif
_LIBCPP_HIDE_FROM_ABI raw_storage_iterator& operator++() {
++__x_;
return *this;
@@ -73,13 +59,8 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
++__x_;
return __t;
}
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI _OutputIterator base() const { return __x_; }
-# endif
};
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__memory/shared_ptr.h b/libcxx/include/__cxx03/__memory/shared_ptr.h
index 5e1f8c1ff7d5e..8cf072c9d939d 100644
--- a/libcxx/include/__cxx03/__memory/shared_ptr.h
+++ b/libcxx/include/__cxx03/__memory/shared_ptr.h
@@ -342,41 +342,16 @@ class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.general-6
// A pointer type Y* is said to be compatible with a pointer type T*
// when either Y* is convertible to T* or Y is U[N] and T is cv U[].
-#if _LIBCPP_STD_VER >= 17
-template <class _Yp, class _Tp>
-struct __bounded_convertible_to_unbounded : false_type {};
-
-template <class _Up, std::size_t _Np, class _Tp>
-struct __bounded_convertible_to_unbounded<_Up[_Np], _Tp> : is_same<__remove_cv_t<_Tp>, _Up[]> {};
-
-template <class _Yp, class _Tp>
-struct __compatible_with : _Or< is_convertible<_Yp*, _Tp*>, __bounded_convertible_to_unbounded<_Yp, _Tp> > {};
-#else
template <class _Yp, class _Tp>
struct __compatible_with : is_convertible<_Yp*, _Tp*> {};
-#endif // _LIBCPP_STD_VER >= 17
// Constructors that take raw pointers have a different set of "compatible" constraints
// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.const-9.1
// - If T is an array type, then either T is U[N] and Y(*)[N] is convertible to T*,
// or T is U[] and Y(*)[] is convertible to T*.
// - If T is not an array type, then Y* is convertible to T*.
-#if _LIBCPP_STD_VER >= 17
-template <class _Yp, class _Tp, class = void>
-struct __raw_pointer_compatible_with : _And< _Not<is_array<_Tp>>, is_convertible<_Yp*, _Tp*> > {};
-
-template <class _Yp, class _Up, std::size_t _Np>
-struct __raw_pointer_compatible_with<_Yp, _Up[_Np], __enable_if_t< is_convertible<_Yp (*)[_Np], _Up (*)[_Np]>::value> >
- : true_type {};
-
-template <class _Yp, class _Up>
-struct __raw_pointer_compatible_with<_Yp, _Up[], __enable_if_t< is_convertible<_Yp (*)[], _Up (*)[]>::value> >
- : true_type {};
-
-#else
template <class _Yp, class _Tp>
struct __raw_pointer_compatible_with : is_convertible<_Yp*, _Tp*> {};
-#endif // _LIBCPP_STD_VER >= 17
template <class _Ptr, class = void>
struct __is_deletable : false_type {};
@@ -417,12 +392,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
struct __nullptr_sfinae_tag {};
public:
-#if _LIBCPP_STD_VER >= 17
- typedef weak_ptr<_Tp> weak_type;
- typedef remove_extent_t<_Tp> element_type;
-#else
typedef _Tp element_type;
-#endif
// A shared_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require
// any bookkeeping, so it's always trivially relocatable.
@@ -437,17 +407,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
- template <class _Yp,
- __enable_if_t< _And< __raw_pointer_compatible_with<_Yp, _Tp>
- // In C++03 we get errors when trying to do SFINAE with the
- // delete operator, so we always pretend that it's deletable.
- // The same happens on GCC.
-#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)
- ,
- _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
-#endif
- >::value,
- int> = 0>
+ template <class _Yp, __enable_if_t< _And< __raw_pointer_compatible_with<_Yp, _Tp> >::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
unique_ptr<_Yp> __hold(__p);
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
@@ -464,11 +424,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
-#ifndef _LIBCPP_CXX03_LANG
- __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());
-#else
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
-#endif // not _LIBCPP_CXX03_LANG
__enable_weak_this(__p, __p);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
@@ -492,11 +448,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
_A2 __a2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
::new ((void*)std::addressof(*__hold2.get()))
-#ifndef _LIBCPP_CXX03_LANG
- _CntrlBlk(__p, std::move(__d), __a);
-#else
_CntrlBlk(__p, __d, __a);
-#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = std::addressof(*__hold2.release());
__enable_weak_this(__p, __p);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
@@ -518,11 +470,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
-#ifndef _LIBCPP_CXX03_LANG
- __cntrl_ = new _CntrlBlk(__p, std::move(__d), _AllocT());
-#else
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
-#endif // not _LIBCPP_CXX03_LANG
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
__d(__p);
@@ -546,12 +494,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
typedef __allocator_destructor<_A2> _D2;
_A2 __a2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new ((void*)std::addressof(*__hold2.get()))
-#ifndef _LIBCPP_CXX03_LANG
- _CntrlBlk(__p, std::move(__d), __a);
-#else
- _CntrlBlk(__p, __d, __a);
-#endif // not _LIBCPP_CXX03_LANG
+ ::new ((void*)std::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a);
__cntrl_ = std::addressof(*__hold2.release());
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
@@ -569,17 +512,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
__cntrl_->__add_shared();
}
-// LWG-2996
-// We don't backport because it is an evolutionary change.
-#if _LIBCPP_STD_VER >= 20
- template <class _Yp>
- _LIBCPP_HIDE_FROM_ABI shared_ptr(shared_ptr<_Yp>&& __r, element_type* __p) noexcept
- : __ptr_(__p), __cntrl_(__r.__cntrl_) {
- __r.__ptr_ = nullptr;
- __r.__cntrl_ = nullptr;
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI shared_ptr(const shared_ptr& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
if (__cntrl_)
__cntrl_->__add_shared();
@@ -609,7 +541,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
__throw_bad_weak_ptr();
}
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template <class _Yp, __enable_if_t<is_convertible<_Yp*, element_type*>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI shared_ptr(auto_ptr<_Yp>&& __r) : __ptr_(__r.get()) {
typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<__remove_cv_t<_Yp> > > _CntrlBlk;
@@ -617,7 +548,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
__enable_weak_this(__r.get(), __r.get());
__r.release();
}
-#endif
template <class _Yp,
class _Dp,
@@ -625,11 +555,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {
-#if _LIBCPP_STD_VER >= 14
- if (__ptr_ == nullptr)
- __cntrl_ = nullptr;
- else
-#endif
{
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Dp, _AllocT> _CntrlBlk;
@@ -646,11 +571,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {
-#if _LIBCPP_STD_VER >= 14
- if (__ptr_ == nullptr)
- __cntrl_ = nullptr;
- else
-#endif
{
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
@@ -690,7 +610,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
return *this;
}
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template <class _Yp,
__enable_if_t<!is_array<_Yp>::value && is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
int> = 0>
@@ -698,7 +617,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
shared_ptr(std::move(__r)).swap(*this);
return *this;
}
-#endif
template <class _Yp,
class _Dp,
@@ -746,9 +664,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
_LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT { return __cntrl_ ? __cntrl_->use_count() : 0; }
-#if _LIBCPP_STD_VER < 20 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUE)
_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI bool unique() const _NOEXCEPT { return use_count() == 1; }
-#endif
_LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return get() != nullptr; }
@@ -764,13 +680,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
_LIBCPP_HIDE_FROM_ABI bool __owner_equivalent(const shared_ptr& __p) const { return __cntrl_ == __p.__cntrl_; }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const {
- static_assert(is_array<_Tp>::value, "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
- return __ptr_[__i];
- }
-#endif
-
#ifndef _LIBCPP_HAS_NO_RTTI
template <class _Dp>
_LIBCPP_HIDE_FROM_ABI _Dp* __get_deleter() const _NOEXCEPT {
@@ -825,13 +734,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
-template <class _Tp, class _Dp>
-shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
-#endif
-
//
// std::allocate_shared and std::make_shared
//
@@ -851,281 +753,11 @@ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(_Args&&... __args) {
return std::allocate_shared<_Tp>(allocator<__remove_cv_t<_Tp> >(), std::forward<_Args>(__args)...);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp, class _Alloc, __enable_if_t<!is_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {
- using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
- _ForOverwriteAllocator __alloc(__a);
- return std::allocate_shared<_Tp>(__alloc);
-}
-
-template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {
- return std::allocate_shared_for_overwrite<_Tp>(allocator<__remove_cv_t<_Tp>>());
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 17
-
-template <size_t _Alignment>
-struct __sp_aligned_storage {
- alignas(_Alignment) char __storage[_Alignment];
-};
-
-template <class _Tp, class _Alloc>
-struct __unbounded_array_control_block;
-
-template <class _Tp, class _Alloc>
-struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count {
- _LIBCPP_HIDE_FROM_ABI constexpr _Tp* __get_data() noexcept { return __data_; }
-
- _LIBCPP_HIDE_FROM_ABI explicit __unbounded_array_control_block(
- _Alloc const& __alloc, size_t __count, _Tp const& __arg)
- : __alloc_(__alloc), __count_(__count) {
- std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, std::begin(__data_), __count_, __arg);
- }
-
- _LIBCPP_HIDE_FROM_ABI explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count)
- : __alloc_(__alloc), __count_(__count) {
-# if _LIBCPP_STD_VER >= 20
- if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
- // We are purposefully not using an allocator-aware default construction because the spec says so.
- // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
- std::uninitialized_default_construct_n(std::begin(__data_), __count_);
- } else {
- std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::begin(__data_), __count_);
- }
-# else
- std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::begin(__data_), __count_);
-# endif
- }
-
- // Returns the number of bytes required to store a control block followed by the given number
- // of elements of _Tp, with the whole storage being aligned to a multiple of _Tp's alignment.
- _LIBCPP_HIDE_FROM_ABI static constexpr size_t __bytes_for(size_t __elements) {
- // When there's 0 elements, the control block alone is enough since it holds one element.
- // Otherwise, we allocate one fewer element than requested because the control block already
- // holds one. Also, we use the bitwise formula below to ensure that we allocate enough bytes
- // for the whole allocation to be a multiple of _Tp's alignment. That formula is taken from [1].
- //
- // [1]: https://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding
- size_t __bytes = __elements == 0 ? sizeof(__unbounded_array_control_block)
- : (__elements - 1) * sizeof(_Tp) + sizeof(__unbounded_array_control_block);
- constexpr size_t __align = alignof(_Tp);
- return (__bytes + __align - 1) & ~(__align - 1);
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL
- ~__unbounded_array_control_block() override {
- } // can't be `= default` because of the sometimes-non-trivial union member __data_
-
-private:
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
-# if _LIBCPP_STD_VER >= 20
- if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
- std::__reverse_destroy(__data_, __data_ + __count_);
- } else {
- __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
- std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + __count_);
- }
-# else
- __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
- std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + __count_);
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
- using _AlignedStorage = __sp_aligned_storage<alignof(__unbounded_array_control_block)>;
- using _StorageAlloc = __allocator_traits_rebind_t<_Alloc, _AlignedStorage>;
- using _PointerTraits = pointer_traits<typename allocator_traits<_StorageAlloc>::pointer>;
-
- _StorageAlloc __tmp(__alloc_);
- __alloc_.~_Alloc();
- size_t __size = __unbounded_array_control_block::__bytes_for(__count_);
- _AlignedStorage* __storage = reinterpret_cast<_AlignedStorage*>(this);
- allocator_traits<_StorageAlloc>::deallocate(
- __tmp, _PointerTraits::pointer_to(*__storage), __size / sizeof(_AlignedStorage));
- }
-
- _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
- size_t __count_;
- union {
- _Tp __data_[1];
- };
-};
-
-template <class _Array, class _Alloc, class... _Arg>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Array>
-__allocate_shared_unbounded_array(const _Alloc& __a, size_t __n, _Arg&&... __arg) {
- static_assert(__libcpp_is_unbounded_array<_Array>::value);
- // We compute the number of bytes necessary to hold the control block and the
- // array elements. Then, we allocate an array of properly-aligned dummy structs
- // large enough to hold the control block and array. This allows shifting the
- // burden of aligning memory properly from us to the allocator.
- using _ControlBlock = __unbounded_array_control_block<_Array, _Alloc>;
- using _AlignedStorage = __sp_aligned_storage<alignof(_ControlBlock)>;
- using _StorageAlloc = __allocator_traits_rebind_t<_Alloc, _AlignedStorage>;
- __allocation_guard<_StorageAlloc> __guard(__a, _ControlBlock::__bytes_for(__n) / sizeof(_AlignedStorage));
- _ControlBlock* __control_block = reinterpret_cast<_ControlBlock*>(std::addressof(*__guard.__get()));
- std::__construct_at(__control_block, __a, __n, std::forward<_Arg>(__arg)...);
- __guard.__release_ptr();
- return shared_ptr<_Array>::__create_with_control_block(__control_block->__get_data(), __control_block);
-}
-
-template <class _Tp, class _Alloc>
-struct __bounded_array_control_block;
-
-template <class _Tp, size_t _Count, class _Alloc>
-struct __bounded_array_control_block<_Tp[_Count], _Alloc> : __shared_weak_count {
- _LIBCPP_HIDE_FROM_ABI constexpr _Tp* __get_data() noexcept { return __data_; }
-
- _LIBCPP_HIDE_FROM_ABI explicit __bounded_array_control_block(_Alloc const& __alloc, _Tp const& __arg)
- : __alloc_(__alloc) {
- std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count, __arg);
- }
-
- _LIBCPP_HIDE_FROM_ABI explicit __bounded_array_control_block(_Alloc const& __alloc) : __alloc_(__alloc) {
-# if _LIBCPP_STD_VER >= 20
- if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
- // We are purposefully not using an allocator-aware default construction because the spec says so.
- // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
- std::uninitialized_default_construct_n(std::addressof(__data_[0]), _Count);
- } else {
- std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count);
- }
-# else
- std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count);
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL
- ~__bounded_array_control_block() override {
- } // can't be `= default` because of the sometimes-non-trivial union member __data_
-
-private:
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
-# if _LIBCPP_STD_VER >= 20
- if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
- std::__reverse_destroy(__data_, __data_ + _Count);
- } else {
- __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
- std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + _Count);
- }
-# else
- __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
- std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + _Count);
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
- using _ControlBlockAlloc = __allocator_traits_rebind_t<_Alloc, __bounded_array_control_block>;
- using _PointerTraits = pointer_traits<typename allocator_traits<_ControlBlockAlloc>::pointer>;
-
- _ControlBlockAlloc __tmp(__alloc_);
- __alloc_.~_Alloc();
- allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*this), 1);
- }
-
- _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
- union {
- _Tp __data_[_Count];
- };
-};
-
-template <class _Array, class _Alloc, class... _Arg>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Array> __allocate_shared_bounded_array(const _Alloc& __a, _Arg&&... __arg) {
- static_assert(__libcpp_is_bounded_array<_Array>::value);
- using _ControlBlock = __bounded_array_control_block<_Array, _Alloc>;
- using _ControlBlockAlloc = __allocator_traits_rebind_t<_Alloc, _ControlBlock>;
-
- __allocation_guard<_ControlBlockAlloc> __guard(__a, 1);
- _ControlBlock* __control_block = reinterpret_cast<_ControlBlock*>(std::addressof(*__guard.__get()));
- std::__construct_at(__control_block, __a, std::forward<_Arg>(__arg)...);
- __guard.__release_ptr();
- return shared_ptr<_Array>::__create_with_control_block(__control_block->__get_data(), __control_block);
-}
-
-#endif // _LIBCPP_STD_VER >= 17
-
-#if _LIBCPP_STD_VER >= 20
-
-// bounded array variants
-template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a) {
- return std::__allocate_shared_bounded_array<_Tp>(__a);
-}
-
-template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, const remove_extent_t<_Tp>& __u) {
- return std::__allocate_shared_bounded_array<_Tp>(__a, __u);
-}
-
-template <class _Tp, class _Alloc, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {
- using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
- _ForOverwriteAllocator __alloc(__a);
- return std::__allocate_shared_bounded_array<_Tp>(__alloc);
-}
-
-template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared() {
- return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>());
-}
-
-template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(const remove_extent_t<_Tp>& __u) {
- return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>(), __u);
-}
-
-template <class _Tp, __enable_if_t<is_bounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite() {
- return std::__allocate_shared_bounded_array<_Tp>(allocator<__for_overwrite_tag>());
-}
-
-// unbounded array variants
-template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n) {
- return std::__allocate_shared_unbounded_array<_Tp>(__a, __n);
-}
-
-template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n, const remove_extent_t<_Tp>& __u) {
- return std::__allocate_shared_unbounded_array<_Tp>(__a, __n, __u);
-}
-
-template <class _Tp, class _Alloc, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a, size_t __n) {
- using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
- _ForOverwriteAllocator __alloc(__a);
- return std::__allocate_shared_unbounded_array<_Tp>(__alloc, __n);
-}
-
-template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n) {
- return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n);
-}
-
-template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared(size_t __n, const remove_extent_t<_Tp>& __u) {
- return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n, __u);
-}
-
-template <class _Tp, __enable_if_t<is_unbounded_array<_Tp>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> make_shared_for_overwrite(size_t __n) {
- return std::__allocate_shared_unbounded_array<_Tp>(allocator<__for_overwrite_tag>(), __n);
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT {
return __x.get() == __y.get();
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT {
return !(__x == __y);
@@ -1133,12 +765,8 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const shared_ptr<_Tp>& __x, const s
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT {
-# if _LIBCPP_STD_VER <= 11
typedef typename common_type<_Tp*, _Up*>::type _Vp;
return less<_Vp>()(__x.get(), __y.get());
-# else
- return less<>()(__x.get(), __y.get());
-# endif
}
template <class _Tp, class _Up>
@@ -1156,22 +784,11 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const shared_ptr<_Tp>& __x, const s
return !(__x < __y);
}
-#endif // _LIBCPP_STD_VER <= 17
-
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Up>
-_LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) noexcept {
- return compare_three_way()(__x.get(), __y.get());
-}
-#endif
-
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT {
return !__x;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT {
return !__x;
@@ -1227,15 +844,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator>=(nullptr_t, const shared_ptr<_Tp>& _
return !(nullptr < __x);
}
-#endif // _LIBCPP_STD_VER <= 17
-
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(shared_ptr<_Tp> const& __x, nullptr_t) noexcept {
- return compare_three_way()(__x.get(), static_cast<typename shared_ptr<_Tp>::element_type*>(nullptr));
-}
-#endif
-
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI void swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT {
__x.swap(__y);
@@ -1246,15 +854,6 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(const shared_pt
return shared_ptr<_Tp>(__r, static_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));
}
-// LWG-2996
-// We don't backport because it is an evolutionary change.
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Up>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
- return shared_ptr<_Tp>(std::move(__r), static_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
-}
-#endif
-
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
typedef typename shared_ptr<_Tp>::element_type _ET;
@@ -1262,45 +861,17 @@ inline _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(const shared_p
return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
}
-// LWG-2996
-// We don't backport because it is an evolutionary change.
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Up>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
- auto* __p = dynamic_cast<typename shared_ptr<_Tp>::element_type*>(__r.get());
- return __p ? shared_ptr<_Tp>(std::move(__r), __p) : shared_ptr<_Tp>();
-}
-#endif
-
template <class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
typedef typename shared_ptr<_Tp>::element_type _RTp;
return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
}
-// LWG-2996
-// We don't backport because it is an evolutionary change.
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Up>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
- return shared_ptr<_Tp>(std::move(__r), const_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
-}
-#endif
-
template <class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT {
return shared_ptr<_Tp>(__r, reinterpret_cast< typename shared_ptr<_Tp>::element_type*>(__r.get()));
}
-// LWG-2996
-// We don't backport because it is an evolutionary change.
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Up>
-_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
- return shared_ptr<_Tp>(std::move(__r), reinterpret_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
-}
-#endif
-
#ifndef _LIBCPP_HAS_NO_RTTI
template <class _Dp, class _Tp>
@@ -1313,11 +884,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Dp* get_deleter(const shared_ptr<_Tp>& __p) _NOEXC
template <class _Tp>
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr {
public:
-#if _LIBCPP_STD_VER >= 17
- typedef remove_extent_t<_Tp> element_type;
-#else
typedef _Tp element_type;
-#endif
// A weak_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require
// any bookkeeping, so it's always trivially relocatable.
@@ -1377,11 +944,6 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr {
friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
-#endif
-
template <class _Tp>
inline _LIBCPP_CONSTEXPR weak_ptr<_Tp>::weak_ptr() _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
@@ -1483,13 +1045,8 @@ shared_ptr<_Tp> weak_ptr<_Tp>::lock() const _NOEXCEPT {
return __r;
}
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp = void>
-struct owner_less;
-#else
template <class _Tp>
struct owner_less;
-#endif
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> > : __binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool> {
@@ -1517,29 +1074,6 @@ struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> > : __binary_function<weak_
}
};
-#if _LIBCPP_STD_VER >= 17
-template <>
-struct _LIBCPP_TEMPLATE_VIS owner_less<void> {
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT {
- return __x.owner_before(__y);
- }
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT {
- return __x.owner_before(__y);
- }
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI bool operator()(weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT {
- return __x.owner_before(__y);
- }
- template <class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI bool operator()(weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT {
- return __x.owner_before(__y);
- }
- typedef void is_transparent;
-};
-#endif
-
template <class _Tp>
class _LIBCPP_TEMPLATE_VIS enable_shared_from_this {
mutable weak_ptr<_Tp> __weak_this_;
@@ -1554,12 +1088,6 @@ class _LIBCPP_TEMPLATE_VIS enable_shared_from_this {
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> shared_from_this() { return shared_ptr<_Tp>(__weak_this_); }
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp const> shared_from_this() const { return shared_ptr<const _Tp>(__weak_this_); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI weak_ptr<_Tp> weak_from_this() _NOEXCEPT { return __weak_this_; }
-
- _LIBCPP_HIDE_FROM_ABI weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT { return __weak_this_; }
-#endif // _LIBCPP_STD_VER >= 17
-
template <class _Up>
friend class shared_ptr;
};
@@ -1569,10 +1097,8 @@ struct _LIBCPP_TEMPLATE_VIS hash;
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> > {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
_LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> argument_type;
_LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
-#endif
_LIBCPP_HIDE_FROM_ABI size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT {
return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());
diff --git a/libcxx/include/__cxx03/__memory/swap_allocator.h b/libcxx/include/__cxx03/__memory/swap_allocator.h
index 2986da7365732..7b82cef75e38a 100644
--- a/libcxx/include/__cxx03/__memory/swap_allocator.h
+++ b/libcxx/include/__cxx03/__memory/swap_allocator.h
@@ -23,11 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <typename _Alloc>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2, true_type)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(__is_nothrow_swappable_v<_Alloc>)
-#endif
{
using std::swap;
swap(__a1, __a2);
@@ -39,11 +35,7 @@ __swap_allocator(_Alloc&, _Alloc&, false_type) _NOEXCEPT {}
template <typename _Alloc>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(__is_nothrow_swappable_v<_Alloc>)
-#endif
{
std::__swap_allocator(
__a1, __a2, integral_constant<bool, allocator_traits<_Alloc>::propagate_on_container_swap::value>());
diff --git a/libcxx/include/__cxx03/__memory/temp_value.h b/libcxx/include/__cxx03/__memory/temp_value.h
index b777c66187bd0..159f6a1df4066 100644
--- a/libcxx/include/__cxx03/__memory/temp_value.h
+++ b/libcxx/include/__cxx03/__memory/temp_value.h
@@ -25,21 +25,11 @@ template <class _Tp, class _Alloc>
struct __temp_value {
typedef allocator_traits<_Alloc> _Traits;
-#ifdef _LIBCPP_CXX03_LANG
typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
-#else
- union {
- _Tp __v;
- };
-#endif
_Alloc& __a;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __addr() {
-#ifdef _LIBCPP_CXX03_LANG
return reinterpret_cast<_Tp*>(std::addressof(__v));
-#else
- return std::addressof(__v);
-#endif
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& get() { return *__addr(); }
diff --git a/libcxx/include/__cxx03/__memory/uninitialized_algorithms.h b/libcxx/include/__cxx03/__memory/uninitialized_algorithms.h
index 7a7cc64f08ab3..ff9223d345b29 100644
--- a/libcxx/include/__cxx03/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__cxx03/__memory/uninitialized_algorithms.h
@@ -169,347 +169,6 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
return std::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
}
-#if _LIBCPP_STD_VER >= 17
-
-// uninitialized_default_construct
-
-template <class _ValueType, class _ForwardIterator, class _Sentinel>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
-__uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
- auto __idx = __first;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __idx != __last; ++__idx)
- ::new (std::__voidify(*__idx)) _ValueType;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__first, __idx);
- throw;
- }
-# endif
-
- return __idx;
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- (void)std::__uninitialized_default_construct<_ValueType>(std::move(__first), std::move(__last));
-}
-
-// uninitialized_default_construct_n
-
-template <class _ValueType, class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
- auto __idx = __first;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __n > 0; ++__idx, (void)--__n)
- ::new (std::__voidify(*__idx)) _ValueType;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__first, __idx);
- throw;
- }
-# endif
-
- return __idx;
-}
-
-template <class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- return std::__uninitialized_default_construct_n<_ValueType>(std::move(__first), __n);
-}
-
-// uninitialized_value_construct
-
-template <class _ValueType, class _ForwardIterator, class _Sentinel>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
-__uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
- auto __idx = __first;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __idx != __last; ++__idx)
- ::new (std::__voidify(*__idx)) _ValueType();
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__first, __idx);
- throw;
- }
-# endif
-
- return __idx;
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- (void)std::__uninitialized_value_construct<_ValueType>(std::move(__first), std::move(__last));
-}
-
-// uninitialized_value_construct_n
-
-template <class _ValueType, class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
- auto __idx = __first;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __n > 0; ++__idx, (void)--__n)
- ::new (std::__voidify(*__idx)) _ValueType();
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__first, __idx);
- throw;
- }
-# endif
-
- return __idx;
-}
-
-template <class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- return std::__uninitialized_value_construct_n<_ValueType>(std::move(__first), __n);
-}
-
-// uninitialized_move
-
-template <class _ValueType,
- class _InputIterator,
- class _Sentinel1,
- class _ForwardIterator,
- class _EndPredicate,
- class _IterMove>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move(
- _InputIterator __ifirst,
- _Sentinel1 __ilast,
- _ForwardIterator __ofirst,
- _EndPredicate __stop_moving,
- _IterMove __iter_move) {
- auto __idx = __ofirst;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {
- ::new (std::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
- }
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__ofirst, __idx);
- throw;
- }
-# endif
-
- return {std::move(__ifirst), std::move(__idx)};
-}
-
-template <class _InputIterator, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator
-uninitialized_move(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::move(*__iter); };
-
- auto __result = std::__uninitialized_move<_ValueType>(
- std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __always_false(), __iter_move);
- return std::move(__result.second);
-}
-
-// uninitialized_move_n
-
-template <class _ValueType,
- class _InputIterator,
- class _Size,
- class _ForwardIterator,
- class _EndPredicate,
- class _IterMove>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move_n(
- _InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_moving, _IterMove __iter_move) {
- auto __idx = __ofirst;
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- for (; __n > 0 && !__stop_moving(__idx); ++__idx, (void)++__ifirst, --__n)
- ::new (std::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- std::__destroy(__ofirst, __idx);
- throw;
- }
-# endif
-
- return {std::move(__ifirst), std::move(__idx)};
-}
-
-template <class _InputIterator, class _Size, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
-uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {
- using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
- auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::move(*__iter); };
-
- return std::__uninitialized_move_n<_ValueType>(
- std::move(__ifirst), __n, std::move(__ofirst), __always_false(), __iter_move);
-}
-
-// TODO: Rewrite this to iterate left to right and use reverse_iterators when calling
-// Destroys every element in the range [first, last) FROM RIGHT TO LEFT using allocator
-// destruction. If elements are themselves C-style arrays, they are recursively destroyed
-// in the same manner.
-//
-// This function assumes that destructors do not throw, and that the allocator is bound to
-// the correct type.
-template <class _Alloc,
- class _BidirIter,
- __enable_if_t<__has_bidirectional_iterator_category<_BidirIter>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter __first, _BidirIter __last) noexcept {
- using _ValueType = typename iterator_traits<_BidirIter>::value_type;
- static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _ValueType>,
- "The allocator should already be rebound to the correct type");
-
- if (__first == __last)
- return;
-
- if constexpr (is_array_v<_ValueType>) {
- static_assert(!__libcpp_is_unbounded_array<_ValueType>::value,
- "arrays of unbounded arrays don't exist, but if they did we would mess up here");
-
- using _Element = remove_extent_t<_ValueType>;
- __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
- do {
- --__last;
- decltype(auto) __array = *__last;
- std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + extent_v<_ValueType>);
- } while (__last != __first);
- } else {
- do {
- --__last;
- allocator_traits<_Alloc>::destroy(__alloc, std::addressof(*__last));
- } while (__last != __first);
- }
-}
-
-// Constructs the object at the given location using the allocator's construct method.
-//
-// If the object being constructed is an array, each element of the array is allocator-constructed,
-// recursively. If an exception is thrown during the construction of an array, the initialized
-// elements are destroyed in reverse order of initialization using allocator destruction.
-//
-// This function assumes that the allocator is bound to the correct type.
-template <class _Alloc, class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc) {
- static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
- "The allocator should already be rebound to the correct type");
-
- if constexpr (is_array_v<_Tp>) {
- using _Element = remove_extent_t<_Tp>;
- __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
- size_t __i = 0;
- _Tp& __array = *__loc;
-
- // If an exception is thrown, destroy what we have constructed so far in reverse order.
- auto __guard = std::__make_exception_guard([&]() {
- std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
- });
-
- for (; __i != extent_v<_Tp>; ++__i) {
- std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]));
- }
- __guard.__complete();
- } else {
- allocator_traits<_Alloc>::construct(__alloc, __loc);
- }
-}
-
-// Constructs the object at the given location using the allocator's construct method, passing along
-// the provided argument.
-//
-// If the object being constructed is an array, the argument is also assumed to be an array. Each
-// each element of the array being constructed is allocator-constructed from the corresponding
-// element of the argument array. If an exception is thrown during the construction of an array,
-// the initialized elements are destroyed in reverse order of initialization using allocator
-// destruction.
-//
-// This function assumes that the allocator is bound to the correct type.
-template <class _Alloc, class _Tp, class _Arg>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
- static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
- "The allocator should already be rebound to the correct type");
-
- if constexpr (is_array_v<_Tp>) {
- static_assert(is_array_v<_Arg>,
- "Provided non-array initialization argument to __allocator_construct_at_multidimensional when "
- "trying to construct an array.");
-
- using _Element = remove_extent_t<_Tp>;
- __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
- size_t __i = 0;
- _Tp& __array = *__loc;
-
- // If an exception is thrown, destroy what we have constructed so far in reverse order.
- auto __guard = std::__make_exception_guard([&]() {
- std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
- });
- for (; __i != extent_v<_Tp>; ++__i) {
- std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]), __arg[__i]);
- }
- __guard.__complete();
- } else {
- allocator_traits<_Alloc>::construct(__alloc, __loc, __arg);
- }
-}
-
-// Given a range starting at it and containing n elements, initializes each element in the
-// range from left to right using the construct method of the allocator (rebound to the
-// correct type).
-//
-// If an exception is thrown, the initialized elements are destroyed in reverse order of
-// initialization using allocator_traits destruction. If the elements in the range are C-style
-// arrays, they are initialized element-wise using allocator construction, and recursively so.
-template <class _Alloc,
- class _BidirIter,
- class _Tp,
- class _Size = typename iterator_traits<_BidirIter>::difference_type>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__uninitialized_allocator_fill_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
- using _ValueType = typename iterator_traits<_BidirIter>::value_type;
- __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
- _BidirIter __begin = __it;
-
- // If an exception is thrown, destroy what we have constructed so far in reverse order.
- auto __guard =
- std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
- for (; __n != 0; --__n, ++__it) {
- std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it), __value);
- }
- __guard.__complete();
-}
-
-// Same as __uninitialized_allocator_fill_n_multidimensional, but doesn't pass any initialization argument
-// to the allocator's construct method, which results in value initialization.
-template <class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::difference_type>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__uninitialized_allocator_value_construct_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n) {
- using _ValueType = typename iterator_traits<_BidirIter>::value_type;
- __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
- _BidirIter __begin = __it;
-
- // If an exception is thrown, destroy what we have constructed so far in reverse order.
- auto __guard =
- std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
- for (; __n != 0; --__n, ++__it) {
- std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it));
- }
- __guard.__complete();
-}
-
-#endif // _LIBCPP_STD_VER >= 17
-
// Destroy all elements in [__first, __last) from left to right using allocator destruction.
template <class _Alloc, class _Iter, class _Sent>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
diff --git a/libcxx/include/__cxx03/__memory/unique_ptr.h b/libcxx/include/__cxx03/__memory/unique_ptr.h
index 415b002997591..3d4512ac9ab05 100644
--- a/libcxx/include/__cxx03/__memory/unique_ptr.h
+++ b/libcxx/include/__cxx03/__memory/unique_ptr.h
@@ -52,25 +52,10 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Ptr>
-struct __is_noexcept_deref_or_void {
- static constexpr bool value = noexcept(*std::declval<_Ptr>());
-};
-
-template <>
-struct __is_noexcept_deref_or_void<void*> : true_type {};
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS default_delete {
static_assert(!is_function<_Tp>::value, "default_delete cannot be instantiated for function types");
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI constexpr default_delete() _NOEXCEPT = default;
-#else
_LIBCPP_HIDE_FROM_ABI default_delete() {}
-#endif
template <class _Up, __enable_if_t<is_convertible<_Up*, _Tp*>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 default_delete(const default_delete<_Up>&) _NOEXCEPT {}
@@ -88,11 +73,7 @@ struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
struct _EnableIfConvertible : enable_if<is_convertible<_Up (*)[], _Tp (*)[]>::value> {};
public:
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI constexpr default_delete() _NOEXCEPT = default;
-#else
_LIBCPP_HIDE_FROM_ABI default_delete() {}
-#endif
template <class _Up>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -222,11 +203,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
: __ptr_(__u.release(), std::forward<_Ep>(__u.get_deleter())) {}
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template <class _Up,
__enable_if_t<is_convertible<_Up*, _Tp*>::value && is_same<_Dp, default_delete<_Tp> >::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI unique_ptr(auto_ptr<_Up>&& __p) _NOEXCEPT : __ptr_(__p.release(), __value_init_tag()) {}
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
reset(__u.release());
@@ -244,19 +223,15 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
return *this;
}
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template <class _Up,
__enable_if_t<is_convertible<_Up*, _Tp*>::value && is_same<_Dp, default_delete<_Tp> >::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI unique_ptr& operator=(auto_ptr<_Up> __p) {
reset(__p.release());
return *this;
}
-#endif
-#ifdef _LIBCPP_CXX03_LANG
unique_ptr(unique_ptr const&) = delete;
unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
@@ -434,10 +409,8 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
return *this;
}
-#ifdef _LIBCPP_CXX03_LANG
unique_ptr(unique_ptr const&) = delete;
unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
@@ -497,12 +470,10 @@ operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {
return __x.get() == __y.get();
}
-#if _LIBCPP_STD_VER <= 17
template <class _T1, class _D1, class _T2, class _D2>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {
return !(__x == __y);
}
-#endif
template <class _T1, class _D1, class _T2, class _D2>
inline _LIBCPP_HIDE_FROM_ABI bool operator<(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {
@@ -527,23 +498,12 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const unique_ptr<_T1, _D1>& __x, co
return !(__x < __y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _T1, class _D1, class _T2, class _D2>
- requires three_way_comparable_with<typename unique_ptr<_T1, _D1>::pointer, typename unique_ptr<_T2, _D2>::pointer>
-_LIBCPP_HIDE_FROM_ABI
-compare_three_way_result_t<typename unique_ptr<_T1, _D1>::pointer, typename unique_ptr<_T2, _D2>::pointer>
-operator<=>(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {
- return compare_three_way()(__x.get(), __y.get());
-}
-#endif
-
template <class _T1, class _D1>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT {
return !__x;
}
-#if _LIBCPP_STD_VER <= 17
template <class _T1, class _D1>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT {
return !__x;
@@ -558,7 +518,6 @@ template <class _T1, class _D1>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT {
return static_cast<bool>(__x);
}
-#endif // _LIBCPP_STD_VER <= 17
template <class _T1, class _D1>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t) {
@@ -602,83 +561,13 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator>=(nullp
return !(nullptr < __x);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _T1, class _D1>
- requires three_way_comparable< typename unique_ptr<_T1, _D1>::pointer>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 compare_three_way_result_t<typename unique_ptr<_T1, _D1>::pointer>
-operator<=>(const unique_ptr<_T1, _D1>& __x, nullptr_t) {
- return compare_three_way()(__x.get(), static_cast<typename unique_ptr<_T1, _D1>::pointer>(nullptr));
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-
-template <class _Tp>
-struct __unique_if {
- typedef unique_ptr<_Tp> __unique_single;
-};
-
-template <class _Tp>
-struct __unique_if<_Tp[]> {
- typedef unique_ptr<_Tp[]> __unique_array_unknown_bound;
-};
-
-template <class _Tp, size_t _Np>
-struct __unique_if<_Tp[_Np]> {
- typedef void __unique_array_known_bound;
-};
-
-template <class _Tp, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_single
-make_unique(_Args&&... __args) {
- return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
-}
-
-template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_array_unknown_bound
-make_unique(size_t __n) {
- typedef __remove_extent_t<_Tp> _Up;
- return unique_ptr<_Tp>(new _Up[__n]());
-}
-
-template <class _Tp, class... _Args>
-typename __unique_if<_Tp>::__unique_array_known_bound make_unique(_Args&&...) = delete;
-
-#endif // _LIBCPP_STD_VER >= 14
-
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_single
-make_unique_for_overwrite() {
- return unique_ptr<_Tp>(new _Tp);
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_array_unknown_bound
-make_unique_for_overwrite(size_t __n) {
- return unique_ptr<_Tp>(new __remove_extent_t<_Tp>[__n]);
-}
-
-template <class _Tp, class... _Args>
-typename __unique_if<_Tp>::__unique_array_known_bound make_unique_for_overwrite(_Args&&...) = delete;
-
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS hash;
template <class _Tp, class _Dp>
-#ifdef _LIBCPP_CXX03_LANG
-struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
-#else
-struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper< unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> >
-#endif
-{
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> > {
_LIBCPP_DEPRECATED_IN_CXX17 typedef unique_ptr<_Tp, _Dp> argument_type;
_LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
-#endif
_LIBCPP_HIDE_FROM_ABI size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const {
typedef typename unique_ptr<_Tp, _Dp>::pointer pointer;
diff --git a/libcxx/include/__cxx03/__memory/uses_allocator.h b/libcxx/include/__cxx03/__memory/uses_allocator.h
index 4fb6651c68b1d..fbeb675acd510 100644
--- a/libcxx/include/__cxx03/__memory/uses_allocator.h
+++ b/libcxx/include/__cxx03/__memory/uses_allocator.h
@@ -42,11 +42,6 @@ struct __uses_allocator<_Tp, _Alloc, false> : public false_type {};
template <class _Tp, class _Alloc>
struct _LIBCPP_TEMPLATE_VIS uses_allocator : public __uses_allocator<_Tp, _Alloc> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Alloc>
-inline constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MEMORY_USES_ALLOCATOR_H
diff --git a/libcxx/include/__cxx03/__mutex/once_flag.h b/libcxx/include/__cxx03/__mutex/once_flag.h
index 73c2017f36854..015511959f6c3 100644
--- a/libcxx/include/__cxx03/__mutex/once_flag.h
+++ b/libcxx/include/__cxx03/__mutex/once_flag.h
@@ -17,9 +17,6 @@
#include <__cxx03/__utility/forward.h>
#include <__cxx03/__utility/move.h>
#include <__cxx03/cstdint>
-#ifndef _LIBCPP_CXX03_LANG
-# include <__cxx03/tuple>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -32,21 +29,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
struct _LIBCPP_TEMPLATE_VIS once_flag;
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Callable, class... _Args>
-_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, _Callable&&, _Args&&...);
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _Callable>
_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, _Callable&);
template <class _Callable>
_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_CXX03_LANG
-
struct _LIBCPP_TEMPLATE_VIS once_flag {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR once_flag() _NOEXCEPT : __state_(_Unset) {}
once_flag(const once_flag&) = delete;
@@ -65,41 +53,13 @@ struct _LIBCPP_TEMPLATE_VIS once_flag {
private:
_State_type __state_;
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Callable, class... _Args>
- friend void call_once(once_flag&, _Callable&&, _Args&&...);
-#else // _LIBCPP_CXX03_LANG
template <class _Callable>
friend void call_once(once_flag&, _Callable&);
template <class _Callable>
friend void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_CXX03_LANG
-};
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Fp>
-class __call_once_param {
- _Fp& __f_;
-
-public:
- _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {}
-
- _LIBCPP_HIDE_FROM_ABI void operator()() {
- typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
- __execute(_Index());
- }
-
-private:
- template <size_t... _Indices>
- _LIBCPP_HIDE_FROM_ABI void __execute(__tuple_indices<_Indices...>) {
- std::__invoke(std::get<0>(std::move(__f_)), std::get<_Indices>(std::move(__f_))...);
- }
};
-#else
-
template <class _Fp>
class __call_once_param {
_Fp& __f_;
@@ -110,8 +70,6 @@ class __call_once_param {
_LIBCPP_HIDE_FROM_ABI void operator()() { __f_(); }
};
-#endif
-
template <class _Fp>
void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
__call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp);
@@ -120,20 +78,6 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Callable, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) {
- if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) {
- typedef tuple<_Callable&&, _Args&&...> _Gp;
- _Gp __f(std::forward<_Callable>(__func), std::forward<_Args>(__args)...);
- __call_once_param<_Gp> __p(__f);
- std::__call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
- }
-}
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _Callable>
inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable& __func) {
if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) {
@@ -150,8 +94,6 @@ inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, const _Callable&
}
}
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__mutex/tag_types.h b/libcxx/include/__cxx03/__mutex/tag_types.h
index 7beb58dabc913..5962e1208d73e 100644
--- a/libcxx/include/__cxx03/__mutex/tag_types.h
+++ b/libcxx/include/__cxx03/__mutex/tag_types.h
@@ -29,16 +29,6 @@ struct _LIBCPP_EXPORTED_FROM_ABI adopt_lock_t {
explicit adopt_lock_t() = default;
};
-#if _LIBCPP_STD_VER >= 17
-inline constexpr defer_lock_t defer_lock = defer_lock_t();
-inline constexpr try_to_lock_t try_to_lock = try_to_lock_t();
-inline constexpr adopt_lock_t adopt_lock = adopt_lock_t();
-#elif !defined(_LIBCPP_CXX03_LANG)
-constexpr defer_lock_t defer_lock = defer_lock_t();
-constexpr try_to_lock_t try_to_lock = try_to_lock_t();
-constexpr adopt_lock_t adopt_lock = adopt_lock_t();
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___MUTEX_TAG_TYPES_H
diff --git a/libcxx/include/__cxx03/__numeric/accumulate.h b/libcxx/include/__cxx03/__numeric/accumulate.h
index 28309201bb060..3ac3419201442 100644
--- a/libcxx/include/__cxx03/__numeric/accumulate.h
+++ b/libcxx/include/__cxx03/__numeric/accumulate.h
@@ -26,11 +26,7 @@ template <class _InputIterator, class _Tp>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) {
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER >= 20
- __init = std::move(__init) + *__first;
-#else
__init = __init + *__first;
-#endif
return __init;
}
@@ -38,11 +34,7 @@ template <class _InputIterator, class _Tp, class _BinaryOperation>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) {
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER >= 20
- __init = __binary_op(std::move(__init), *__first);
-#else
__init = __binary_op(__init, *__first);
-#endif
return __init;
}
diff --git a/libcxx/include/__cxx03/__numeric/adjacent_difference.h b/libcxx/include/__cxx03/__numeric/adjacent_difference.h
index ec7ba7c27f854..4fd33cabde8aa 100644
--- a/libcxx/include/__cxx03/__numeric/adjacent_difference.h
+++ b/libcxx/include/__cxx03/__numeric/adjacent_difference.h
@@ -31,11 +31,7 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat
*__result = __acc;
for (++__first, (void)++__result; __first != __last; ++__first, (void)++__result) {
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER >= 20
- *__result = __val - std::move(__acc);
-#else
*__result = __val - __acc;
-#endif
__acc = std::move(__val);
}
}
@@ -50,11 +46,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator adjacent_dif
*__result = __acc;
for (++__first, (void)++__result; __first != __last; ++__first, (void)++__result) {
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER >= 20
- *__result = __binary_op(__val, std::move(__acc));
-#else
*__result = __binary_op(__val, __acc);
-#endif
__acc = std::move(__val);
}
}
diff --git a/libcxx/include/__cxx03/__numeric/inner_product.h b/libcxx/include/__cxx03/__numeric/inner_product.h
index 12615c3e02136..0d8483a836fba 100644
--- a/libcxx/include/__cxx03/__numeric/inner_product.h
+++ b/libcxx/include/__cxx03/__numeric/inner_product.h
@@ -26,11 +26,7 @@ template <class _InputIterator1, class _InputIterator2, class _Tp>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) {
for (; __first1 != __last1; ++__first1, (void)++__first2)
-#if _LIBCPP_STD_VER >= 20
- __init = std::move(__init) + *__first1 * *__first2;
-#else
__init = __init + *__first1 * *__first2;
-#endif
return __init;
}
@@ -43,11 +39,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp inner_product(
_BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2) {
for (; __first1 != __last1; ++__first1, (void)++__first2)
-#if _LIBCPP_STD_VER >= 20
- __init = __binary_op1(std::move(__init), __binary_op2(*__first1, *__first2));
-#else
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
-#endif
return __init;
}
diff --git a/libcxx/include/__cxx03/__numeric/partial_sum.h b/libcxx/include/__cxx03/__numeric/partial_sum.h
index 8dead17f1a5d1..da540fa34dc8e 100644
--- a/libcxx/include/__cxx03/__numeric/partial_sum.h
+++ b/libcxx/include/__cxx03/__numeric/partial_sum.h
@@ -30,11 +30,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
typename iterator_traits<_InputIterator>::value_type __t(*__first);
*__result = __t;
for (++__first, (void)++__result; __first != __last; ++__first, (void)++__result) {
-#if _LIBCPP_STD_VER >= 20
- __t = std::move(__t) + *__first;
-#else
__t = __t + *__first;
-#endif
*__result = __t;
}
}
@@ -48,11 +44,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
typename iterator_traits<_InputIterator>::value_type __t(*__first);
*__result = __t;
for (++__first, (void)++__result; __first != __last; ++__first, (void)++__result) {
-#if _LIBCPP_STD_VER >= 20
- __t = __binary_op(std::move(__t), *__first);
-#else
__t = __binary_op(__t, *__first);
-#endif
*__result = __t;
}
}
diff --git a/libcxx/include/__cxx03/__ostream/basic_ostream.h b/libcxx/include/__cxx03/__ostream/basic_ostream.h
index 593ddc501c050..0d364d449058d 100644
--- a/libcxx/include/__cxx03/__ostream/basic_ostream.h
+++ b/libcxx/include/__cxx03/__ostream/basic_ostream.h
@@ -99,20 +99,8 @@ class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Tra
basic_ostream& operator<<(long double __f);
basic_ostream& operator<<(const void* __p);
-#if _LIBCPP_STD_VER >= 23
- _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(const volatile void* __p) {
- return operator<<(const_cast<const void*>(__p));
- }
-#endif
-
basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
-#if _LIBCPP_STD_VER >= 17
- // LWG 2221 - nullptr. This is not backported to older standards modes.
- // See https://reviews.llvm.org/D127033 for more info on the rationale.
- _LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(nullptr_t) { return *this << "nullptr"; }
-#endif
-
// 27.7.2.7 Unformatted output:
basic_ostream& put(char_type __c);
basic_ostream& write(const char_type* __s, streamsize __n);
@@ -797,57 +785,6 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) {
std::use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-#if _LIBCPP_STD_VER >= 20
-
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
-
-# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-
-# ifndef _LIBCPP_HAS_NO_CHAR8_T
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete;
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete;
-
-template <class _Traits>
-basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete;
-# endif
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete;
-
-template <class _Traits>
-basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
-
-#endif // _LIBCPP_STD_VER >= 20
-
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
diff --git a/libcxx/include/__cxx03/__random/bernoulli_distribution.h b/libcxx/include/__cxx03/__random/bernoulli_distribution.h
index 3c35e8c39e237..618bda9e09656 100644
--- a/libcxx/include/__cxx03/__random/bernoulli_distribution.h
+++ b/libcxx/include/__cxx03/__random/bernoulli_distribution.h
@@ -49,12 +49,7 @@ class _LIBCPP_TEMPLATE_VIS bernoulli_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI bernoulli_distribution() : bernoulli_distribution(0.5) {}
- _LIBCPP_HIDE_FROM_ABI explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/binomial_distribution.h b/libcxx/include/__cxx03/__random/binomial_distribution.h
index 5b703749fc7d1..7680f0ef2cfaa 100644
--- a/libcxx/include/__cxx03/__random/binomial_distribution.h
+++ b/libcxx/include/__cxx03/__random/binomial_distribution.h
@@ -60,14 +60,8 @@ class _LIBCPP_TEMPLATE_VIS binomial_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI binomial_distribution() : binomial_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit binomial_distribution(result_type __t, double __p = 0.5)
- : __p_(param_type(__t, __p)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit binomial_distribution(result_type __t = 1, double __p = 0.5)
: __p_(param_type(__t, __p)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit binomial_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/cauchy_distribution.h b/libcxx/include/__cxx03/__random/cauchy_distribution.h
index cbec0b6f85554..0c6f652b1a4d9 100644
--- a/libcxx/include/__cxx03/__random/cauchy_distribution.h
+++ b/libcxx/include/__cxx03/__random/cauchy_distribution.h
@@ -57,14 +57,8 @@ class _LIBCPP_TEMPLATE_VIS cauchy_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI cauchy_distribution() : cauchy_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit cauchy_distribution(result_type __a, result_type __b = 1)
- : __p_(param_type(__a, __b)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit cauchy_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/chi_squared_distribution.h b/libcxx/include/__cxx03/__random/chi_squared_distribution.h
index 531c3204130d5..3e502b601f641 100644
--- a/libcxx/include/__cxx03/__random/chi_squared_distribution.h
+++ b/libcxx/include/__cxx03/__random/chi_squared_distribution.h
@@ -54,12 +54,7 @@ class _LIBCPP_TEMPLATE_VIS chi_squared_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI chi_squared_distribution() : chi_squared_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit chi_squared_distribution(result_type __n) : __p_(param_type(__n)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit chi_squared_distribution(result_type __n = 1) : __p_(param_type(__n)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit chi_squared_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/discard_block_engine.h b/libcxx/include/__cxx03/__random/discard_block_engine.h
index 43027f103a635..15bdbbbd5934f 100644
--- a/libcxx/include/__cxx03/__random/discard_block_engine.h
+++ b/libcxx/include/__cxx03/__random/discard_block_engine.h
@@ -34,9 +34,6 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine {
static_assert(0 < __r, "discard_block_engine invalid parameters");
static_assert(__r <= __p, "discard_block_engine invalid parameters");
-#ifndef _LIBCPP_CXX03_LANG // numeric_limits::max() is not constexpr in C++03
- static_assert(__r <= numeric_limits<int>::max(), "discard_block_engine invalid parameters");
-#endif
public:
// types
@@ -46,13 +43,8 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine {
static _LIBCPP_CONSTEXPR const size_t block_size = __p;
static _LIBCPP_CONSTEXPR const size_t used_block = __r;
-#ifdef _LIBCPP_CXX03_LANG
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
-#else
- static constexpr result_type _Min = _Engine::min();
- static constexpr result_type _Max = _Engine::max();
-#endif
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
@@ -60,9 +52,6 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine {
// constructors and seeding functions
_LIBCPP_HIDE_FROM_ABI discard_block_engine() : __n_(0) {}
_LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(const _Engine& __e) : __e_(__e), __n_(0) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Engine&& __e) : __e_(std::move(__e)), __n_(0) {}
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
template <
class _Sseq,
diff --git a/libcxx/include/__cxx03/__random/discrete_distribution.h b/libcxx/include/__cxx03/__random/discrete_distribution.h
index b24948050c65c..8a0ea91be0fe7 100644
--- a/libcxx/include/__cxx03/__random/discrete_distribution.h
+++ b/libcxx/include/__cxx03/__random/discrete_distribution.h
@@ -46,9 +46,6 @@ class _LIBCPP_TEMPLATE_VIS discrete_distribution {
_LIBCPP_HIDE_FROM_ABI param_type(_InputIterator __f, _InputIterator __l) : __p_(__f, __l) {
__init();
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI param_type(initializer_list<double> __wl) : __p_(__wl.begin(), __wl.end()) { __init(); }
-#endif // _LIBCPP_CXX03_LANG
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw);
@@ -81,9 +78,6 @@ class _LIBCPP_TEMPLATE_VIS discrete_distribution {
_LIBCPP_HIDE_FROM_ABI discrete_distribution() {}
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI discrete_distribution(_InputIterator __f, _InputIterator __l) : __p_(__f, __l) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI discrete_distribution(initializer_list<double> __wl) : __p_(__wl) {}
-#endif // _LIBCPP_CXX03_LANG
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI discrete_distribution(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw)
: __p_(__nw, __xmin, __xmax, __fw) {}
diff --git a/libcxx/include/__cxx03/__random/exponential_distribution.h b/libcxx/include/__cxx03/__random/exponential_distribution.h
index d11a6672153bd..83ef15580c0ef 100644
--- a/libcxx/include/__cxx03/__random/exponential_distribution.h
+++ b/libcxx/include/__cxx03/__random/exponential_distribution.h
@@ -56,12 +56,7 @@ class _LIBCPP_TEMPLATE_VIS exponential_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI exponential_distribution() : exponential_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit exponential_distribution(result_type __lambda) : __p_(param_type(__lambda)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit exponential_distribution(result_type __lambda = 1) : __p_(param_type(__lambda)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit exponential_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/extreme_value_distribution.h b/libcxx/include/__cxx03/__random/extreme_value_distribution.h
index 4207e79cdd569..40ca57b6f313e 100644
--- a/libcxx/include/__cxx03/__random/extreme_value_distribution.h
+++ b/libcxx/include/__cxx03/__random/extreme_value_distribution.h
@@ -57,14 +57,8 @@ class _LIBCPP_TEMPLATE_VIS extreme_value_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI extreme_value_distribution() : extreme_value_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit extreme_value_distribution(result_type __a, result_type __b = 1)
- : __p_(param_type(__a, __b)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit extreme_value_distribution(result_type __a = 0, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit extreme_value_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/fisher_f_distribution.h b/libcxx/include/__cxx03/__random/fisher_f_distribution.h
index f0050c73ca18c..7b8bf2d8f82be 100644
--- a/libcxx/include/__cxx03/__random/fisher_f_distribution.h
+++ b/libcxx/include/__cxx03/__random/fisher_f_distribution.h
@@ -56,14 +56,8 @@ class _LIBCPP_TEMPLATE_VIS fisher_f_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI fisher_f_distribution() : fisher_f_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit fisher_f_distribution(result_type __m, result_type __n = 1)
- : __p_(param_type(__m, __n)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
: __p_(param_type(__m, __n)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit fisher_f_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/gamma_distribution.h b/libcxx/include/__cxx03/__random/gamma_distribution.h
index a5f9917fd8f93..6a906a2ea04cb 100644
--- a/libcxx/include/__cxx03/__random/gamma_distribution.h
+++ b/libcxx/include/__cxx03/__random/gamma_distribution.h
@@ -59,14 +59,8 @@ class _LIBCPP_TEMPLATE_VIS gamma_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI gamma_distribution() : gamma_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit gamma_distribution(result_type __alpha, result_type __beta = 1)
- : __p_(param_type(__alpha, __beta)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit gamma_distribution(result_type __alpha = 1, result_type __beta = 1)
: __p_(param_type(__alpha, __beta)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit gamma_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/generate_canonical.h b/libcxx/include/__cxx03/__random/generate_canonical.h
index deea98fd0314b..f61e9e0ba141e 100644
--- a/libcxx/include/__cxx03/__random/generate_canonical.h
+++ b/libcxx/include/__cxx03/__random/generate_canonical.h
@@ -30,11 +30,7 @@ template <class _RealType, size_t __bits, class _URNG>
_LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) {
const size_t __dt = numeric_limits<_RealType>::digits;
const size_t __b = __dt < __bits ? __dt : __bits;
-#ifdef _LIBCPP_CXX03_LANG
const size_t __log_r = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
-#else
- const size_t __log_r = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
-#endif
const size_t __k = __b / __log_r + (__b % __log_r != 0) + (__b == 0);
const _RealType __rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
_RealType __base = __rp;
diff --git a/libcxx/include/__cxx03/__random/geometric_distribution.h b/libcxx/include/__cxx03/__random/geometric_distribution.h
index 85ca5d8ebbed9..ab462a31dd3b6 100644
--- a/libcxx/include/__cxx03/__random/geometric_distribution.h
+++ b/libcxx/include/__cxx03/__random/geometric_distribution.h
@@ -53,12 +53,7 @@ class _LIBCPP_TEMPLATE_VIS geometric_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI geometric_distribution() : geometric_distribution(0.5) {}
- _LIBCPP_HIDE_FROM_ABI explicit geometric_distribution(double __p) : __p_(__p) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit geometric_distribution(double __p = 0.5) : __p_(__p) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit geometric_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/independent_bits_engine.h b/libcxx/include/__cxx03/__random/independent_bits_engine.h
index 15df3f249ef82..8c04cf2c2b96b 100644
--- a/libcxx/include/__cxx03/__random/independent_bits_engine.h
+++ b/libcxx/include/__cxx03/__random/independent_bits_engine.h
@@ -57,11 +57,7 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine {
typedef typename _Engine::result_type _Engine_result_type;
typedef __conditional_t<sizeof(_Engine_result_type) <= sizeof(result_type), result_type, _Engine_result_type>
_Working_result_type;
-#ifdef _LIBCPP_CXX03_LANG
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1);
-#else
- static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min() + _Working_result_type(1);
-#endif
static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
static _LIBCPP_CONSTEXPR const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value;
static _LIBCPP_CONSTEXPR const size_t __w0 = __w / __n;
@@ -88,9 +84,6 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine {
// constructors and seeding functions
_LIBCPP_HIDE_FROM_ABI independent_bits_engine() {}
_LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(const _Engine& __e) : __e_(__e) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(_Engine&& __e) : __e_(std::move(__e)) {}
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
template <
class _Sseq,
diff --git a/libcxx/include/__cxx03/__random/linear_congruential_engine.h b/libcxx/include/__cxx03/__random/linear_congruential_engine.h
index e6025571e5cc1..100521c202e84 100644
--- a/libcxx/include/__cxx03/__random/linear_congruential_engine.h
+++ b/libcxx/include/__cxx03/__random/linear_congruential_engine.h
@@ -259,12 +259,7 @@ class _LIBCPP_TEMPLATE_VIS linear_congruential_engine {
static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
// constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI linear_congruential_engine() : linear_congruential_engine(default_seed) {}
- _LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(result_type __s) { seed(__s); }
-#else
_LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(result_type __s = default_seed) { seed(__s); }
-#endif
template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(_Sseq& __q) {
seed(__q);
diff --git a/libcxx/include/__cxx03/__random/lognormal_distribution.h b/libcxx/include/__cxx03/__random/lognormal_distribution.h
index de046d9b63562..f024ac67b033c 100644
--- a/libcxx/include/__cxx03/__random/lognormal_distribution.h
+++ b/libcxx/include/__cxx03/__random/lognormal_distribution.h
@@ -57,12 +57,7 @@ class _LIBCPP_TEMPLATE_VIS lognormal_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI lognormal_distribution() : lognormal_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit lognormal_distribution(result_type __m, result_type __s = 1) : __nd_(__m, __s) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit lognormal_distribution(result_type __m = 0, result_type __s = 1) : __nd_(__m, __s) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit lognormal_distribution(const param_type& __p) : __nd_(__p.m(), __p.s()) {}
_LIBCPP_HIDE_FROM_ABI void reset() { __nd_.reset(); }
diff --git a/libcxx/include/__cxx03/__random/mersenne_twister_engine.h b/libcxx/include/__cxx03/__random/mersenne_twister_engine.h
index d715b6ffd8dd4..404b15c3b0766 100644
--- a/libcxx/include/__cxx03/__random/mersenne_twister_engine.h
+++ b/libcxx/include/__cxx03/__random/mersenne_twister_engine.h
@@ -183,12 +183,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine {
static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
// constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI mersenne_twister_engine() : mersenne_twister_engine(default_seed) {}
- _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(result_type __sd) { seed(__sd); }
-#else
_LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(result_type __sd = default_seed) { seed(__sd); }
-#endif
template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {
seed(__q);
diff --git a/libcxx/include/__cxx03/__random/negative_binomial_distribution.h b/libcxx/include/__cxx03/__random/negative_binomial_distribution.h
index f50b38218710f..cd22234e0c842 100644
--- a/libcxx/include/__cxx03/__random/negative_binomial_distribution.h
+++ b/libcxx/include/__cxx03/__random/negative_binomial_distribution.h
@@ -58,13 +58,8 @@ class _LIBCPP_TEMPLATE_VIS negative_binomial_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI negative_binomial_distribution() : negative_binomial_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit negative_binomial_distribution(result_type __k, double __p = 0.5) : __p_(__k, __p) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit negative_binomial_distribution(result_type __k = 1, double __p = 0.5)
: __p_(__k, __p) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/normal_distribution.h b/libcxx/include/__cxx03/__random/normal_distribution.h
index f9700c48ade05..c44ecbf9e2add 100644
--- a/libcxx/include/__cxx03/__random/normal_distribution.h
+++ b/libcxx/include/__cxx03/__random/normal_distribution.h
@@ -60,14 +60,8 @@ class _LIBCPP_TEMPLATE_VIS normal_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI normal_distribution() : normal_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit normal_distribution(result_type __mean, result_type __stddev = 1)
- : __p_(param_type(__mean, __stddev)), __v_hot_(false) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit normal_distribution(result_type __mean = 0, result_type __stddev = 1)
: __p_(param_type(__mean, __stddev)), __v_hot_(false) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit normal_distribution(const param_type& __p) : __p_(__p), __v_hot_(false) {}
_LIBCPP_HIDE_FROM_ABI void reset() { __v_hot_ = false; }
diff --git a/libcxx/include/__cxx03/__random/piecewise_constant_distribution.h b/libcxx/include/__cxx03/__random/piecewise_constant_distribution.h
index 2036bb29ce1a6..ad28da6f1b581 100644
--- a/libcxx/include/__cxx03/__random/piecewise_constant_distribution.h
+++ b/libcxx/include/__cxx03/__random/piecewise_constant_distribution.h
@@ -46,10 +46,6 @@ class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution {
_LIBCPP_HIDE_FROM_ABI param_type();
template <class _InputIteratorB, class _InputIteratorW>
_LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _UnaryOperation>
- _LIBCPP_HIDE_FROM_ABI param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw);
_LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
@@ -88,12 +84,6 @@ class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution {
piecewise_constant_distribution(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w)
: __p_(__f_b, __l_b, __f_w) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _UnaryOperation>
- _LIBCPP_HIDE_FROM_ABI piecewise_constant_distribution(initializer_list<result_type> __bl, _UnaryOperation __fw)
- : __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI
piecewise_constant_distribution(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw)
@@ -194,29 +184,6 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
}
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _RealType>
-template <class _UnaryOperation>
-piecewise_constant_distribution<_RealType>::param_type::param_type(
- initializer_list<result_type> __bl, _UnaryOperation __fw)
- : __b_(__bl.begin(), __bl.end()) {
- if (__b_.size() < 2) {
- __b_.resize(2);
- __b_[0] = 0;
- __b_[1] = 1;
- __densities_.assign(1, 1.0);
- __areas_.assign(1, 0.0);
- } else {
- __densities_.reserve(__b_.size() - 1);
- for (size_t __i = 0; __i < __b_.size() - 1; ++__i)
- __densities_.push_back(__fw((__b_[__i + 1] + __b_[__i]) * .5));
- __init();
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _RealType>
template <class _UnaryOperation>
piecewise_constant_distribution<_RealType>::param_type::param_type(
diff --git a/libcxx/include/__cxx03/__random/piecewise_linear_distribution.h b/libcxx/include/__cxx03/__random/piecewise_linear_distribution.h
index c871d01c37b41..302ea2b7fa7ab 100644
--- a/libcxx/include/__cxx03/__random/piecewise_linear_distribution.h
+++ b/libcxx/include/__cxx03/__random/piecewise_linear_distribution.h
@@ -46,10 +46,6 @@ class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution {
_LIBCPP_HIDE_FROM_ABI param_type();
template <class _InputIteratorB, class _InputIteratorW>
_LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _UnaryOperation>
- _LIBCPP_HIDE_FROM_ABI param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw);
_LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
@@ -88,12 +84,6 @@ class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution {
piecewise_linear_distribution(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w)
: __p_(__f_b, __l_b, __f_w) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _UnaryOperation>
- _LIBCPP_HIDE_FROM_ABI piecewise_linear_distribution(initializer_list<result_type> __bl, _UnaryOperation __fw)
- : __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI
piecewise_linear_distribution(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw)
@@ -197,29 +187,6 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
}
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _RealType>
-template <class _UnaryOperation>
-piecewise_linear_distribution<_RealType>::param_type::param_type(
- initializer_list<result_type> __bl, _UnaryOperation __fw)
- : __b_(__bl.begin(), __bl.end()) {
- if (__b_.size() < 2) {
- __b_.resize(2);
- __b_[0] = 0;
- __b_[1] = 1;
- __densities_.assign(2, 1.0);
- __areas_.assign(1, 0.0);
- } else {
- __densities_.reserve(__b_.size());
- for (size_t __i = 0; __i < __b_.size(); ++__i)
- __densities_.push_back(__fw(__b_[__i]));
- __init();
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _RealType>
template <class _UnaryOperation>
piecewise_linear_distribution<_RealType>::param_type::param_type(
diff --git a/libcxx/include/__cxx03/__random/poisson_distribution.h b/libcxx/include/__cxx03/__random/poisson_distribution.h
index fdb30042e4a3c..5ae01195accdd 100644
--- a/libcxx/include/__cxx03/__random/poisson_distribution.h
+++ b/libcxx/include/__cxx03/__random/poisson_distribution.h
@@ -68,12 +68,7 @@ class _LIBCPP_TEMPLATE_VIS poisson_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI poisson_distribution() : poisson_distribution(1.0) {}
- _LIBCPP_HIDE_FROM_ABI explicit poisson_distribution(double __mean) : __p_(__mean) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit poisson_distribution(double __mean = 1.0) : __p_(__mean) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit poisson_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/random_device.h b/libcxx/include/__cxx03/__random/random_device.h
index 35874bc492a0a..0e8b3f3366d8d 100644
--- a/libcxx/include/__cxx03/__random/random_device.h
+++ b/libcxx/include/__cxx03/__random/random_device.h
@@ -54,12 +54,7 @@ class _LIBCPP_EXPORTED_FROM_ABI random_device {
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
// constructors
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI random_device() : random_device("/dev/urandom") {}
- explicit random_device(const string& __token);
-# else
explicit random_device(const string& __token = "/dev/urandom");
-# endif
~random_device();
// generating functions
diff --git a/libcxx/include/__cxx03/__random/seed_seq.h b/libcxx/include/__cxx03/__random/seed_seq.h
index 617ee66c819d8..93b2cfd16e281 100644
--- a/libcxx/include/__cxx03/__random/seed_seq.h
+++ b/libcxx/include/__cxx03/__random/seed_seq.h
@@ -35,12 +35,6 @@ class _LIBCPP_TEMPLATE_VIS seed_seq {
// constructors
_LIBCPP_HIDE_FROM_ABI seed_seq() _NOEXCEPT {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI seed_seq(initializer_list<_Tp> __il) {
- __init(__il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI seed_seq(_InputIterator __first, _InputIterator __last) {
diff --git a/libcxx/include/__cxx03/__random/shuffle_order_engine.h b/libcxx/include/__cxx03/__random/shuffle_order_engine.h
index 77eb0cf1fec87..ba0b49ea026e4 100644
--- a/libcxx/include/__cxx03/__random/shuffle_order_engine.h
+++ b/libcxx/include/__cxx03/__random/shuffle_order_engine.h
@@ -68,13 +68,8 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine {
// engine characteristics
static _LIBCPP_CONSTEXPR const size_t table_size = __k;
-#ifdef _LIBCPP_CXX03_LANG
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
-#else
- static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
- static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
-#endif
static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
@@ -84,9 +79,6 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine {
// constructors and seeding functions
_LIBCPP_HIDE_FROM_ABI shuffle_order_engine() { __init(); }
_LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(const _Engine& __e) : __e_(__e) { __init(); }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Engine&& __e) : __e_(std::move(__e)) { __init(); }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(result_type __sd) : __e_(__sd) { __init(); }
template <
class _Sseq,
diff --git a/libcxx/include/__cxx03/__random/student_t_distribution.h b/libcxx/include/__cxx03/__random/student_t_distribution.h
index 6c71d1a1a4fb8..6cddcd6ce86d4 100644
--- a/libcxx/include/__cxx03/__random/student_t_distribution.h
+++ b/libcxx/include/__cxx03/__random/student_t_distribution.h
@@ -57,12 +57,7 @@ class _LIBCPP_TEMPLATE_VIS student_t_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI student_t_distribution() : student_t_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit student_t_distribution(result_type __n) : __p_(param_type(__n)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit student_t_distribution(result_type __n = 1) : __p_(param_type(__n)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit student_t_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() { __nd_.reset(); }
diff --git a/libcxx/include/__cxx03/__random/subtract_with_carry_engine.h b/libcxx/include/__cxx03/__random/subtract_with_carry_engine.h
index 3a30e41bbb460..84aea22060cc7 100644
--- a/libcxx/include/__cxx03/__random/subtract_with_carry_engine.h
+++ b/libcxx/include/__cxx03/__random/subtract_with_carry_engine.h
@@ -79,12 +79,7 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine {
static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
// constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {}
- _LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(result_type __sd) { seed(__sd); }
-#else
_LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(result_type __sd = default_seed) { seed(__sd); }
-#endif
template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(_Sseq& __q) {
seed(__q);
diff --git a/libcxx/include/__cxx03/__random/uniform_int_distribution.h b/libcxx/include/__cxx03/__random/uniform_int_distribution.h
index 2e4656bd503f6..554577489733c 100644
--- a/libcxx/include/__cxx03/__random/uniform_int_distribution.h
+++ b/libcxx/include/__cxx03/__random/uniform_int_distribution.h
@@ -50,11 +50,7 @@ class __independent_bits_engine {
_Engine_result_type __mask0_;
_Engine_result_type __mask1_;
-#ifdef _LIBCPP_CXX03_LANG
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1);
-#else
- static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min() + _Working_result_type(1);
-#endif
static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
@@ -165,15 +161,8 @@ class uniform_int_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI uniform_int_distribution() : uniform_int_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution(
- result_type __a, result_type __b = numeric_limits<result_type>::max())
- : __p_(param_type(__a, __b)) {}
-#else
explicit uniform_int_distribution(result_type __a = 0, result_type __b = numeric_limits<result_type>::max())
: __p_(param_type(__a, __b)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/uniform_real_distribution.h b/libcxx/include/__cxx03/__random/uniform_real_distribution.h
index 623344455ee31..9cf9437df2207 100644
--- a/libcxx/include/__cxx03/__random/uniform_real_distribution.h
+++ b/libcxx/include/__cxx03/__random/uniform_real_distribution.h
@@ -56,14 +56,8 @@ class _LIBCPP_TEMPLATE_VIS uniform_real_distribution {
public:
// constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI uniform_real_distribution() : uniform_real_distribution(0) {}
- _LIBCPP_HIDE_FROM_ABI explicit uniform_real_distribution(result_type __a, result_type __b = 1)
- : __p_(param_type(__a, __b)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__random/weibull_distribution.h b/libcxx/include/__cxx03/__random/weibull_distribution.h
index 83bb88d50f626..e441cf059b317 100644
--- a/libcxx/include/__cxx03/__random/weibull_distribution.h
+++ b/libcxx/include/__cxx03/__random/weibull_distribution.h
@@ -57,14 +57,8 @@ class _LIBCPP_TEMPLATE_VIS weibull_distribution {
public:
// constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI weibull_distribution() : weibull_distribution(1) {}
- _LIBCPP_HIDE_FROM_ABI explicit weibull_distribution(result_type __a, result_type __b = 1)
- : __p_(param_type(__a, __b)) {}
-#else
_LIBCPP_HIDE_FROM_ABI explicit weibull_distribution(result_type __a = 1, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
-#endif
_LIBCPP_HIDE_FROM_ABI explicit weibull_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_HIDE_FROM_ABI void reset() {}
diff --git a/libcxx/include/__cxx03/__string/char_traits.h b/libcxx/include/__cxx03/__string/char_traits.h
index e962d986b2785..29fb9197754a9 100644
--- a/libcxx/include/__cxx03/__string/char_traits.h
+++ b/libcxx/include/__cxx03/__string/char_traits.h
@@ -83,9 +83,6 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char> {
using off_type = streamoff;
using pos_type = streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER >= 20
- using comparison_category = strong_ordering;
-#endif
static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void
assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {
@@ -176,9 +173,6 @@ struct __char_traits_base {
using int_type = _IntT;
using off_type = streamoff;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER >= 20
- using comparison_category = strong_ordering;
-#endif
// There are different aliases for the different char types, but they are all aliases to this type
using pos_type = fpos<mbstate_t>;
diff --git a/libcxx/include/__cxx03/__string/constexpr_c_functions.h b/libcxx/include/__cxx03/__string/constexpr_c_functions.h
index 5a0b4953de177..508f473098870 100644
--- a/libcxx/include/__cxx03/__string/constexpr_c_functions.h
+++ b/libcxx/include/__cxx03/__string/constexpr_c_functions.h
@@ -52,10 +52,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_st
// GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
if (__libcpp_is_constant_evaluated()) {
-#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_COMPILER_CLANG_BASED)
- if constexpr (is_same_v<_Tp, char>)
- return __builtin_strlen(__str);
-#endif
size_t __i = 0;
for (; __str[__i] != '\0'; ++__i)
;
@@ -134,10 +130,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp*
if (__libcpp_is_constant_evaluated()) {
// use __builtin_char_memchr to optimize constexpr evaluation if we can
-#if _LIBCPP_STD_VER >= 17 && __has_builtin(__builtin_char_memchr)
- if constexpr (is_same_v<remove_cv_t<_Tp>, char> && is_same_v<remove_cv_t<_Up>, char>)
- return __builtin_char_memchr(__str, __value, __count);
-#endif
for (; __count; --__count) {
if (*__str == __value)
diff --git a/libcxx/include/__cxx03/__system_error/error_category.h b/libcxx/include/__cxx03/__system_error/error_category.h
index 7f9dd7171ea5c..ffbafa6c52f82 100644
--- a/libcxx/include/__cxx03/__system_error/error_category.h
+++ b/libcxx/include/__cxx03/__system_error/error_category.h
@@ -45,20 +45,10 @@ class _LIBCPP_EXPORTED_FROM_ABI error_category {
_LIBCPP_HIDE_FROM_ABI bool operator==(const error_category& __rhs) const _NOEXCEPT { return this == &__rhs; }
-#if _LIBCPP_STD_VER >= 20
-
- _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_category& __rhs) const noexcept {
- return compare_three_way()(this, std::addressof(__rhs));
- }
-
-#else // _LIBCPP_STD_VER >= 20
-
_LIBCPP_HIDE_FROM_ABI bool operator!=(const error_category& __rhs) const _NOEXCEPT { return !(*this == __rhs); }
_LIBCPP_HIDE_FROM_ABI bool operator<(const error_category& __rhs) const _NOEXCEPT { return this < &__rhs; }
-#endif // _LIBCPP_STD_VER >= 20
-
friend class _LIBCPP_HIDDEN __do_message;
};
diff --git a/libcxx/include/__cxx03/__system_error/error_code.h b/libcxx/include/__cxx03/__system_error/error_code.h
index e253f88633d33..2ab304eb4f4e2 100644
--- a/libcxx/include/__cxx03/__system_error/error_code.h
+++ b/libcxx/include/__cxx03/__system_error/error_code.h
@@ -29,11 +29,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum : public false_type {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
-#endif
-
namespace __adl_only {
// Those cause ADL to trigger but they are not viable candidates,
// so they are never actually selected.
@@ -97,13 +92,9 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_
return __x.category().equivalent(__x.value(), __y) || __y.category().equivalent(__x, __y.value());
}
-#if _LIBCPP_STD_VER <= 17
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT {
return __y == __x;
}
-#endif
-
-#if _LIBCPP_STD_VER <= 17
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT {
return !(__x == __y);
@@ -121,16 +112,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_code& __x, const error_c
return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
}
-#else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_code& __x, const error_code& __y) noexcept {
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <>
struct _LIBCPP_TEMPLATE_VIS hash<error_code> : public __unary_function<error_code, size_t> {
_LIBCPP_HIDE_FROM_ABI size_t operator()(const error_code& __ec) const _NOEXCEPT {
diff --git a/libcxx/include/__cxx03/__system_error/error_condition.h b/libcxx/include/__cxx03/__system_error/error_condition.h
index ba37deaf4fcb6..2aff9351379f6 100644
--- a/libcxx/include/__cxx03/__system_error/error_condition.h
+++ b/libcxx/include/__cxx03/__system_error/error_condition.h
@@ -28,18 +28,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum : public false_type {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
-#endif
-
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc> : true_type {};
-#ifdef _LIBCPP_CXX03_LANG
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx> : true_type {};
-#endif
namespace __adl_only {
// Those cause ADL to trigger but they are not viable candidates,
@@ -97,8 +90,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const e
return __x.category() == __y.category() && __x.value() == __y.value();
}
-#if _LIBCPP_STD_VER <= 17
-
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
return !(__x == __y);
}
@@ -107,17 +98,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_condition& __x, const er
return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
}
-#else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering
-operator<=>(const error_condition& __x, const error_condition& __y) noexcept {
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <>
struct _LIBCPP_TEMPLATE_VIS hash<error_condition> : public __unary_function<error_condition, size_t> {
_LIBCPP_HIDE_FROM_ABI size_t operator()(const error_condition& __ec) const _NOEXCEPT {
diff --git a/libcxx/include/__cxx03/__thread/id.h b/libcxx/include/__cxx03/__thread/id.h
index 8dcd68bdf39d7..76c6263982030 100644
--- a/libcxx/include/__cxx03/__thread/id.h
+++ b/libcxx/include/__cxx03/__thread/id.h
@@ -55,11 +55,7 @@ class _LIBCPP_TEMPLATE_VIS __thread_id {
_LIBCPP_HIDE_FROM_ABI void __reset() { __id_ = 0; }
friend _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT;
-# if _LIBCPP_STD_VER <= 17
friend _LIBCPP_HIDE_FROM_ABI bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT;
-# else // _LIBCPP_STD_VER <= 17
- friend _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept;
-# endif // _LIBCPP_STD_VER <= 17
template <class _CharT, class _Traits>
friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
@@ -84,8 +80,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _
return __libcpp_thread_id_equal(__x.__id_, __y.__id_);
}
-# if _LIBCPP_STD_VER <= 17
-
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__x == __y); }
inline _LIBCPP_HIDE_FROM_ABI bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT {
@@ -96,18 +90,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(__thread_id __x, __thread_id __y) _
inline _LIBCPP_HIDE_FROM_ABI bool operator>(__thread_id __x, __thread_id __y) _NOEXCEPT { return __y < __x; }
inline _LIBCPP_HIDE_FROM_ABI bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__x < __y); }
-# else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept {
- if (__x == __y)
- return strong_ordering::equal;
- if (__thread_id::__lt_impl(__x, __y))
- return strong_ordering::less;
- return strong_ordering::greater;
-}
-
-# endif // _LIBCPP_STD_VER <= 17
-
namespace this_thread {
inline _LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT { return __libcpp_thread_get_current_id(); }
diff --git a/libcxx/include/__cxx03/__thread/thread.h b/libcxx/include/__cxx03/__thread/thread.h
index b624a7d46fe24..d7c19876b226a 100644
--- a/libcxx/include/__cxx03/__thread/thread.h
+++ b/libcxx/include/__cxx03/__thread/thread.h
@@ -155,13 +155,8 @@ class _LIBCPP_EXPORTED_FROM_ABI thread {
typedef __libcpp_thread_t native_handle_type;
_LIBCPP_HIDE_FROM_ABI thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Fp, class... _Args, __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value, int> = 0>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp&& __f, _Args&&... __args);
-#else // _LIBCPP_CXX03_LANG
template <class _Fp>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp __f);
-#endif
~thread();
_LIBCPP_HIDE_FROM_ABI thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) { __t.__t_ = _LIBCPP_NULL_THREAD; }
@@ -185,38 +180,6 @@ class _LIBCPP_EXPORTED_FROM_ABI thread {
static unsigned hardware_concurrency() _NOEXCEPT;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _TSp, class _Fp, class... _Args, size_t... _Indices>
-inline _LIBCPP_HIDE_FROM_ABI void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>) {
- std::__invoke(std::move(std::get<1>(__t)), std::move(std::get<_Indices>(__t))...);
-}
-
-template <class _Fp>
-_LIBCPP_HIDE_FROM_ABI void* __thread_proxy(void* __vp) {
- // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
- unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().set_pointer(std::get<0>(*__p.get()).release());
- typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
- std::__thread_execute(*__p.get(), _Index());
- return nullptr;
-}
-
-template <class _Fp, class... _Args, __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value, int> >
-thread::thread(_Fp&& __f, _Args&&... __args) {
- typedef unique_ptr<__thread_struct> _TSPtr;
- _TSPtr __tsp(new __thread_struct);
- typedef tuple<_TSPtr, __decay_t<_Fp>, __decay_t<_Args>...> _Gp;
- unique_ptr<_Gp> __p(new _Gp(std::move(__tsp), std::forward<_Fp>(__f), std::forward<_Args>(__args)...));
- int __ec = std::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
- if (__ec == 0)
- __p.release();
- else
- __throw_system_error(__ec, "thread constructor failed");
-}
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _Fp>
struct __thread_invoke_pair {
// This type is used to pass memory for thread local storage and a functor
@@ -247,8 +210,6 @@ thread::thread(_Fp __f) {
__throw_system_error(__ec, "thread constructor failed");
}
-#endif // _LIBCPP_CXX03_LANG
-
inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x.swap(__y); }
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__tree b/libcxx/include/__cxx03/__tree
index 8982baf18d1a9..610efea900f9e 100644
--- a/libcxx/include/__cxx03/__tree
+++ b/libcxx/include/__cxx03/__tree
@@ -703,15 +703,6 @@ public:
friend class __map_node_destructor;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _NodeType, class _Alloc>
-struct __generic_container_node_destructor;
-template <class _Tp, class _VoidPtr, class _Alloc>
-struct __generic_container_node_destructor<__tree_node<_Tp, _VoidPtr>, _Alloc> : __tree_node_destructor<_Alloc> {
- using __tree_node_destructor<_Alloc>::__tree_node_destructor;
-};
-#endif
-
template <class _Tp, class _NodePtr, class _DiffType>
class _LIBCPP_TEMPLATE_VIS __tree_iterator {
typedef __tree_node_types<_NodePtr> _NodeTypes;
@@ -730,12 +721,7 @@ public:
typedef value_type& reference;
typedef typename _NodeTypes::__node_value_type_pointer pointer;
- _LIBCPP_HIDE_FROM_ABI __tree_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER >= 14
- : __ptr_(nullptr)
-#endif
- {
- }
+ _LIBCPP_HIDE_FROM_ABI __tree_iterator() _NOEXCEPT {}
_LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__value_; }
_LIBCPP_HIDE_FROM_ABI pointer operator->() const { return pointer_traits<pointer>::pointer_to(__get_np()->__value_); }
@@ -807,12 +793,7 @@ public:
typedef const value_type& reference;
typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
- _LIBCPP_HIDE_FROM_ABI __tree_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER >= 14
- : __ptr_(nullptr)
-#endif
- {
- }
+ _LIBCPP_HIDE_FROM_ABI __tree_const_iterator() _NOEXCEPT {}
private:
typedef __tree_iterator<value_type, __node_pointer, difference_type> __non_const_iterator;
@@ -874,10 +855,6 @@ private:
};
template <class _Tp, class _Compare>
-#ifndef _LIBCPP_CXX03_LANG
-_LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
- "the specified comparator type does not provide a viable const call operator")
-#endif
int __diagnose_non_const_comparator();
template <class _Tp, class _Compare, class _Allocator>
@@ -1003,12 +980,8 @@ public:
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI void swap(__tree& __t)
-#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
-#else
- _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
-#endif
template <class _Key, class... _Args>
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args&&... __args);
@@ -1146,27 +1119,6 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator __remove_node_pointer(__node_pointer) _NOEXCEPT;
-#if _LIBCPP_STD_VER >= 17
- template <class _NodeHandle, class _InsertReturnType>
- _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_unique(const_iterator, _NodeHandle&&);
- template <class _Tree>
- _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_unique(_Tree& __source);
-
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(_NodeHandle&&);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(const_iterator, _NodeHandle&&);
- template <class _Tree>
- _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_multi(_Tree& __source);
-
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(key_type const&);
- template <class _NodeHandle>
- _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(const_iterator);
-#endif
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
template <class _Key>
@@ -1545,12 +1497,8 @@ void __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT {
template <class _Tp, class _Compare, class _Allocator>
void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
-#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
-#else
- _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>)
-#endif
{
using std::swap;
swap(__begin_node_, __t.__begin_node_);
@@ -1916,125 +1864,6 @@ __tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _
return __r;
}
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle, class _InsertReturnType>
-_LIBCPP_HIDE_FROM_ABI _InsertReturnType
-__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __nh) {
- if (__nh.empty())
- return _InsertReturnType{end(), false, _NodeHandle()};
-
- __node_pointer __ptr = __nh.__ptr_;
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_equal(__parent, __ptr->__value_);
- if (__child != nullptr)
- return _InsertReturnType{iterator(static_cast<__node_pointer>(__child)), false, std::move(__nh)};
-
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
- __nh.__release_ptr();
- return _InsertReturnType{iterator(__ptr), true, _NodeHandle()};
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __hint, _NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
-
- __node_pointer __ptr = __nh.__ptr_;
- __parent_pointer __parent;
- __node_base_pointer __dummy;
- __node_base_pointer& __child = __find_equal(__hint, __parent, __dummy, __ptr->__value_);
- __node_pointer __r = static_cast<__node_pointer>(__child);
- if (__child == nullptr) {
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
- __r = __ptr;
- __nh.__release_ptr();
- }
- return iterator(__r);
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key) {
- iterator __it = find(__key);
- if (__it == end())
- return _NodeHandle();
- return __node_handle_extract<_NodeHandle>(__it);
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(const_iterator __p) {
- __node_pointer __np = __p.__get_np();
- __remove_node_pointer(__np);
- return _NodeHandle(__np, __alloc());
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Tree>
-_LIBCPP_HIDE_FROM_ABI void __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(_Tree& __source) {
- static_assert(is_same<typename _Tree::__node_pointer, __node_pointer>::value, "");
-
- for (typename _Tree::iterator __i = __source.begin(); __i != __source.end();) {
- __node_pointer __src_ptr = __i.__get_np();
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_equal(__parent, _NodeTypes::__get_key(__src_ptr->__value_));
- ++__i;
- if (__child != nullptr)
- continue;
- __source.__remove_node_pointer(__src_ptr);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));
- }
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
- __node_pointer __ptr = __nh.__ptr_;
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__ptr->__value_));
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
- __nh.__release_ptr();
- return iterator(__ptr);
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _NodeHandle>
-_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh) {
- if (__nh.empty())
- return end();
-
- __node_pointer __ptr = __nh.__ptr_;
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__hint, __parent, _NodeTypes::__get_key(__ptr->__value_));
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));
- __nh.__release_ptr();
- return iterator(__ptr);
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Tree>
-_LIBCPP_HIDE_FROM_ABI void __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(_Tree& __source) {
- static_assert(is_same<typename _Tree::__node_pointer, __node_pointer>::value, "");
-
- for (typename _Tree::iterator __i = __source.begin(); __i != __source.end();) {
- __node_pointer __src_ptr = __i.__get_np();
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__src_ptr->__value_));
- ++__i;
- __source.__remove_node_pointer(__src_ptr);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));
- }
-}
-
-#endif // _LIBCPP_STD_VER >= 17
-
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p) {
__node_pointer __np = __p.__get_np();
diff --git a/libcxx/include/__cxx03/__tuple/find_index.h b/libcxx/include/__cxx03/__tuple/find_index.h
index a090dff91e973..253004ecba0ab 100644
--- a/libcxx/include/__cxx03/__tuple/find_index.h
+++ b/libcxx/include/__cxx03/__tuple/find_index.h
@@ -17,46 +17,4 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER >= 14
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-namespace __find_detail {
-
-static constexpr size_t __not_found = static_cast<size_t>(-1);
-static constexpr size_t __ambiguous = __not_found - 1;
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr size_t __find_idx_return(size_t __curr_i, size_t __res, bool __matches) {
- return !__matches ? __res : (__res == __not_found ? __curr_i : __ambiguous);
-}
-
-template <size_t _Nx>
-inline _LIBCPP_HIDE_FROM_ABI constexpr size_t __find_idx(size_t __i, const bool (&__matches)[_Nx]) {
- return __i == _Nx
- ? __not_found
- : __find_detail::__find_idx_return(__i, __find_detail::__find_idx(__i + 1, __matches), __matches[__i]);
-}
-
-template <class _T1, class... _Args>
-struct __find_exactly_one_checked {
- static constexpr bool __matches[sizeof...(_Args)] = {is_same<_T1, _Args>::value...};
- static constexpr size_t value = __find_detail::__find_idx(0, __matches);
- static_assert(value != __not_found, "type not found in type list");
- static_assert(value != __ambiguous, "type occurs more than once in type list");
-};
-
-template <class _T1>
-struct __find_exactly_one_checked<_T1> {
- static_assert(!is_same<_T1, _T1>::value, "type not in empty type list");
-};
-
-} // namespace __find_detail
-
-template <typename _T1, typename... _Args>
-struct __find_exactly_one_t : public __find_detail::__find_exactly_one_checked<_T1, _Args...> {};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER >= 14
-
#endif // _LIBCPP___CXX03___TUPLE_FIND_INDEX_H
diff --git a/libcxx/include/__cxx03/__tuple/make_tuple_types.h b/libcxx/include/__cxx03/__tuple/make_tuple_types.h
index d8eed10dc51ac..522d22a3eaa4b 100644
--- a/libcxx/include/__cxx03/__tuple/make_tuple_types.h
+++ b/libcxx/include/__cxx03/__tuple/make_tuple_types.h
@@ -25,56 +25,4 @@
# pragma GCC system_header
#endif
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
-// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
-// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
-// lvalue_reference type, then __tuple_types<_Types&...> is the result.
-
-template <class _TupleTypes, class _TupleIndices>
-struct __make_tuple_types_flat;
-
-template <template <class...> class _Tuple, class... _Types, size_t... _Idx>
-struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
- // Specialization for pair, tuple, and __tuple_types
- template <class _Tp>
- using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__copy_cvref_t<_Tp, __type_pack_element<_Idx, _Types...>>...>;
-};
-
-template <class _Vt, size_t _Np, size_t... _Idx>
-struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
- template <size_t>
- using __value_type = _Vt;
- template <class _Tp>
- using __apply_quals = __tuple_types<__copy_cvref_t<_Tp, __value_type<_Idx>>...>;
-};
-
-template <class _Tp,
- size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
- size_t _Sp = 0,
- bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
-struct __make_tuple_types {
- static_assert(_Sp <= _Ep, "__make_tuple_types input error");
- using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
- using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
- using type = typename _Maker::template __apply_quals<_Tp>;
-};
-
-template <class... _Types, size_t _Ep>
-struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
- typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
-};
-
-template <class... _Types, size_t _Ep>
-struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
- typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CXX03_LANG
-
#endif // _LIBCPP___CXX03___TUPLE_MAKE_TUPLE_TYPES_H
diff --git a/libcxx/include/__cxx03/__tuple/sfinae_helpers.h b/libcxx/include/__cxx03/__tuple/sfinae_helpers.h
index 4fbe87d6e9a5b..dbcbf76d38a42 100644
--- a/libcxx/include/__cxx03/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__cxx03/__tuple/sfinae_helpers.h
@@ -31,112 +31,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-
-struct __tuple_sfinae_base {
- template <template <class, class...> class _Trait, class... _LArgs, class... _RArgs>
- static auto __do_test(__tuple_types<_LArgs...>,
- __tuple_types<_RArgs...>) -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>;
- template <template <class...> class>
- static auto __do_test(...) -> false_type;
-
- template <class _FromArgs, class _ToArgs>
- using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{}));
-};
-
-// __tuple_constructible
-
-template <class _Tp,
- class _Up,
- bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value>
-struct __tuple_constructible : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_constructible<_Tp, _Up, true, true>
- : public __tuple_sfinae_base::__constructible< typename __make_tuple_types<_Tp>::type,
- typename __make_tuple_types<_Up>::type > {};
-
-template <size_t _Ip, class... _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > {
- typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
-};
-
-struct _LIBCPP_EXPORTED_FROM_ABI __check_tuple_constructor_fail {
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; }
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; }
- template <class...>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() {
- return false;
- }
- template <class...>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() {
- return false;
- }
- template <class...>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_assign() {
- return false;
- }
-};
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
-#if _LIBCPP_STD_VER >= 17
-
-template <bool _CanCopy, bool _CanMove>
-struct __sfinae_ctor_base {};
-template <>
-struct __sfinae_ctor_base<false, false> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
- __sfinae_ctor_base(__sfinae_ctor_base&&) = delete;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-template <>
-struct __sfinae_ctor_base<true, false> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base(__sfinae_ctor_base&&) = delete;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-template <>
-struct __sfinae_ctor_base<false, true> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
- __sfinae_ctor_base(__sfinae_ctor_base&&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-
-template <bool _CanCopy, bool _CanMove>
-struct __sfinae_assign_base {};
-template <>
-struct __sfinae_assign_base<false, false> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base&&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
-};
-template <>
-struct __sfinae_assign_base<true, false> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base&&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
-};
-template <>
-struct __sfinae_assign_base<false, true> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base&&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
-};
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TUPLE_SFINAE_HELPERS_H
diff --git a/libcxx/include/__cxx03/__tuple/tuple_element.h b/libcxx/include/__cxx03/__tuple/tuple_element.h
index 56dbdc3beb39b..3061cbbab8e34 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_element.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_element.h
@@ -38,21 +38,6 @@ struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> {
typedef _LIBCPP_NODEBUG const volatile typename tuple_element<_Ip, _Tp>::type type;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <size_t _Ip, class... _Types>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...> > {
- static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
- typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
-};
-
-# if _LIBCPP_STD_VER >= 14
-template <size_t _Ip, class... _Tp>
-using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element<_Ip, _Tp...>::type;
-# endif
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TUPLE_TUPLE_ELEMENT_H
diff --git a/libcxx/include/__cxx03/__tuple/tuple_indices.h b/libcxx/include/__cxx03/__tuple/tuple_indices.h
index 0c423d99ccb63..546b04d9298d7 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_indices.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_indices.h
@@ -17,21 +17,4 @@
# pragma GCC system_header
#endif
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <size_t...>
-struct __tuple_indices {};
-
-template <size_t _Ep, size_t _Sp = 0>
-struct __make_tuple_indices {
- static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
- typedef __make_indices_imp<_Ep, _Sp> type;
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CXX03_LANG
-
#endif // _LIBCPP___CXX03___TUPLE_MAKE_TUPLE_INDICES_H
diff --git a/libcxx/include/__cxx03/__tuple/tuple_like.h b/libcxx/include/__cxx03/__tuple/tuple_like.h
index ea596c4ba52df..358c681648348 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_like.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_like.h
@@ -21,22 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-inline constexpr bool __is_ranges_subrange_v = false;
-
-template <class _Iter, class _Sent, ranges::subrange_kind _Kind>
-inline constexpr bool __is_ranges_subrange_v<ranges::subrange<_Iter, _Sent, _Kind>> = true;
-
-template <class _Tp>
-concept __tuple_like = __tuple_like_no_subrange<_Tp> || __is_ranges_subrange_v<remove_cvref_t<_Tp>>;
-
-// As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so
-// you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TUPLE_TUPLE_LIKE_H
diff --git a/libcxx/include/__cxx03/__tuple/tuple_like_ext.h b/libcxx/include/__cxx03/__tuple/tuple_like_ext.h
index 94470521cd068..2b91e60587899 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_like_ext.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_like_ext.h
@@ -33,11 +33,6 @@ struct __tuple_like_ext<volatile _Tp> : public __tuple_like_ext<_Tp> {};
template <class _Tp>
struct __tuple_like_ext<const volatile _Tp> : public __tuple_like_ext<_Tp> {};
-#ifndef _LIBCPP_CXX03_LANG
-template <class... _Tp>
-struct __tuple_like_ext<tuple<_Tp...> > : true_type {};
-#endif
-
template <class _T1, class _T2>
struct __tuple_like_ext<pair<_T1, _T2> > : true_type {};
diff --git a/libcxx/include/__cxx03/__tuple/tuple_like_no_subrange.h b/libcxx/include/__cxx03/__tuple/tuple_like_no_subrange.h
index ff095163363b1..11080c3162117 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_like_no_subrange.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_like_no_subrange.h
@@ -24,38 +24,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-inline constexpr bool __tuple_like_no_subrange_impl = false;
-
-template <class... _Tp>
-inline constexpr bool __tuple_like_no_subrange_impl<tuple<_Tp...>> = true;
-
-template <class _T1, class _T2>
-inline constexpr bool __tuple_like_no_subrange_impl<pair<_T1, _T2>> = true;
-
-template <class _Tp, size_t _Size>
-inline constexpr bool __tuple_like_no_subrange_impl<array<_Tp, _Size>> = true;
-
-# if _LIBCPP_STD_VER >= 26
-
-template <class _Tp>
-inline constexpr bool __tuple_like_no_subrange_impl<complex<_Tp>> = true;
-
-# endif
-
-template <class _Tp>
-concept __tuple_like_no_subrange = __tuple_like_no_subrange_impl<remove_cvref_t<_Tp>>;
-
-// This is equivalent to the exposition-only type trait `pair-like`, except that it is false for specializations of
-// `ranges::subrange`. This is more useful than the pair-like concept in the standard because every use of `pair-like`
-// excludes `ranges::subrange`.
-template <class _Tp>
-concept __pair_like_no_subrange = __tuple_like_no_subrange<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H
diff --git a/libcxx/include/__cxx03/__tuple/tuple_size.h b/libcxx/include/__cxx03/__tuple/tuple_size.h
index 1f8fd22e3eaf1..a63df3a2cf90e 100644
--- a/libcxx/include/__cxx03/__tuple/tuple_size.h
+++ b/libcxx/include/__cxx03/__tuple/tuple_size.h
@@ -25,50 +25,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_size;
-#if !defined(_LIBCPP_CXX03_LANG)
-template <class _Tp, class...>
-using __enable_if_tuple_size_imp = _Tp;
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< const _Tp,
- __enable_if_t<!is_volatile<_Tp>::value>,
- integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< volatile _Tp,
- __enable_if_t<!is_const<_Tp>::value>,
- integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS
-tuple_size<__enable_if_tuple_size_imp<const volatile _Tp, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-#else
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class... _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
-
-template <class... _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
-
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
-# endif
-
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/add_const.h b/libcxx/include/__cxx03/__type_traits/add_const.h
index 004ce05c03996..1130d4cb48636 100644
--- a/libcxx/include/__cxx03/__type_traits/add_const.h
+++ b/libcxx/include/__cxx03/__type_traits/add_const.h
@@ -22,11 +22,6 @@ struct _LIBCPP_TEMPLATE_VIS add_const {
typedef _LIBCPP_NODEBUG const _Tp type;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_const_t = typename add_const<_Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_CONST_H
diff --git a/libcxx/include/__cxx03/__type_traits/add_cv.h b/libcxx/include/__cxx03/__type_traits/add_cv.h
index 8445b863b5c2e..2b9e4f86cd673 100644
--- a/libcxx/include/__cxx03/__type_traits/add_cv.h
+++ b/libcxx/include/__cxx03/__type_traits/add_cv.h
@@ -22,11 +22,6 @@ struct _LIBCPP_TEMPLATE_VIS add_cv {
typedef _LIBCPP_NODEBUG const volatile _Tp type;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_cv_t = typename add_cv<_Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_CV_H
diff --git a/libcxx/include/__cxx03/__type_traits/add_lvalue_reference.h b/libcxx/include/__cxx03/__type_traits/add_lvalue_reference.h
index c35b366794a7d..862224e526a55 100644
--- a/libcxx/include/__cxx03/__type_traits/add_lvalue_reference.h
+++ b/libcxx/include/__cxx03/__type_traits/add_lvalue_reference.h
@@ -44,11 +44,6 @@ struct add_lvalue_reference {
using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
diff --git a/libcxx/include/__cxx03/__type_traits/add_pointer.h b/libcxx/include/__cxx03/__type_traits/add_pointer.h
index c53b5ce7e46ac..e5cf094d05fdc 100644
--- a/libcxx/include/__cxx03/__type_traits/add_pointer.h
+++ b/libcxx/include/__cxx03/__type_traits/add_pointer.h
@@ -45,11 +45,6 @@ struct add_pointer {
using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_pointer_t = __add_pointer_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_POINTER_H
diff --git a/libcxx/include/__cxx03/__type_traits/add_rvalue_reference.h b/libcxx/include/__cxx03/__type_traits/add_rvalue_reference.h
index 812a15e6090e4..bc0adbf66b351 100644
--- a/libcxx/include/__cxx03/__type_traits/add_rvalue_reference.h
+++ b/libcxx/include/__cxx03/__type_traits/add_rvalue_reference.h
@@ -44,11 +44,6 @@ struct add_rvalue_reference {
using type = __add_rvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
diff --git a/libcxx/include/__cxx03/__type_traits/add_volatile.h b/libcxx/include/__cxx03/__type_traits/add_volatile.h
index 9f649e4978d65..6a952b2d18d4c 100644
--- a/libcxx/include/__cxx03/__type_traits/add_volatile.h
+++ b/libcxx/include/__cxx03/__type_traits/add_volatile.h
@@ -22,11 +22,6 @@ struct _LIBCPP_TEMPLATE_VIS add_volatile {
typedef _LIBCPP_NODEBUG volatile _Tp type;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using add_volatile_t = typename add_volatile<_Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ADD_VOLATILE_H
diff --git a/libcxx/include/__cxx03/__type_traits/aligned_storage.h b/libcxx/include/__cxx03/__type_traits/aligned_storage.h
index 8383cc48bb44e..9195926459472 100644
--- a/libcxx/include/__cxx03/__type_traits/aligned_storage.h
+++ b/libcxx/include/__cxx03/__type_traits/aligned_storage.h
@@ -95,15 +95,6 @@ struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage {
};
};
-#if _LIBCPP_STD_VER >= 14
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
-using aligned_storage_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_storage<_Len, _Align>::type;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-#endif
-
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
template <size_t _Len> \
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n> { \
diff --git a/libcxx/include/__cxx03/__type_traits/aligned_union.h b/libcxx/include/__cxx03/__type_traits/aligned_union.h
index 0a0deb90e3991..b3fa2b8a56c07 100644
--- a/libcxx/include/__cxx03/__type_traits/aligned_union.h
+++ b/libcxx/include/__cxx03/__type_traits/aligned_union.h
@@ -41,11 +41,6 @@ struct _LIBCPP_DEPRECATED_IN_CXX23 aligned_union {
typedef typename aligned_storage<__len, alignment_value>::type type;
};
-#if _LIBCPP_STD_VER >= 14
-template <size_t _Len, class... _Types>
-using aligned_union_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_union<_Len, _Types...>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ALIGNED_UNION_H
diff --git a/libcxx/include/__cxx03/__type_traits/alignment_of.h b/libcxx/include/__cxx03/__type_traits/alignment_of.h
index d72e0cc43ebf6..ead52b2f7816b 100644
--- a/libcxx/include/__cxx03/__type_traits/alignment_of.h
+++ b/libcxx/include/__cxx03/__type_traits/alignment_of.h
@@ -22,11 +22,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS alignment_of : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr size_t alignment_of_v = _LIBCPP_ALIGNOF(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ALIGNMENT_OF_H
diff --git a/libcxx/include/__cxx03/__type_traits/common_type.h b/libcxx/include/__cxx03/__type_traits/common_type.h
index 78c36162ee4ac..756da08dcc366 100644
--- a/libcxx/include/__cxx03/__type_traits/common_type.h
+++ b/libcxx/include/__cxx03/__type_traits/common_type.h
@@ -23,26 +23,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-// Let COND_RES(X, Y) be:
-template <class _Tp, class _Up>
-using __cond_type = decltype(false ? std::declval<_Tp>() : std::declval<_Up>());
-
-template <class _Tp, class _Up, class = void>
-struct __common_type3 {};
-
-// sub-bullet 4 - "if COND_RES(CREF(D1), CREF(D2)) denotes a type..."
-template <class _Tp, class _Up>
-struct __common_type3<_Tp, _Up, void_t<__cond_type<const _Tp&, const _Up&>>> {
- using type = remove_cvref_t<__cond_type<const _Tp&, const _Up&>>;
-};
-
-template <class _Tp, class _Up, class = void>
-struct __common_type2_imp : __common_type3<_Tp, _Up> {};
-#else
template <class _Tp, class _Up, class = void>
struct __common_type2_imp {};
-#endif
// sub-bullet 3 - "if decay_t<decltype(false ? declval<D1>() : declval<D2>())> ..."
template <class _Tp, class _Up>
@@ -92,11 +74,6 @@ template <class _Tp, class _Up, class _Vp, class... _Rest>
struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, _Vp, _Rest...>
: __common_type_impl<__common_types<_Tp, _Up, _Vp, _Rest...> > {};
-#if _LIBCPP_STD_VER >= 14
-template <class... _Tp>
-using common_type_t = typename common_type<_Tp...>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_COMMON_TYPE_H
diff --git a/libcxx/include/__cxx03/__type_traits/conditional.h b/libcxx/include/__cxx03/__type_traits/conditional.h
index 6f7ca781f0e37..2f76c52766c47 100644
--- a/libcxx/include/__cxx03/__type_traits/conditional.h
+++ b/libcxx/include/__cxx03/__type_traits/conditional.h
@@ -44,11 +44,6 @@ struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
using type _LIBCPP_NODEBUG = _Then;
};
-#if _LIBCPP_STD_VER >= 14
-template <bool _Bp, class _IfRes, class _ElseRes>
-using conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _IfRes, _ElseRes>::type;
-#endif
-
// Helper so we can use "conditional_t" in all language versions.
template <bool _Bp, class _If, class _Then>
using __conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _If, _Then>::type;
diff --git a/libcxx/include/__cxx03/__type_traits/conjunction.h b/libcxx/include/__cxx03/__type_traits/conjunction.h
index af67e8d0899fe..17f4108866651 100644
--- a/libcxx/include/__cxx03/__type_traits/conjunction.h
+++ b/libcxx/include/__cxx03/__type_traits/conjunction.h
@@ -44,22 +44,6 @@ struct __all_dummy;
template <bool... _Pred>
struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...> > {};
-#if _LIBCPP_STD_VER >= 17
-
-template <class...>
-struct conjunction : true_type {};
-
-template <class _Arg>
-struct conjunction<_Arg> : _Arg {};
-
-template <class _Arg, class... _Args>
-struct conjunction<_Arg, _Args...> : conditional_t<!bool(_Arg::value), _Arg, conjunction<_Args...>> {};
-
-template <class... _Args>
-inline constexpr bool conjunction_v = conjunction<_Args...>::value;
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_CONJUNCTION_H
diff --git a/libcxx/include/__cxx03/__type_traits/decay.h b/libcxx/include/__cxx03/__type_traits/decay.h
index bf745a89a1d0f..cf9c30342c5f0 100644
--- a/libcxx/include/__cxx03/__type_traits/decay.h
+++ b/libcxx/include/__cxx03/__type_traits/decay.h
@@ -63,11 +63,6 @@ template <class _Tp>
using __decay_t = typename decay<_Tp>::type;
#endif // __has_builtin(__decay)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using decay_t = __decay_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_DECAY_H
diff --git a/libcxx/include/__cxx03/__type_traits/disjunction.h b/libcxx/include/__cxx03/__type_traits/disjunction.h
index 0ff8218e74196..18880ea686c53 100644
--- a/libcxx/include/__cxx03/__type_traits/disjunction.h
+++ b/libcxx/include/__cxx03/__type_traits/disjunction.h
@@ -43,16 +43,6 @@ struct _OrImpl<false> {
template <class... _Args>
using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
-#if _LIBCPP_STD_VER >= 17
-
-template <class... _Args>
-struct disjunction : _Or<_Args...> {};
-
-template <class... _Args>
-inline constexpr bool disjunction_v = _Or<_Args...>::value;
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_DISJUNCTION_H
diff --git a/libcxx/include/__cxx03/__type_traits/enable_if.h b/libcxx/include/__cxx03/__type_traits/enable_if.h
index 042ad139725dc..f43ac34292ee5 100644
--- a/libcxx/include/__cxx03/__type_traits/enable_if.h
+++ b/libcxx/include/__cxx03/__type_traits/enable_if.h
@@ -27,11 +27,6 @@ struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {
template <bool _Bp, class _Tp = void>
using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
-#if _LIBCPP_STD_VER >= 14
-template <bool _Bp, class _Tp = void>
-using enable_if_t = typename enable_if<_Bp, _Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_ENABLE_IF_H
diff --git a/libcxx/include/__cxx03/__type_traits/extent.h b/libcxx/include/__cxx03/__type_traits/extent.h
index 4d7dd83987683..b78f5cf68d50a 100644
--- a/libcxx/include/__cxx03/__type_traits/extent.h
+++ b/libcxx/include/__cxx03/__type_traits/extent.h
@@ -24,11 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, size_t _Dim = 0>
struct _LIBCPP_TEMPLATE_VIS extent : integral_constant<size_t, __array_extent(_Tp, _Dim)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp, unsigned _Ip = 0>
-inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
-# endif
-
#else // __has_builtin(__array_extent)
template <class _Tp, unsigned _Ip = 0>
@@ -42,11 +37,6 @@ struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0> : public integral_constant<size_
template <class _Tp, size_t _Np, unsigned _Ip>
struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip> : public integral_constant<size_t, extent<_Tp, _Ip - 1>::value> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp, unsigned _Ip = 0>
-inline constexpr size_t extent_v = extent<_Tp, _Ip>::value;
-# endif
-
#endif // __has_builtin(__array_extent)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/has_virtual_destructor.h b/libcxx/include/__cxx03/__type_traits/has_virtual_destructor.h
index 58740ce91ba1f..833e58e4c576f 100644
--- a/libcxx/include/__cxx03/__type_traits/has_virtual_destructor.h
+++ b/libcxx/include/__cxx03/__type_traits/has_virtual_destructor.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
diff --git a/libcxx/include/__cxx03/__type_traits/integral_constant.h b/libcxx/include/__cxx03/__type_traits/integral_constant.h
index 197453747e547..16fb9f60e631a 100644
--- a/libcxx/include/__cxx03/__type_traits/integral_constant.h
+++ b/libcxx/include/__cxx03/__type_traits/integral_constant.h
@@ -23,9 +23,6 @@ struct _LIBCPP_TEMPLATE_VIS integral_constant {
typedef _Tp value_type;
typedef integral_constant type;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT { return value; }
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI constexpr value_type operator()() const _NOEXCEPT { return value; }
-#endif
};
template <class _Tp, _Tp __v>
@@ -37,11 +34,6 @@ typedef integral_constant<bool, false> false_type;
template <bool _Val>
using _BoolConstant _LIBCPP_NODEBUG = integral_constant<bool, _Val>;
-#if _LIBCPP_STD_VER >= 17
-template <bool __b>
-using bool_constant = integral_constant<bool, __b>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_INTEGRAL_CONSTANT_H
diff --git a/libcxx/include/__cxx03/__type_traits/invoke.h b/libcxx/include/__cxx03/__type_traits/invoke.h
index 47220d6c2e629..9ea67475a4f62 100644
--- a/libcxx/include/__cxx03/__type_traits/invoke.h
+++ b/libcxx/include/__cxx03/__type_traits/invoke.h
@@ -181,21 +181,12 @@ struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...> {
template <class _Tp>
static void __test_noexcept(_Tp) _NOEXCEPT;
-#ifdef _LIBCPP_CXX03_LANG
static const bool value = false;
-#else
- static const bool value =
- noexcept(_ThisT::__test_noexcept<_Ret>(std::__invoke(std::declval<_Fp>(), std::declval<_Args>()...)));
-#endif
};
template <class _Ret, class _Fp, class... _Args>
struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...> {
-#ifdef _LIBCPP_CXX03_LANG
static const bool value = false;
-#else
- static const bool value = noexcept(std::__invoke(std::declval<_Fp>(), std::declval<_Args>()...));
-#endif
};
template <class _Ret, class _Fp, class... _Args>
@@ -225,46 +216,6 @@ struct __invoke_void_return_wrapper<_Ret, true> {
}
};
-#if _LIBCPP_STD_VER >= 17
-
-// is_invocable
-
-template <class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
-
-template <class _Ret, class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable_r : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
-
-template <class _Fn, class... _Args>
-inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
-
-template <class _Ret, class _Fn, class... _Args>
-inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
-
-// is_nothrow_invocable
-
-template <class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {
-};
-
-template <class _Ret, class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
- : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
-
-template <class _Fn, class... _Args>
-inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
-
-template <class _Ret, class _Fn, class... _Args>
-inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
-
-template <class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS invoke_result : __invoke_of<_Fn, _Args...> {};
-
-template <class _Fn, class... _Args>
-using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_INVOKE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_abstract.h b/libcxx/include/__cxx03/__type_traits/is_abstract.h
index a98d2b350ba29..528c3727d2337 100644
--- a/libcxx/include/__cxx03/__type_traits/is_abstract.h
+++ b/libcxx/include/__cxx03/__type_traits/is_abstract.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_abstract : public integral_constant<bool, __is_abstract(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_abstract_v = __is_abstract(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_ABSTRACT_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_arithmetic.h b/libcxx/include/__cxx03/__type_traits/is_arithmetic.h
index 8d1e019ce402d..493b025359ffb 100644
--- a/libcxx/include/__cxx03/__type_traits/is_arithmetic.h
+++ b/libcxx/include/__cxx03/__type_traits/is_arithmetic.h
@@ -24,11 +24,6 @@ template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_arithmetic
: public integral_constant<bool, is_integral<_Tp>::value || is_floating_point<_Tp>::value> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_ARITHMETIC_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_array.h b/libcxx/include/__cxx03/__type_traits/is_array.h
index a8dd572ffedec..2f3752f67d98e 100644
--- a/libcxx/include/__cxx03/__type_traits/is_array.h
+++ b/libcxx/include/__cxx03/__type_traits/is_array.h
@@ -25,11 +25,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_array_v = __is_array(_Tp);
-# endif
-
#else
template <class _Tp>
@@ -39,11 +34,6 @@ struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]> : public true_type {};
template <class _Tp, size_t _Np>
struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]> : public true_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_array_v = is_array<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_array)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_assignable.h b/libcxx/include/__cxx03/__type_traits/is_assignable.h
index 6a7364ca6eacd..5b740d2046064 100644
--- a/libcxx/include/__cxx03/__type_traits/is_assignable.h
+++ b/libcxx/include/__cxx03/__type_traits/is_assignable.h
@@ -23,30 +23,15 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Arg>
-inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
: public integral_constant<bool,
__is_assignable(__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_move_assignable
: public integral_constant<bool, __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_ASSIGNABLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_base_of.h b/libcxx/include/__cxx03/__type_traits/is_base_of.h
index 67f72731903c0..25fe555a49e35 100644
--- a/libcxx/include/__cxx03/__type_traits/is_base_of.h
+++ b/libcxx/include/__cxx03/__type_traits/is_base_of.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Bp, class _Dp>
struct _LIBCPP_TEMPLATE_VIS is_base_of : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Bp, class _Dp>
-inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_BASE_OF_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_bounded_array.h b/libcxx/include/__cxx03/__type_traits/is_bounded_array.h
index b4b3aabec381b..c1e464c1c7241 100644
--- a/libcxx/include/__cxx03/__type_traits/is_bounded_array.h
+++ b/libcxx/include/__cxx03/__type_traits/is_bounded_array.h
@@ -24,18 +24,6 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array : false_type {};
template <class _Tp, size_t _Np>
struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array<_Tp[_Np]> : true_type {};
-#if _LIBCPP_STD_VER >= 20
-
-template <class>
-struct _LIBCPP_TEMPLATE_VIS is_bounded_array : false_type {};
-template <class _Tp, size_t _Np>
-struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
-
-template <class _Tp>
-inline constexpr bool is_bounded_array_v = is_bounded_array<_Tp>::value;
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_class.h b/libcxx/include/__cxx03/__type_traits/is_class.h
index 7109198cf6598..3bcadd6b7531b 100644
--- a/libcxx/include/__cxx03/__type_traits/is_class.h
+++ b/libcxx/include/__cxx03/__type_traits/is_class.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_class : public integral_constant<bool, __is_class(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_class_v = __is_class(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_CLASS_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_compound.h b/libcxx/include/__cxx03/__type_traits/is_compound.h
index 4a96a71a2f965..ac87b1d461dbb 100644
--- a/libcxx/include/__cxx03/__type_traits/is_compound.h
+++ b/libcxx/include/__cxx03/__type_traits/is_compound.h
@@ -24,21 +24,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_compound_v = __is_compound(_Tp);
-# endif
-
#else // __has_builtin(__is_compound)
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_compound_v = is_compound<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_compound)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_const.h b/libcxx/include/__cxx03/__type_traits/is_const.h
index ebd91c5f07c1d..a6d852ac7e223 100644
--- a/libcxx/include/__cxx03/__type_traits/is_const.h
+++ b/libcxx/include/__cxx03/__type_traits/is_const.h
@@ -23,11 +23,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_const_v = __is_const(_Tp);
-# endif
-
#else
template <class _Tp>
@@ -35,11 +30,6 @@ struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_const_v = is_const<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_const)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_constant_evaluated.h b/libcxx/include/__cxx03/__type_traits/is_constant_evaluated.h
index 99ebef6664ed9..e091b8c576025 100644
--- a/libcxx/include/__cxx03/__type_traits/is_constant_evaluated.h
+++ b/libcxx/include/__cxx03/__type_traits/is_constant_evaluated.h
@@ -17,12 +17,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_constant_evaluated() noexcept {
- return __builtin_is_constant_evaluated();
-}
-#endif
-
_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR bool __libcpp_is_constant_evaluated() _NOEXCEPT {
return __builtin_is_constant_evaluated();
}
diff --git a/libcxx/include/__cxx03/__type_traits/is_constructible.h b/libcxx/include/__cxx03/__type_traits/is_constructible.h
index 435b0fcefea8a..c8c0eaa4e8989 100644
--- a/libcxx/include/__cxx03/__type_traits/is_constructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_constructible.h
@@ -23,37 +23,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_constructible : public integral_constant<bool, __is_constructible(_Tp, _Args...)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class... _Args>
-inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
: public integral_constant<bool, __is_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_move_constructible
: public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_default_constructible : public integral_constant<bool, __is_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_default_constructible_v = __is_constructible(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_IS_CONSTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_convertible.h b/libcxx/include/__cxx03/__type_traits/is_convertible.h
index 4692b0f4ac5f4..c805c82467a18 100644
--- a/libcxx/include/__cxx03/__type_traits/is_convertible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_convertible.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant<bool, __is_convertible(_T1, _T2)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _From, class _To>
-inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_CONVERTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_destructible.h b/libcxx/include/__cxx03/__type_traits/is_destructible.h
index c2565050151c4..35b4cb824b3d1 100644
--- a/libcxx/include/__cxx03/__type_traits/is_destructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_destructible.h
@@ -27,11 +27,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_destructible_v = __is_destructible(_Tp);
-# endif
-
#else // __has_builtin(__is_destructible)
// if it's a reference, return true
@@ -85,11 +80,6 @@ struct is_destructible<_Tp[]> : public false_type {};
template <>
struct is_destructible<void> : public false_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_destructible_v = is_destructible<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_destructible)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_empty.h b/libcxx/include/__cxx03/__type_traits/is_empty.h
index 767b155aa626b..841684f7d008b 100644
--- a/libcxx/include/__cxx03/__type_traits/is_empty.h
+++ b/libcxx/include/__cxx03/__type_traits/is_empty.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_empty : public integral_constant<bool, __is_empty(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_empty_v = __is_empty(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_EMPTY_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_enum.h b/libcxx/include/__cxx03/__type_traits/is_enum.h
index 54efb15b0d01e..85e975454ae68 100644
--- a/libcxx/include/__cxx03/__type_traits/is_enum.h
+++ b/libcxx/include/__cxx03/__type_traits/is_enum.h
@@ -21,21 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_enum : public integral_constant<bool, __is_enum(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_enum_v = __is_enum(_Tp);
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_scoped_enum : bool_constant<__is_scoped_enum(_Tp)> {};
-
-template <class _Tp>
-inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
-
-#endif // _LIBCPP_STD_VER >= 23
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_ENUM_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_execution_policy.h b/libcxx/include/__cxx03/__type_traits/is_execution_policy.h
index 08bf8b00d97ea..f7aba04c2fbd7 100644
--- a/libcxx/include/__cxx03/__type_traits/is_execution_policy.h
+++ b/libcxx/include/__cxx03/__type_traits/is_execution_policy.h
@@ -16,44 +16,4 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER >= 17
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class>
-inline constexpr bool is_execution_policy_v = false;
-
-template <class>
-inline constexpr bool __is_unsequenced_execution_policy_impl = false;
-
-template <class _Tp>
-inline constexpr bool __is_unsequenced_execution_policy_v =
- __is_unsequenced_execution_policy_impl<__remove_cvref_t<_Tp>>;
-
-template <class>
-inline constexpr bool __is_parallel_execution_policy_impl = false;
-
-template <class _Tp>
-inline constexpr bool __is_parallel_execution_policy_v = __is_parallel_execution_policy_impl<__remove_cvref_t<_Tp>>;
-
-namespace execution {
-struct __disable_user_instantiations_tag {
- explicit __disable_user_instantiations_tag() = default;
-};
-} // namespace execution
-
-// TODO: Remove default argument once algorithms are using the new backend dispatching
-template <class _ExecutionPolicy>
-_LIBCPP_HIDE_FROM_ABI auto
-__remove_parallel_policy(const _ExecutionPolicy& = _ExecutionPolicy{execution::__disable_user_instantiations_tag{}});
-
-// Removes the "parallel" part of an execution policy.
-// For example, turns par_unseq into unseq, and par into seq.
-template <class _ExecutionPolicy>
-using __remove_parallel_policy_t = decltype(std::__remove_parallel_policy<_ExecutionPolicy>());
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER >= 17
-
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_EXECUTION_POLICY_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_final.h b/libcxx/include/__cxx03/__type_traits/is_final.h
index c6e5ad0893a0e..9a063808f2b7c 100644
--- a/libcxx/include/__cxx03/__type_traits/is_final.h
+++ b/libcxx/include/__cxx03/__type_traits/is_final.h
@@ -21,16 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS __libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_final : public integral_constant<bool, __is_final(_Tp)> {};
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_final_v = __is_final(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_FINAL_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_floating_point.h b/libcxx/include/__cxx03/__type_traits/is_floating_point.h
index 6b25659c9ee26..ea3578af05dd3 100644
--- a/libcxx/include/__cxx03/__type_traits/is_floating_point.h
+++ b/libcxx/include/__cxx03/__type_traits/is_floating_point.h
@@ -29,11 +29,6 @@ template <> struct __libcpp_is_floating_point<long double> : public tru
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_floating_point : public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_FLOATING_POINT_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_function.h b/libcxx/include/__cxx03/__type_traits/is_function.h
index 3001c4bef9f54..ee54173f5bd43 100644
--- a/libcxx/include/__cxx03/__type_traits/is_function.h
+++ b/libcxx/include/__cxx03/__type_traits/is_function.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_function : integral_constant<bool, __is_function(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_function_v = __is_function(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_FUNCTIONAL_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_fundamental.h b/libcxx/include/__cxx03/__type_traits/is_fundamental.h
index 329325ecca4bd..4578952f2ad62 100644
--- a/libcxx/include/__cxx03/__type_traits/is_fundamental.h
+++ b/libcxx/include/__cxx03/__type_traits/is_fundamental.h
@@ -25,22 +25,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_fundamental_v = __is_fundamental(_Tp);
-# endif
-
#else // __has_builtin(__is_fundamental)
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_fundamental
: public integral_constant<bool, is_void<_Tp>::value || __is_null_pointer_v<_Tp> || is_arithmetic<_Tp>::value> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_fundamental)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_implicitly_default_constructible.h b/libcxx/include/__cxx03/__type_traits/is_implicitly_default_constructible.h
index 23f1443e408f9..e0f86c2377604 100644
--- a/libcxx/include/__cxx03/__type_traits/is_implicitly_default_constructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_implicitly_default_constructible.h
@@ -19,28 +19,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-// First of all, we can't implement this check in C++03 mode because the {}
-// default initialization syntax isn't valid.
-// Second, we implement the trait in a funny manner with two defaulted template
-// arguments to workaround Clang's PR43454.
-template <class _Tp>
-void __test_implicit_default_constructible(_Tp);
-
-template <class _Tp, class = void, class = typename is_default_constructible<_Tp>::type>
-struct __is_implicitly_default_constructible : false_type {};
-
-template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp,
- decltype(std::__test_implicit_default_constructible<_Tp const&>({})),
- true_type> : true_type {};
-
-template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp,
- decltype(std::__test_implicit_default_constructible<_Tp const&>({})),
- false_type> : false_type {};
-#endif // !C++03
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_IMPLICITLY_DEFAULT_CONSTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_integral.h b/libcxx/include/__cxx03/__type_traits/is_integral.h
index 1adcdcbce63e9..36c4aa58a3744 100644
--- a/libcxx/include/__cxx03/__type_traits/is_integral.h
+++ b/libcxx/include/__cxx03/__type_traits/is_integral.h
@@ -52,21 +52,11 @@ template <> struct __libcpp_is_integral<__uint128_t> { enum { va
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_integral_v = __is_integral(_Tp);
-# endif
-
#else
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_integral : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_integral_v = is_integral<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_integral)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_literal_type.h b/libcxx/include/__cxx03/__type_traits/is_literal_type.h
index 6d0c9a6d6c30a..5c15a6c395f48 100644
--- a/libcxx/include/__cxx03/__type_traits/is_literal_type.h
+++ b/libcxx/include/__cxx03/__type_traits/is_literal_type.h
@@ -18,17 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS
_LIBCPP_DEPRECATED_IN_CXX17 is_literal_type : public integral_constant<bool, __is_literal_type(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX17 inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);
-# endif // _LIBCPP_STD_VER >= 17
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_LITERAL_TYPE
diff --git a/libcxx/include/__cxx03/__type_traits/is_member_pointer.h b/libcxx/include/__cxx03/__type_traits/is_member_pointer.h
index 334b794f879a1..25100a47e6ac1 100644
--- a/libcxx/include/__cxx03/__type_traits/is_member_pointer.h
+++ b/libcxx/include/__cxx03/__type_traits/is_member_pointer.h
@@ -27,17 +27,6 @@ struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer : _BoolConstant<__is_member
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer : _BoolConstant<__is_member_function_pointer(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
-
-template <class _Tp>
-inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp);
-
-template <class _Tp>
-inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_MEMBER_POINTER_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_nothrow_assignable.h b/libcxx/include/__cxx03/__type_traits/is_nothrow_assignable.h
index 64b525e254e1f..d62325626e8c2 100644
--- a/libcxx/include/__cxx03/__type_traits/is_nothrow_assignable.h
+++ b/libcxx/include/__cxx03/__type_traits/is_nothrow_assignable.h
@@ -24,33 +24,18 @@ template <class _Tp, class _Arg>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Arg>
-inline constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_Tp, _Arg);
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
: public integral_constant<
bool,
__is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
: public integral_constant<bool,
__is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_nothrow_constructible.h b/libcxx/include/__cxx03/__type_traits/is_nothrow_constructible.h
index b528cc7b491d7..cbcf355398db1 100644
--- a/libcxx/include/__cxx03/__type_traits/is_nothrow_constructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_nothrow_constructible.h
@@ -24,38 +24,18 @@ template < class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class... _Args>
-inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
: public integral_constant< bool, __is_nothrow_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
: public integral_constant<bool, __is_nothrow_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
: public integral_constant<bool, __is_nothrow_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_nothrow_destructible.h b/libcxx/include/__cxx03/__type_traits/is_nothrow_destructible.h
index 23a28c9bb1da0..317aceec2d60e 100644
--- a/libcxx/include/__cxx03/__type_traits/is_nothrow_destructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_nothrow_destructible.h
@@ -53,11 +53,6 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> : public true_type {}
#endif // __has_builtin(__is_nothrow_destructible)
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_null_pointer.h b/libcxx/include/__cxx03/__type_traits/is_null_pointer.h
index acbf0c16a9643..4a2bcf678a7cd 100644
--- a/libcxx/include/__cxx03/__type_traits/is_null_pointer.h
+++ b/libcxx/include/__cxx03/__type_traits/is_null_pointer.h
@@ -22,16 +22,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
inline const bool __is_null_pointer_v = __is_same(__remove_cv(_Tp), nullptr_t);
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_null_pointer : integral_constant<bool, __is_null_pointer_v<_Tp>> {};
-
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_null_pointer_v = __is_null_pointer_v<_Tp>;
-# endif
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_NULL_POINTER_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_object.h b/libcxx/include/__cxx03/__type_traits/is_object.h
index 09d893d11220c..c2f95d71d7ef5 100644
--- a/libcxx/include/__cxx03/__type_traits/is_object.h
+++ b/libcxx/include/__cxx03/__type_traits/is_object.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_object_v = __is_object(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_OBJECT_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_pod.h b/libcxx/include/__cxx03/__type_traits/is_pod.h
index 4b4e9cc3eb19f..8956fc76a2a92 100644
--- a/libcxx/include/__cxx03/__type_traits/is_pod.h
+++ b/libcxx/include/__cxx03/__type_traits/is_pod.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_pod : public integral_constant<bool, __is_pod(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_pod_v = __is_pod(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_POD_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_pointer.h b/libcxx/include/__cxx03/__type_traits/is_pointer.h
index 8ce1421921499..bc4d47f641b4a 100644
--- a/libcxx/include/__cxx03/__type_traits/is_pointer.h
+++ b/libcxx/include/__cxx03/__type_traits/is_pointer.h
@@ -24,11 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_pointer_v = __is_pointer(_Tp);
-# endif
-
#else // __has_builtin(__is_pointer)
template <class _Tp>
@@ -53,11 +48,6 @@ template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_pointer
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<__remove_cv_t<_Tp> >::type> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_pointer)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_polymorphic.h b/libcxx/include/__cxx03/__type_traits/is_polymorphic.h
index 206abd871915f..d3c9f40e0170a 100644
--- a/libcxx/include/__cxx03/__type_traits/is_polymorphic.h
+++ b/libcxx/include/__cxx03/__type_traits/is_polymorphic.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_polymorphic : public integral_constant<bool, __is_polymorphic(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_POLYMORPHIC_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_reference.h b/libcxx/include/__cxx03/__type_traits/is_reference.h
index 72bdf1418f2f3..cef696530ffdd 100644
--- a/libcxx/include/__cxx03/__type_traits/is_reference.h
+++ b/libcxx/include/__cxx03/__type_traits/is_reference.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_reference_v = __is_reference(_Tp);
-#endif
-
#if __has_builtin(__is_lvalue_reference) && __has_builtin(__is_rvalue_reference)
template <class _Tp>
@@ -34,13 +29,6 @@ struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_refe
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_lvalue_reference_v = __is_lvalue_reference(_Tp);
-template <class _Tp>
-inline constexpr bool is_rvalue_reference_v = __is_rvalue_reference(_Tp);
-# endif
-
#else // __has_builtin(__is_lvalue_reference)
template <class _Tp>
@@ -53,14 +41,6 @@ struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_lvalue_reference_v = is_lvalue_reference<_Tp>::value;
-
-template <class _Tp>
-inline constexpr bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_lvalue_reference)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_same.h b/libcxx/include/__cxx03/__type_traits/is_same.h
index d365e1235e7c6..e1e5c7c964f6e 100644
--- a/libcxx/include/__cxx03/__type_traits/is_same.h
+++ b/libcxx/include/__cxx03/__type_traits/is_same.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Up>
-inline constexpr bool is_same_v = __is_same(_Tp, _Up);
-#endif
-
// _IsSame<T,U> has the same effect as is_same<T,U> but instantiates fewer types:
// is_same<A,B> and is_same<C,D> are guaranteed to be different types, but
// _IsSame<A,B> and _IsSame<C,D> are the same type (namely, false_type).
diff --git a/libcxx/include/__cxx03/__type_traits/is_scalar.h b/libcxx/include/__cxx03/__type_traits/is_scalar.h
index b12e045f053a4..3a32a6bd982e1 100644
--- a/libcxx/include/__cxx03/__type_traits/is_scalar.h
+++ b/libcxx/include/__cxx03/__type_traits/is_scalar.h
@@ -28,11 +28,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_scalar_v = __is_scalar(_Tp);
-# endif
-
#else // __has_builtin(__is_scalar)
template <class _Tp>
@@ -57,11 +52,6 @@ struct _LIBCPP_TEMPLATE_VIS is_scalar
template <>
struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_scalar)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_signed.h b/libcxx/include/__cxx03/__type_traits/is_signed.h
index 20613cf63f7d0..3242e8b2ebb14 100644
--- a/libcxx/include/__cxx03/__type_traits/is_signed.h
+++ b/libcxx/include/__cxx03/__type_traits/is_signed.h
@@ -25,11 +25,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_signed_v = __is_signed(_Tp);
-# endif
-
#else // __has_builtin(__is_signed)
template <class _Tp, bool = is_integral<_Tp>::value>
@@ -47,11 +42,6 @@ struct __libcpp_is_signed<_Tp, false> : public false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_signed_v = is_signed<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_signed)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_specialization.h b/libcxx/include/__cxx03/__type_traits/is_specialization.h
index b1946df29587b..4c46ccae7f681 100644
--- a/libcxx/include/__cxx03/__type_traits/is_specialization.h
+++ b/libcxx/include/__cxx03/__type_traits/is_specialization.h
@@ -30,16 +30,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-
-template <class _Tp, template <class...> class _Template>
-inline constexpr bool __is_specialization_v = false; // true if and only if _Tp is a specialization of _Template
-
-template <template <class...> class _Template, class... _Args>
-inline constexpr bool __is_specialization_v<_Template<_Args...>, _Template> = true;
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_SPECIALIZATION
diff --git a/libcxx/include/__cxx03/__type_traits/is_standard_layout.h b/libcxx/include/__cxx03/__type_traits/is_standard_layout.h
index 22889d5ff9a38..48d45070cc3be 100644
--- a/libcxx/include/__cxx03/__type_traits/is_standard_layout.h
+++ b/libcxx/include/__cxx03/__type_traits/is_standard_layout.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_standard_layout : public integral_constant<bool, __is_standard_layout(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_swappable.h b/libcxx/include/__cxx03/__type_traits/is_swappable.h
index c3119c3de0895..7b87a95446cc5 100644
--- a/libcxx/include/__cxx03/__type_traits/is_swappable.h
+++ b/libcxx/include/__cxx03/__type_traits/is_swappable.h
@@ -38,13 +38,8 @@ inline const bool __is_nothrow_swappable_with_v = false;
template <class _Tp>
inline const bool __is_nothrow_swappable_v = __is_nothrow_swappable_with_v<_Tp&, _Tp&>;
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp>
-using __swap_result_t = __enable_if_t<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>;
-#else
template <class>
using __swap_result_t = void;
-#endif
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y)
@@ -62,43 +57,6 @@ inline const bool __is_swappable_with_v<_Tp,
__void_t<decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))> > = true;
-#ifndef _LIBCPP_CXX03_LANG // C++03 doesn't have noexcept, so things are never nothrow swappable
-template <class _Tp, class _Up>
-inline const bool __is_nothrow_swappable_with_v<_Tp, _Up, true> =
- noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())) &&
- noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()));
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-
-template <class _Tp, class _Up>
-inline constexpr bool is_swappable_with_v = __is_swappable_with_v<_Tp, _Up>;
-
-template <class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_swappable_with : bool_constant<is_swappable_with_v<_Tp, _Up>> {};
-
-template <class _Tp>
-inline constexpr bool is_swappable_v =
- is_swappable_with_v<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp>>;
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_swappable : bool_constant<is_swappable_v<_Tp>> {};
-
-template <class _Tp, class _Up>
-inline constexpr bool is_nothrow_swappable_with_v = __is_nothrow_swappable_with_v<_Tp, _Up>;
-
-template <class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with : bool_constant<is_nothrow_swappable_with_v<_Tp, _Up>> {};
-
-template <class _Tp>
-inline constexpr bool is_nothrow_swappable_v =
- is_nothrow_swappable_with_v<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp>>;
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable : bool_constant<is_nothrow_swappable_v<_Tp>> {};
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_SWAPPABLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_trivial.h b/libcxx/include/__cxx03/__type_traits/is_trivial.h
index e998255b813c5..2c6ab41b96e3d 100644
--- a/libcxx/include/__cxx03/__type_traits/is_trivial.h
+++ b/libcxx/include/__cxx03/__type_traits/is_trivial.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivial : public integral_constant<bool, __is_trivial(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivial_v = __is_trivial(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_TRIVIAL_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_trivially_assignable.h b/libcxx/include/__cxx03/__type_traits/is_trivially_assignable.h
index 180e05de2b4ba..bfa67e5abdbe9 100644
--- a/libcxx/include/__cxx03/__type_traits/is_trivially_assignable.h
+++ b/libcxx/include/__cxx03/__type_traits/is_trivially_assignable.h
@@ -24,33 +24,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Arg>
struct is_trivially_assignable : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class _Arg>
-inline constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_Tp, _Arg);
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
: public integral_constant<
bool,
__is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
: public integral_constant<
bool,
__is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_trivially_constructible.h b/libcxx/include/__cxx03/__type_traits/is_trivially_constructible.h
index a47e6d9031a53..b30582e2b3775 100644
--- a/libcxx/include/__cxx03/__type_traits/is_trivially_constructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_trivially_constructible.h
@@ -24,38 +24,18 @@ template <class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
: integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class... _Args>
-inline constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Tp, _Args...);
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value;
-#endif
-
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
: public integral_constant<bool, __is_trivially_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_trivially_copyable.h b/libcxx/include/__cxx03/__type_traits/is_trivially_copyable.h
index 67a55e86e6b00..bec189c37ecd7 100644
--- a/libcxx/include/__cxx03/__type_traits/is_trivially_copyable.h
+++ b/libcxx/include/__cxx03/__type_traits/is_trivially_copyable.h
@@ -22,16 +22,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable : public integral_constant<bool, __is_trivially_copyable(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-inline constexpr bool __is_cheap_to_copy = is_trivially_copyable_v<_Tp> && sizeof(_Tp) <= sizeof(std::intmax_t);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_trivially_destructible.h b/libcxx/include/__cxx03/__type_traits/is_trivially_destructible.h
index 1dbd9e86a0691..20b2df3d3b581 100644
--- a/libcxx/include/__cxx03/__type_traits/is_trivially_destructible.h
+++ b/libcxx/include/__cxx03/__type_traits/is_trivially_destructible.h
@@ -37,11 +37,6 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
#endif // __has_builtin(__is_trivially_destructible)
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_unbounded_array.h b/libcxx/include/__cxx03/__type_traits/is_unbounded_array.h
index d11a8094e9c13..77c051b1d436a 100644
--- a/libcxx/include/__cxx03/__type_traits/is_unbounded_array.h
+++ b/libcxx/include/__cxx03/__type_traits/is_unbounded_array.h
@@ -23,18 +23,6 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array : false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array<_Tp[]> : true_type {};
-#if _LIBCPP_STD_VER >= 20
-
-template <class>
-struct _LIBCPP_TEMPLATE_VIS is_unbounded_array : false_type {};
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
-
-template <class _Tp>
-inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_union.h b/libcxx/include/__cxx03/__type_traits/is_union.h
index eaa222efde036..6e69fc01952a3 100644
--- a/libcxx/include/__cxx03/__type_traits/is_union.h
+++ b/libcxx/include/__cxx03/__type_traits/is_union.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_union : public integral_constant<bool, __is_union(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_union_v = __is_union(_Tp);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_UNION_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_unsigned.h b/libcxx/include/__cxx03/__type_traits/is_unsigned.h
index 99f888fb45bef..38bd6d86f6258 100644
--- a/libcxx/include/__cxx03/__type_traits/is_unsigned.h
+++ b/libcxx/include/__cxx03/__type_traits/is_unsigned.h
@@ -25,11 +25,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_unsigned_v = __is_unsigned(_Tp);
-# endif
-
#else // __has_builtin(__is_unsigned)
template <class _Tp, bool = is_integral<_Tp>::value>
@@ -47,11 +42,6 @@ struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_unsigned)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/is_void.h b/libcxx/include/__cxx03/__type_traits/is_void.h
index 0f5e9cae179ce..25dbcd82d976d 100644
--- a/libcxx/include/__cxx03/__type_traits/is_void.h
+++ b/libcxx/include/__cxx03/__type_traits/is_void.h
@@ -21,11 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_same(__remove_cv(_Tp), void)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_void_v = __is_same(__remove_cv(_Tp), void);
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_IS_VOID_H
diff --git a/libcxx/include/__cxx03/__type_traits/is_volatile.h b/libcxx/include/__cxx03/__type_traits/is_volatile.h
index 75b6b49122ed8..b06598200ab86 100644
--- a/libcxx/include/__cxx03/__type_traits/is_volatile.h
+++ b/libcxx/include/__cxx03/__type_traits/is_volatile.h
@@ -23,11 +23,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_volatile_v = __is_volatile(_Tp);
-# endif
-
#else
template <class _Tp>
@@ -35,11 +30,6 @@ struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
-# if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr bool is_volatile_v = is_volatile<_Tp>::value;
-# endif
-
#endif // __has_builtin(__is_volatile)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/make_32_64_or_128_bit.h b/libcxx/include/__cxx03/__type_traits/make_32_64_or_128_bit.h
index 918a4c1db69d7..3f4bfc04087d3 100644
--- a/libcxx/include/__cxx03/__type_traits/make_32_64_or_128_bit.h
+++ b/libcxx/include/__cxx03/__type_traits/make_32_64_or_128_bit.h
@@ -27,9 +27,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
///
/// The restriction is the same as the integral version of to_char.
template <class _Tp>
-#if _LIBCPP_STD_VER >= 20
- requires(is_signed_v<_Tp> || is_unsigned_v<_Tp> || is_same_v<_Tp, char>)
-#endif
// clang-format off
using __make_32_64_or_128_bit_t =
__copy_unsigned_t<_Tp,
diff --git a/libcxx/include/__cxx03/__type_traits/make_signed.h b/libcxx/include/__cxx03/__type_traits/make_signed.h
index fb359441ee6e5..a701233093824 100644
--- a/libcxx/include/__cxx03/__type_traits/make_signed.h
+++ b/libcxx/include/__cxx03/__type_traits/make_signed.h
@@ -79,11 +79,6 @@ struct make_signed {
using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using make_signed_t = __make_signed_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_MAKE_SIGNED_H
diff --git a/libcxx/include/__cxx03/__type_traits/make_unsigned.h b/libcxx/include/__cxx03/__type_traits/make_unsigned.h
index 3e2105242b665..fe355a460d7c2 100644
--- a/libcxx/include/__cxx03/__type_traits/make_unsigned.h
+++ b/libcxx/include/__cxx03/__type_traits/make_unsigned.h
@@ -81,18 +81,6 @@ struct make_unsigned {
using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>;
};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using make_unsigned_t = __make_unsigned_t<_Tp>;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr __make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept {
- return static_cast<__make_unsigned_t<_Tp> >(__x);
-}
-#endif
-
template <class _Tp, class _Up>
using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, __make_unsigned_t<_Up>, _Up>;
diff --git a/libcxx/include/__cxx03/__type_traits/nat.h b/libcxx/include/__cxx03/__type_traits/nat.h
index f45a7aadb3c79..9dee997e0d3d6 100644
--- a/libcxx/include/__cxx03/__type_traits/nat.h
+++ b/libcxx/include/__cxx03/__type_traits/nat.h
@@ -17,14 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-struct __nat {
-#ifndef _LIBCPP_CXX03_LANG
- __nat() = delete;
- __nat(const __nat&) = delete;
- __nat& operator=(const __nat&) = delete;
- ~__nat() = delete;
-#endif
-};
+struct __nat {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/negation.h b/libcxx/include/__cxx03/__type_traits/negation.h
index d9b290e2e35d6..247db7c92ec92 100644
--- a/libcxx/include/__cxx03/__type_traits/negation.h
+++ b/libcxx/include/__cxx03/__type_traits/negation.h
@@ -21,13 +21,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Pred>
struct _Not : _BoolConstant<!_Pred::value> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-struct negation : _Not<_Tp> {};
-template <class _Tp>
-inline constexpr bool negation_v = !_Tp::value;
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_NEGATION_H
diff --git a/libcxx/include/__cxx03/__type_traits/noexcept_move_assign_container.h b/libcxx/include/__cxx03/__type_traits/noexcept_move_assign_container.h
index d275ed585678b..607acd4df1f39 100644
--- a/libcxx/include/__cxx03/__type_traits/noexcept_move_assign_container.h
+++ b/libcxx/include/__cxx03/__type_traits/noexcept_move_assign_container.h
@@ -23,14 +23,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <typename _Alloc, typename _Traits = allocator_traits<_Alloc> >
struct __noexcept_move_assign_container
: public integral_constant<bool,
- _Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER >= 17
- || _Traits::is_always_equal::value
-#else
- && is_nothrow_move_assignable<_Alloc>::value
-#endif
- > {
-};
+ _Traits::propagate_on_container_move_assignment::value &&
+ is_nothrow_move_assignable<_Alloc>::value> {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/rank.h b/libcxx/include/__cxx03/__type_traits/rank.h
index a6b2598f6d7ca..d8a98d7e57068 100644
--- a/libcxx/include/__cxx03/__type_traits/rank.h
+++ b/libcxx/include/__cxx03/__type_traits/rank.h
@@ -36,11 +36,6 @@ struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]> : public integral_constant<size_t, ra
#endif // __has_builtin(__array_rank)
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-inline constexpr size_t rank_v = rank<_Tp>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_RANK_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_all_extents.h b/libcxx/include/__cxx03/__type_traits/remove_all_extents.h
index 9a1fd0c7fb5bb..b10fb56a0ab40 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_all_extents.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_all_extents.h
@@ -44,11 +44,6 @@ template <class _Tp>
using __remove_all_extents_t = typename remove_all_extents<_Tp>::type;
#endif // __has_builtin(__remove_all_extents)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_all_extents_t = __remove_all_extents_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_const.h b/libcxx/include/__cxx03/__type_traits/remove_const.h
index 885563bfcfbe3..19dad1eb63a86 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_const.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_const.h
@@ -39,11 +39,6 @@ template <class _Tp>
using __remove_const_t = typename remove_const<_Tp>::type;
#endif // __has_builtin(__remove_const)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_const_t = __remove_const_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_CONST_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_cv.h b/libcxx/include/__cxx03/__type_traits/remove_cv.h
index 1612d24464a8c..74b17a69fc84d 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_cv.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_cv.h
@@ -37,11 +37,6 @@ template <class _Tp>
using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >;
#endif // __has_builtin(__remove_cv)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_cv_t = __remove_cv_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_CV_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_cvref.h b/libcxx/include/__cxx03/__type_traits/remove_cvref.h
index 907622efe1a67..488ee091948f5 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_cvref.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_cvref.h
@@ -31,16 +31,6 @@ using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t<__libcpp_remove_reference
template <class _Tp, class _Up>
struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {};
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-struct remove_cvref {
- using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
-};
-
-template <class _Tp>
-using remove_cvref_t = __remove_cvref_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_CVREF_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_extent.h b/libcxx/include/__cxx03/__type_traits/remove_extent.h
index 31a2535dca88a..af1f499195be1 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_extent.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_extent.h
@@ -44,11 +44,6 @@ template <class _Tp>
using __remove_extent_t = typename remove_extent<_Tp>::type;
#endif // __has_builtin(__remove_extent)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_extent_t = __remove_extent_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_EXTENT_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_pointer.h b/libcxx/include/__cxx03/__type_traits/remove_pointer.h
index 4d689f67d1765..4e8562697f9a6 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_pointer.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_pointer.h
@@ -43,11 +43,6 @@ template <class _Tp>
using __remove_pointer_t = typename remove_pointer<_Tp>::type;
#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_pointer_t = __remove_pointer_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_POINTER_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_reference.h b/libcxx/include/__cxx03/__type_traits/remove_reference.h
index cd500ff761e28..215756bc22262 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_reference.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_reference.h
@@ -37,11 +37,6 @@ using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
# error "remove_reference not implemented!"
#endif // __has_builtin(__remove_reference_t)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_REFERENCE_H
diff --git a/libcxx/include/__cxx03/__type_traits/remove_volatile.h b/libcxx/include/__cxx03/__type_traits/remove_volatile.h
index 3c7e041398046..4efb35f763be2 100644
--- a/libcxx/include/__cxx03/__type_traits/remove_volatile.h
+++ b/libcxx/include/__cxx03/__type_traits/remove_volatile.h
@@ -39,11 +39,6 @@ template <class _Tp>
using __remove_volatile_t = typename remove_volatile<_Tp>::type;
#endif // __has_builtin(__remove_volatile)
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using remove_volatile_t = __remove_volatile_t<_Tp>;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_REMOVE_VOLATILE_H
diff --git a/libcxx/include/__cxx03/__type_traits/result_of.h b/libcxx/include/__cxx03/__type_traits/result_of.h
index 36d4180346547..4890c15592f1d 100644
--- a/libcxx/include/__cxx03/__type_traits/result_of.h
+++ b/libcxx/include/__cxx03/__type_traits/result_of.h
@@ -20,19 +20,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// result_of
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
template <class _Callable>
class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
template <class _Fp, class... _Args>
class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)> : public __invoke_of<_Fp, _Args...> {};
-# if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
-# endif // _LIBCPP_STD_VER >= 14
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_RESULT_OF_H
diff --git a/libcxx/include/__cxx03/__type_traits/strip_signature.h b/libcxx/include/__cxx03/__type_traits/strip_signature.h
index 2e7736609bf17..003bd20245637 100644
--- a/libcxx/include/__cxx03/__type_traits/strip_signature.h
+++ b/libcxx/include/__cxx03/__type_traits/strip_signature.h
@@ -15,67 +15,4 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER >= 17
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Fp>
-struct __strip_signature;
-
-# if defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L
-
-template <class _Rp, class... _Args>
-struct __strip_signature<_Rp (*)(_Args...)> {
- using type = _Rp(_Args...);
-};
-
-template <class _Rp, class... _Args>
-struct __strip_signature<_Rp (*)(_Args...) noexcept> {
- using type = _Rp(_Args...);
-};
-
-# endif // defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L
-
-// clang-format off
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); };
-// clang-format on
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER >= 17
-
#endif // _LIBCPP___CXX03___TYPE_TRAITS_STRIP_SIGNATURE_H
diff --git a/libcxx/include/__cxx03/__type_traits/type_identity.h b/libcxx/include/__cxx03/__type_traits/type_identity.h
index 1ff01002509de..64c7b0960ae62 100644
--- a/libcxx/include/__cxx03/__type_traits/type_identity.h
+++ b/libcxx/include/__cxx03/__type_traits/type_identity.h
@@ -25,15 +25,6 @@ struct __type_identity {
template <class _Tp>
using __type_identity_t _LIBCPP_NODEBUG = typename __type_identity<_Tp>::type;
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp>
-struct type_identity {
- typedef _Tp type;
-};
-template <class _Tp>
-using type_identity_t = typename type_identity<_Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_TYPE_IDENTITY_H
diff --git a/libcxx/include/__cxx03/__type_traits/underlying_type.h b/libcxx/include/__cxx03/__type_traits/underlying_type.h
index 6e82ff83a6f71..a79a7161cddca 100644
--- a/libcxx/include/__cxx03/__type_traits/underlying_type.h
+++ b/libcxx/include/__cxx03/__type_traits/underlying_type.h
@@ -32,11 +32,6 @@ struct __underlying_type_impl<_Tp, true> {
template <class _Tp>
struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {};
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp>
-using underlying_type_t = typename underlying_type<_Tp>::type;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___TYPE_TRAITS_UNDERLYING_TYPE_H
diff --git a/libcxx/include/__cxx03/__type_traits/unwrap_ref.h b/libcxx/include/__cxx03/__type_traits/unwrap_ref.h
index a5628ece8de31..836fce1381ed9 100644
--- a/libcxx/include/__cxx03/__type_traits/unwrap_ref.h
+++ b/libcxx/include/__cxx03/__type_traits/unwrap_ref.h
@@ -29,29 +29,8 @@ struct __unwrap_reference<reference_wrapper<_Tp> > {
typedef _LIBCPP_NODEBUG _Tp& type;
};
-#if _LIBCPP_STD_VER >= 20
template <class _Tp>
-struct unwrap_reference : __unwrap_reference<_Tp> {};
-
-template <class _Tp>
-using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
-
-template <class _Tp>
-struct unwrap_ref_decay : unwrap_reference<__decay_t<_Tp> > {};
-
-template <class _Tp>
-using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
-#endif // _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-struct __unwrap_ref_decay
-#if _LIBCPP_STD_VER >= 20
- : unwrap_ref_decay<_Tp>
-#else
- : __unwrap_reference<__decay_t<_Tp> >
-#endif
-{
-};
+struct __unwrap_ref_decay : __unwrap_reference<__decay_t<_Tp> > {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__type_traits/void_t.h b/libcxx/include/__cxx03/__type_traits/void_t.h
index a639a5f73d2b4..60cabbc821a16 100644
--- a/libcxx/include/__cxx03/__type_traits/void_t.h
+++ b/libcxx/include/__cxx03/__type_traits/void_t.h
@@ -17,11 +17,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-template <class...>
-using void_t = void;
-#endif
-
template <class...>
using __void_t = void;
diff --git a/libcxx/include/__cxx03/__utility/as_lvalue.h b/libcxx/include/__cxx03/__utility/as_lvalue.h
index ea5404ad0bd2b..beda0188fcccf 100644
--- a/libcxx/include/__cxx03/__utility/as_lvalue.h
+++ b/libcxx/include/__cxx03/__utility/as_lvalue.h
@@ -21,15 +21,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp& __as_lvalue(_LIBCPP_LIFETIMEBOUND _Tp&& __t) {
- return static_cast<_Tp&>(__t);
-}
-
-#endif // !_LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__utility/integer_sequence.h b/libcxx/include/__cxx03/__utility/integer_sequence.h
index f5fdf6325e5b2..5955e3e504bf9 100644
--- a/libcxx/include/__cxx03/__utility/integer_sequence.h
+++ b/libcxx/include/__cxx03/__utility/integer_sequence.h
@@ -43,48 +43,6 @@ using __make_indices_imp =
# error "No known way to get an integer pack from the compiler"
#endif
-#if _LIBCPP_STD_VER >= 14
-
-template <class _Tp, _Tp... _Ip>
-struct _LIBCPP_TEMPLATE_VIS integer_sequence {
- typedef _Tp value_type;
- static_assert(is_integral<_Tp>::value, "std::integer_sequence can only be instantiated with an integral type");
- static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return sizeof...(_Ip); }
-};
-
-template <size_t... _Ip>
-using index_sequence = integer_sequence<size_t, _Ip...>;
-
-# if __has_builtin(__make_integer_seq)
-
-template <class _Tp, _Tp _Ep>
-using make_integer_sequence _LIBCPP_NODEBUG = __make_integer_seq<integer_sequence, _Tp, _Ep>;
-
-# elif __has_builtin(__integer_pack)
-
-template <class _Tp, _Tp _SequenceSize>
-using make_integer_sequence _LIBCPP_NODEBUG = integer_sequence<_Tp, __integer_pack(_SequenceSize)...>;
-
-# else
-# error "No known way to get an integer pack from the compiler"
-# endif
-
-template <size_t _Np>
-using make_index_sequence = make_integer_sequence<size_t, _Np>;
-
-template <class... _Tp>
-using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
-
-# if _LIBCPP_STD_VER >= 20
-// Executes __func for every element in an index_sequence.
-template <size_t... _Index, class _Function>
-_LIBCPP_HIDE_FROM_ABI constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __func) {
- (__func.template operator()<_Index>(), ...);
-}
-# endif // _LIBCPP_STD_VER >= 20
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___UTILITY_INTEGER_SEQUENCE_H
diff --git a/libcxx/include/__cxx03/__utility/pair.h b/libcxx/include/__cxx03/__utility/pair.h
index 496fbbba675a4..c3fb7b61f6623 100644
--- a/libcxx/include/__cxx03/__utility/pair.h
+++ b/libcxx/include/__cxx03/__utility/pair.h
@@ -90,15 +90,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
struct __has_defaulted_members {
static const bool value = !is_reference<first_type>::value && !is_reference<second_type>::value;
};
-# if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(const pair&)
- requires __has_defaulted_members::value
- = default;
-
- _LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(pair&&)
- requires __has_defaulted_members::value
- = default;
-# elif __has_attribute(__enable_if__)
+# if __has_attribute(__enable_if__)
_LIBCPP_HIDE_FROM_ABI pair& operator=(const pair&)
__attribute__((__enable_if__(__has_defaulted_members::value, ""))) = default;
@@ -113,7 +105,6 @@ struct _LIBCPP_TEMPLATE_VIS pair
};
#endif // defined(_LIBCPP_ABI_TRIVIALLY_COPYABLE_PAIR) && __has_attribute(__enable_if__)
-#ifdef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI pair() : first(), second() {}
_LIBCPP_HIDE_FROM_ABI pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
@@ -140,314 +131,6 @@ struct _LIBCPP_TEMPLATE_VIS pair
second = __p.second;
return *this;
}
-#else
- struct _CheckArgs {
- template <int&...>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() {
- return __is_implicitly_default_constructible<_T1>::value && __is_implicitly_default_constructible<_T2>::value;
- }
-
- template <int&...>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_default() {
- return is_default_constructible<_T1>::value && is_default_constructible<_T2>::value;
- }
-
- template <class _U1, class _U2>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_pair_constructible() {
- return is_constructible<first_type, _U1>::value && is_constructible<second_type, _U2>::value;
- }
-
- template <class _U1, class _U2>
- static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_implicit() {
- return is_convertible<_U1, first_type>::value && is_convertible<_U2, second_type>::value;
- }
- };
-
- template <bool _MaybeEnable>
- using _CheckArgsDep _LIBCPP_NODEBUG =
- typename conditional< _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
-
- template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_default(), int> = 0>
- explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept(
- is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value)
- : first(), second() {}
-
- template <bool _Dummy = true,
- __enable_if_t<_CheckArgsDep<_Dummy>::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI
- _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>())
- pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value &&
- is_nothrow_copy_constructible<second_type>::value)
- : first(__t1), second(__t2) {}
-
- template <
-# if _LIBCPP_STD_VER >= 23 // http://wg21.link/P1951
- class _U1 = _T1,
- class _U2 = _T2,
-# else
- class _U1,
- class _U2,
-# endif
- __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0 >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
- pair(_U1&& __u1, _U2&& __u2) noexcept(is_nothrow_constructible<first_type, _U1>::value &&
- is_nothrow_constructible<second_type, _U2>::value)
- : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
- }
-
-# if _LIBCPP_STD_VER >= 23
- template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1&, _U2&>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_CheckArgs::template __is_implicit<_U1&, _U2&>())
- pair(pair<_U1, _U2>& __p) noexcept((is_nothrow_constructible<first_type, _U1&>::value &&
- is_nothrow_constructible<second_type, _U2&>::value))
- : first(__p.first), second(__p.second) {}
-# endif
-
- template <class _U1,
- class _U2,
- __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1 const&, _U2 const&>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI
- _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>())
- pair(pair<_U1, _U2> const& __p) noexcept(is_nothrow_constructible<first_type, _U1 const&>::value &&
- is_nothrow_constructible<second_type, _U2 const&>::value)
- : first(__p.first), second(__p.second) {}
-
- template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
- pair(pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, _U1&&>::value &&
- is_nothrow_constructible<second_type, _U2&&>::value)
- : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
-
-# if _LIBCPP_STD_VER >= 23
- template <class _U1,
- class _U2,
- __enable_if_t<_CheckArgs::template __is_pair_constructible<const _U1&&, const _U2&&>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_CheckArgs::template __is_implicit<const _U1&&, const _U2&&>())
- pair(const pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, const _U1&&>::value &&
- is_nothrow_constructible<second_type, const _U2&&>::value)
- : first(std::move(__p.first)), second(std::move(__p.second)) {}
-# endif
-
-# if _LIBCPP_STD_VER >= 23
- // TODO: Remove this workaround in LLVM 20. The bug got fixed in Clang 18.
- // This is a workaround for http://llvm.org/PR60710. We should be able to remove it once Clang is fixed.
- template <class _PairLike>
- _LIBCPP_HIDE_FROM_ABI static constexpr bool __pair_like_explicit_wknd() {
- if constexpr (__pair_like_no_subrange<_PairLike>) {
- return !is_convertible_v<decltype(std::get<0>(std::declval<_PairLike&&>())), first_type> ||
- !is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>;
- }
- return false;
- }
-
- template <__pair_like_no_subrange _PairLike>
- requires(is_constructible_v<first_type, decltype(std::get<0>(std::declval<_PairLike &&>()))> &&
- is_constructible_v<second_type, decltype(std::get<1>(std::declval<_PairLike &&>()))>)
- _LIBCPP_HIDE_FROM_ABI constexpr explicit(__pair_like_explicit_wknd<_PairLike>()) pair(_PairLike&& __p)
- : first(std::get<0>(std::forward<_PairLike>(__p))), second(std::get<1>(std::forward<_PairLike>(__p))) {}
-# endif
-
- template <class... _Args1, class... _Args2>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(
- is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)
- : pair(__pc,
- __first_args,
- __second_args,
- typename __make_tuple_indices<sizeof...(_Args1)>::type(),
- typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&
- operator=(__conditional_t<!__has_defaulted_members::value && is_copy_assignable<first_type>::value &&
- is_copy_assignable<second_type>::value,
- pair,
- __nat> const& __p) noexcept(is_nothrow_copy_assignable<first_type>::value &&
- is_nothrow_copy_assignable<second_type>::value) {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&
- operator=(__conditional_t<!__has_defaulted_members::value && is_move_assignable<first_type>::value &&
- is_move_assignable<second_type>::value,
- pair,
- __nat>&& __p) noexcept(is_nothrow_move_assignable<first_type>::value &&
- is_nothrow_move_assignable<second_type>::value) {
- first = std::forward<first_type>(__p.first);
- second = std::forward<second_type>(__p.second);
- return *this;
- }
-
- template <
- class _U1,
- class _U2,
- __enable_if_t<is_assignable<first_type&, _U1 const&>::value && is_assignable<second_type&, _U2 const&>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2> const& __p) {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- template <class _U1,
- class _U2,
- __enable_if_t<is_assignable<first_type&, _U1>::value && is_assignable<second_type&, _U2>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2>&& __p) {
- first = std::forward<_U1>(__p.first);
- second = std::forward<_U2>(__p.second);
- return *this;
- }
-
-# if _LIBCPP_STD_VER >= 23
- template <class = void>
- _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair const& __p) const
- noexcept(is_nothrow_copy_assignable_v<const first_type> && is_nothrow_copy_assignable_v<const second_type>)
- requires(is_copy_assignable_v<const first_type> && is_copy_assignable_v<const second_type>)
- {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- template <class = void>
- _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair&& __p) const
- noexcept(is_nothrow_assignable_v<const first_type&, first_type> &&
- is_nothrow_assignable_v<const second_type&, second_type>)
- requires(is_assignable_v<const first_type&, first_type> && is_assignable_v<const second_type&, second_type>)
- {
- first = std::forward<first_type>(__p.first);
- second = std::forward<second_type>(__p.second);
- return *this;
- }
-
- template <class _U1, class _U2>
- _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(const pair<_U1, _U2>& __p) const
- requires(is_assignable_v<const first_type&, const _U1&> && is_assignable_v<const second_type&, const _U2&>)
- {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- template <class _U1, class _U2>
- _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair<_U1, _U2>&& __p) const
- requires(is_assignable_v<const first_type&, _U1> && is_assignable_v<const second_type&, _U2>)
- {
- first = std::forward<_U1>(__p.first);
- second = std::forward<_U2>(__p.second);
- return *this;
- }
-
- template <__pair_like_no_subrange _PairLike>
- requires(__different_from<_PairLike, pair> &&
- is_assignable_v<first_type&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
- is_assignable_v<second_type&, decltype(std::get<1>(std::declval<_PairLike>()))>)
- _LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(_PairLike&& __p) {
- first = std::get<0>(std::forward<_PairLike>(__p));
- second = std::get<1>(std::forward<_PairLike>(__p));
- return *this;
- }
-
- template <__pair_like_no_subrange _PairLike>
- requires(__different_from<_PairLike, pair> &&
- is_assignable_v<first_type const&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
- is_assignable_v<second_type const&, decltype(std::get<1>(std::declval<_PairLike>()))>)
- _LIBCPP_HIDE_FROM_ABI constexpr pair const& operator=(_PairLike&& __p) const {
- first = std::get<0>(std::forward<_PairLike>(__p));
- second = std::get<1>(std::forward<_PairLike>(__p));
- return *this;
- }
-# endif // _LIBCPP_STD_VER >= 23
-
- // Prior to C++23, we provide an approximation of constructors and assignment operators from
- // pair-like types. This was historically provided as an extension.
-# if _LIBCPP_STD_VER < 23
- // from std::tuple
- template <class _U1,
- class _U2,
- __enable_if_t<is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2> const& __p)
- : first(std::get<0>(__p)), second(std::get<1>(__p)) {}
-
- template < class _U1,
- class _U2,
- __enable_if_t<is_constructible<_T1, _U1 const&>::value && is_constructible<_T2, _U2 const&>::value &&
- !(is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value),
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2> const& __p)
- : first(std::get<0>(__p)), second(std::get<1>(__p)) {}
-
- template <class _U1,
- class _U2,
- __enable_if_t<is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2>&& __p)
- : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}
-
- template <class _U1,
- class _U2,
- __enable_if_t<is_constructible<_T1, _U1>::value && is_constructible<_T2, _U2>::value &&
- !(is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value) > = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2>&& __p)
- : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}
-
- template <class _U1,
- class _U2,
- __enable_if_t<is_assignable<_T1&, _U1 const&>::value && is_assignable<_T2&, _U2 const&>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2> const& __p) {
- first = std::get<0>(__p);
- second = std::get<1>(__p);
- return *this;
- }
-
- template <class _U1,
- class _U2,
- __enable_if_t<is_assignable<_T1&, _U1&&>::value && is_assignable<_T2&, _U2&&>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2>&& __p) {
- first = std::get<0>(std::move(__p));
- second = std::get<1>(std::move(__p));
- return *this;
- }
-
- // from std::array
- template <class _Up,
- __enable_if_t<is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2> const& __p) : first(__p[0]), second(__p[1]) {}
-
- template <class _Up,
- __enable_if_t<is_constructible<_T1, _Up const&>::value && is_constructible<_T2, _Up const&>::value &&
- !(is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value),
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2> const& __p)
- : first(__p[0]), second(__p[1]) {}
-
- template <class _Up, __enable_if_t< is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2>&& __p)
- : first(std::move(__p)[0]), second(std::move(__p)[1]) {}
-
- template <class _Up,
- __enable_if_t<is_constructible<_T1, _Up>::value && is_constructible<_T2, _Up>::value &&
- !(is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value),
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2>&& __p)
- : first(std::move(__p)[0]), second(std::move(__p)[1]) {}
-
- template <class _Up,
- __enable_if_t<is_assignable<_T1&, _Up const&>::value && is_assignable<_T2&, _Up const&>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2> const& __p) {
- first = std::get<0>(__p);
- second = std::get<1>(__p);
- return *this;
- }
-
- template <class _Up, __enable_if_t<is_assignable<_T1&, _Up>::value && is_assignable<_T2&, _Up>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2>&& __p) {
- first = std::get<0>(std::move(__p));
- second = std::get<1>(std::move(__p));
- return *this;
- }
-# endif // _LIBCPP_STD_VER < 23
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair& __p)
_NOEXCEPT_(__is_nothrow_swappable_v<first_type>&& __is_nothrow_swappable_v<second_type>) {
@@ -455,35 +138,8 @@ struct _LIBCPP_TEMPLATE_VIS pair
swap(first, __p.first);
swap(second, __p.second);
}
-
-#if _LIBCPP_STD_VER >= 23
- _LIBCPP_HIDE_FROM_ABI constexpr void swap(const pair& __p) const
- noexcept(__is_nothrow_swappable_v<const first_type> && __is_nothrow_swappable_v<const second_type>) {
- using std::swap;
- swap(first, __p.first);
- swap(second, __p.second);
- }
-#endif
-
-private:
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- pair(piecewise_construct_t,
- tuple<_Args1...>& __first_args,
- tuple<_Args2...>& __second_args,
- __tuple_indices<_I1...>,
- __tuple_indices<_I2...>)
- : first(std::forward<_Args1>(std::get<_I1>(__first_args))...),
- second(std::forward<_Args2>(std::get<_I2>(__second_args))...) {}
-#endif
};
-#if _LIBCPP_STD_VER >= 17
-template <class _T1, class _T2>
-pair(_T1, _T2) -> pair<_T1, _T2>;
-#endif
-
// [pairs.spec], specialized algorithms
template <class _T1, class _T2, class _U1, class _U2>
@@ -492,20 +148,6 @@ operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
return __x.first == __y.first && __x.second == __y.second;
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _T1, class _T2, class _U1, class _U2>
-_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t< __synth_three_way_result<_T1, _U1>,
- __synth_three_way_result<_T2, _U2> >
-operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
- if (auto __c = std::__synth_three_way(__x.first, __y.first); __c != 0) {
- return __c;
- }
- return std::__synth_three_way(__x.second, __y.second);
-}
-
-#else // _LIBCPP_STD_VER >= 20
-
template <class _T1, class _T2, class _U1, class _U2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
operator!=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
@@ -536,39 +178,12 @@ operator<=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 23
-template <class _T1, class _T2, class _U1, class _U2, template <class> class _TQual, template <class> class _UQual>
- requires requires {
- typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>, common_reference_t<_TQual<_T2>, _UQual<_U2>>>;
- }
-struct basic_common_reference<pair<_T1, _T2>, pair<_U1, _U2>, _TQual, _UQual> {
- using type = pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>, common_reference_t<_TQual<_T2>, _UQual<_U2>>>;
-};
-
-template <class _T1, class _T2, class _U1, class _U2>
- requires requires { typename pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; }
-struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
- using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>;
-};
-#endif // _LIBCPP_STD_VER >= 23
-
template <class _T1, class _T2, __enable_if_t<__is_swappable_v<_T1> && __is_swappable_v<_T2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
_NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 23
-template <class _T1, class _T2>
- requires(__is_swappable_v<const _T1> && __is_swappable_v<const _T2>)
-_LIBCPP_HIDE_FROM_ABI constexpr void
-swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) {
- __x.swap(__y);
-}
-#endif
-
template <class _T1, class _T2>
inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR_SINCE_CXX14 pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
@@ -668,49 +283,6 @@ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {
return __get_pair<_Ip>::get(std::move(__p));
}
-#if _LIBCPP_STD_VER >= 14
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {
- return __get_pair<0>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {
- return __get_pair<0>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
- return __get_pair<0>::get(std::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {
- return __get_pair<0>::get(std::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(pair<_T2, _T1>& __p) _NOEXCEPT {
- return __get_pair<1>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(pair<_T2, _T1> const& __p) _NOEXCEPT {
- return __get_pair<1>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(pair<_T2, _T1>&& __p) _NOEXCEPT {
- return __get_pair<1>::get(std::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(pair<_T2, _T1> const&& __p) _NOEXCEPT {
- return __get_pair<1>::get(std::move(__p));
-}
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/libcxx/include/__cxx03/__utility/piecewise_construct.h b/libcxx/include/__cxx03/__utility/piecewise_construct.h
index a45d38070f09d..f45af5d79acbd 100644
--- a/libcxx/include/__cxx03/__utility/piecewise_construct.h
+++ b/libcxx/include/__cxx03/__utility/piecewise_construct.h
@@ -21,12 +21,6 @@ struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t {
explicit piecewise_construct_t() = default;
};
-#if _LIBCPP_STD_VER >= 17
-inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
-#elif !defined(_LIBCPP_CXX03_LANG)
-constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___UTILITY_PIECEWISE_CONSTRUCT_H
diff --git a/libcxx/include/__cxx03/__utility/small_buffer.h b/libcxx/include/__cxx03/__utility/small_buffer.h
index fa5e5b238ab9d..40fb2b88727d1 100644
--- a/libcxx/include/__cxx03/__utility/small_buffer.h
+++ b/libcxx/include/__cxx03/__utility/small_buffer.h
@@ -23,77 +23,4 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER >= 23
-
-// __small_buffer is a helper class to perform the well known SBO (small buffer optimization). It is mainly useful to
-// allow type-erasing classes like move_only_function to store small objects in a local buffer without requiring an
-// allocation.
-//
-// This small buffer class only allows storing trivially relocatable objects inside the local storage to allow
-// __small_buffer to be trivially relocatable itself. Since the buffer doesn't know what's stored inside it, the user
-// has to manage the object's lifetime, in particular the destruction of the object.
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <size_t _BufferSize, size_t _BufferAlignment>
- requires(_BufferSize > 0 && _BufferAlignment > 0)
-class __small_buffer {
-public:
- template <class _Tp, class _Decayed = decay_t<_Tp>>
- static constexpr bool __fits_in_buffer =
- is_trivially_move_constructible_v<_Decayed> && is_trivially_destructible_v<_Decayed> &&
- sizeof(_Decayed) <= _BufferSize && alignof(_Decayed) <= _BufferAlignment;
-
- _LIBCPP_HIDE_FROM_ABI __small_buffer() = default;
- __small_buffer(const __small_buffer&) = delete;
- __small_buffer& operator=(const __small_buffer&) = delete;
- _LIBCPP_HIDE_FROM_ABI ~__small_buffer() = default;
-
- // Relocates the buffer - __delete() should never be called on a moved-from __small_buffer
- _LIBCPP_HIDE_FROM_ABI __small_buffer(__small_buffer&&) = default;
- _LIBCPP_HIDE_FROM_ABI __small_buffer& operator=(__small_buffer&&) = default;
-
- template <class _Stored>
- _LIBCPP_HIDE_FROM_ABI _Stored* __get() {
- if constexpr (__fits_in_buffer<_Stored>)
- return std::launder(reinterpret_cast<_Stored*>(__buffer_));
- else
- return *std::launder(reinterpret_cast<_Stored**>(__buffer_));
- }
-
- template <class _Stored>
- _LIBCPP_HIDE_FROM_ABI _Stored* __alloc() {
- if constexpr (__fits_in_buffer<_Stored>) {
- return std::launder(reinterpret_cast<_Stored*>(__buffer_));
- } else {
- byte* __allocation = static_cast<byte*>(::operator new[](sizeof(_Stored), align_val_t{alignof(_Stored)}));
- std::construct_at(reinterpret_cast<byte**>(__buffer_), __allocation);
- return std::launder(reinterpret_cast<_Stored*>(__allocation));
- }
- }
-
- template <class _Stored>
- _LIBCPP_HIDE_FROM_ABI void __dealloc() noexcept {
- if constexpr (!__fits_in_buffer<_Stored>)
- ::operator delete[](*reinterpret_cast<void**>(__buffer_), sizeof(_Stored), align_val_t{alignof(_Stored)});
- }
-
- template <class _Stored, class... _Args>
- _LIBCPP_HIDE_FROM_ABI void __construct(_Args&&... __args) {
- _Stored* __buffer = __alloc<_Stored>();
- auto __guard = std::__make_exception_guard([&] { __dealloc<_Stored>(); });
- std::construct_at(__buffer, std::forward<_Args>(__args)...);
- __guard.__complete();
- }
-
-private:
- alignas(_BufferAlignment) byte __buffer_[_BufferSize];
-};
-
-# undef _LIBCPP_SMALL_BUFFER_TRIVIAL_ABI
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER >= 23
-
#endif // _LIBCPP___CXX03___UTILITY_SMALL_BUFFER_H
diff --git a/libcxx/include/__cxx03/__utility/swap.h b/libcxx/include/__cxx03/__utility/swap.h
index d74ec818084ca..6b9a8e20323ae 100644
--- a/libcxx/include/__cxx03/__utility/swap.h
+++ b/libcxx/include/__cxx03/__utility/swap.h
@@ -28,13 +28,8 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp>
-using __swap_result_t = __enable_if_t<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>;
-#else
template <class>
using __swap_result_t = void;
-#endif
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CXX20 swap(_Tp& __x, _Tp& __y)
diff --git a/libcxx/include/__cxx03/__utility/unreachable.h b/libcxx/include/__cxx03/__utility/unreachable.h
index 373cddc1365ca..662b86662d960 100644
--- a/libcxx/include/__cxx03/__utility/unreachable.h
+++ b/libcxx/include/__cxx03/__utility/unreachable.h
@@ -23,12 +23,6 @@ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __libcpp_unreachable() {
__builtin_unreachable();
}
-#if _LIBCPP_STD_VER >= 23
-
-[[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void unreachable() { __libcpp_unreachable(); }
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___UTILITY_UNREACHABLE_H
diff --git a/libcxx/include/__cxx03/__variant/monostate.h b/libcxx/include/__cxx03/__variant/monostate.h
index 66b94618a0fe1..cde3a5c791927 100644
--- a/libcxx/include/__cxx03/__variant/monostate.h
+++ b/libcxx/include/__cxx03/__variant/monostate.h
@@ -21,44 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-
-struct _LIBCPP_TEMPLATE_VIS monostate {};
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
-
-# if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
- return strong_ordering::equal;
-}
-
-# else // _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator!=(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(monostate, monostate) noexcept { return true; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-
-# endif // _LIBCPP_STD_VER >= 20
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
- using argument_type = monostate;
- using result_type = size_t;
-
- inline _LIBCPP_HIDE_FROM_ABI result_type operator()(const argument_type&) const _NOEXCEPT {
- return 66740831; // return a fundamentally attractive random value.
- }
-};
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03___VARIANT_MONOSTATE_H
diff --git a/libcxx/include/__cxx03/algorithm b/libcxx/include/__cxx03/algorithm
index 8eff4d152adb2..b8b7e89ada2df 100644
--- a/libcxx/include/__cxx03/algorithm
+++ b/libcxx/include/__cxx03/algorithm
@@ -2029,11 +2029,7 @@ template <class BidirectionalIterator, class Compare>
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 14
-# include <__cxx03/execution>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/bit>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/array b/libcxx/include/__cxx03/array
index 74dc287aa54d6..892926d7aae83 100644
--- a/libcxx/include/__cxx03/array
+++ b/libcxx/include/__cxx03/array
@@ -379,19 +379,12 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
}
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, class... _Args, class = enable_if_t<__all<_IsSame<_Tp, _Args>::value...>::value> >
-array(_Tp, _Args...) -> array<_Tp, 1 + sizeof...(_Args)>;
-#endif
-
template <class _Tp, size_t _Size>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, size_t _Size>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return !(__x == __y);
@@ -417,16 +410,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const array<_Tp, _Size>& __x, const
return !(__x < __y);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Tp, size_t _Size>
-_LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp>
-operator<=>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <class _Tp, size_t _Size, __enable_if_t<_Size == 0 || __is_swappable_v<_Tp>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y)
_NOEXCEPT_(noexcept(__x.swap(__y))) {
@@ -466,43 +449,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const
return std::move(__a.__elems_[_Ip]);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <typename _Tp, size_t _Size, size_t... _Index>
-_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
-__to_array_lvalue_impl(_Tp (&__arr)[_Size], index_sequence<_Index...>) {
- return {{__arr[_Index]...}};
-}
-
-template <typename _Tp, size_t _Size, size_t... _Index>
-_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
-__to_array_rvalue_impl(_Tp (&&__arr)[_Size], index_sequence<_Index...>) {
- return {{std::move(__arr[_Index])...}};
-}
-
-template <typename _Tp, size_t _Size>
-_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
-to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
- static_assert(!is_array_v<_Tp>, "[array.creation]/1: to_array does not accept multidimensional arrays.");
- static_assert(is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements.");
- return std::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
-}
-
-template <typename _Tp, size_t _Size>
-_LIBCPP_HIDE_FROM_ABI constexpr array<remove_cv_t<_Tp>, _Size>
-to_array(_Tp (&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
- static_assert(!is_array_v<_Tp>, "[array.creation]/4: to_array does not accept multidimensional arrays.");
- static_assert(is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements.");
- return std::__to_array_rvalue_impl(std::move(__arr), make_index_sequence<_Size>());
-}
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/atomic b/libcxx/include/__cxx03/atomic
index 1b488d99f80fb..eb9d828a07f98 100644
--- a/libcxx/include/__cxx03/atomic
+++ b/libcxx/include/__cxx03/atomic
@@ -589,7 +589,7 @@ template <class T>
#include <__cxx03/__config>
-#if _LIBCPP_STD_VER < 23 && defined(_LIBCPP___CXX03_STDATOMIC_H)
+#if defined(_LIBCPP___CXX03_STDATOMIC_H)
# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
#endif
@@ -621,7 +621,7 @@ template <class T>
# error <atomic> is not implemented
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cmath>
# include <__cxx03/compare>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/bitset b/libcxx/include/__cxx03/bitset
index 1507d0cdaf2f0..7d22f8e45967c 100644
--- a/libcxx/include/__cxx03/bitset
+++ b/libcxx/include/__cxx03/bitset
@@ -222,10 +222,8 @@ protected:
_LIBCPP_HIDE_FROM_ABI size_t __hash_code() const _NOEXCEPT;
private:
-#ifdef _LIBCPP_CXX03_LANG
void __init(unsigned long long __v, false_type) _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI void __init(unsigned long long __v, true_type) _NOEXCEPT;
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong(false_type) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong(true_type) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong(false_type) const;
@@ -236,17 +234,10 @@ private:
template <size_t _N_words, size_t _Size>
inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
- : __first_{0}
-#endif
{
-#ifdef _LIBCPP_CXX03_LANG
std::fill_n(__first_, _N_words, __storage_type(0));
-#endif
}
-#ifdef _LIBCPP_CXX03_LANG
-
template <size_t _N_words, size_t _Size>
void __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT {
__storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)];
@@ -271,27 +262,10 @@ inline _LIBCPP_HIDE_FROM_ABI void __bitset<_N_words, _Size>::__init(unsigned lon
std::fill(__first_ + 1, __first_ + sizeof(__first_) / sizeof(__first_[0]), __storage_type(0));
}
-#endif // _LIBCPP_CXX03_LANG
-
template <size_t _N_words, size_t _Size>
inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
-# if __SIZEOF_SIZE_T__ == 8
- : __first_{__v}
-# elif __SIZEOF_SIZE_T__ == 4
- : __first_{static_cast<__storage_type>(__v),
- _Size >= 2 * __bits_per_word
- ? static_cast<__storage_type>(__v >> __bits_per_word)
- : static_cast<__storage_type>((__v >> __bits_per_word) &
- (__storage_type(1) << (_Size - __bits_per_word)) - 1)}
-# else
-# error This constructor has not been ported to this platform
-# endif
-#endif
{
-#ifdef _LIBCPP_CXX03_LANG
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
-#endif
}
template <size_t _N_words, size_t _Size>
@@ -623,32 +597,14 @@ public:
template <class _CharT, __enable_if_t<_IsCharLikeType<_CharT>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
const _CharT* __str,
-#if _LIBCPP_STD_VER >= 26
- typename basic_string_view<_CharT>::size_type __n = basic_string_view<_CharT>::npos,
-#else
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
-#endif
_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) {
size_t __rlen = std::min(__n, char_traits<_CharT>::length(__str));
__init_from_string_view(basic_string_view<_CharT>(__str, __rlen), __zero, __one);
}
-#if _LIBCPP_STD_VER >= 26
- template <class _CharT, class _Traits>
- _LIBCPP_HIDE_FROM_ABI constexpr explicit bitset(
- basic_string_view<_CharT, _Traits> __str,
- typename basic_string_view<_CharT, _Traits>::size_type __pos = 0,
- typename basic_string_view<_CharT, _Traits>::size_type __n = basic_string_view<_CharT, _Traits>::npos,
- _CharT __zero = _CharT('0'),
- _CharT __one = _CharT('1')) {
- if (__pos > __str.size())
- __throw_out_of_range("bitset string pos out of range");
- size_t __rlen = std::min(__n, __str.size() - __pos);
- __init_from_string_view(basic_string_view<_CharT, _Traits>(__str.data() + __pos, __rlen), __zero, __one);
- }
-#endif
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
const basic_string<_CharT, _Traits, _Allocator>& __str,
@@ -701,9 +657,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t count() const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT { return _Size; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const bitset& __rhs) const _NOEXCEPT;
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const bitset& __rhs) const _NOEXCEPT;
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test(size_t __pos) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all() const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any() const _NOEXCEPT;
@@ -876,15 +830,11 @@ bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT {
return std::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
}
-#if _LIBCPP_STD_VER <= 17
-
template <size_t _Size>
inline _LIBCPP_HIDE_FROM_ABI bool bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT {
return !(*this == __rhs);
}
-#endif
-
template <size_t _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool bitset<_Size>::test(size_t __pos) const {
if (__pos >= _Size)
@@ -960,8 +910,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/chrono b/libcxx/include/__cxx03/chrono
index 167e85203ced6..73354f10dc288 100644
--- a/libcxx/include/__cxx03/chrono
+++ b/libcxx/include/__cxx03/chrono
@@ -995,28 +995,18 @@ constexpr chrono::year operator ""y(unsigned lo
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdint>
# include <__cxx03/stdexcept>
# include <__cxx03/string_view>
# include <__cxx03/vector>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/bit>
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstring>
# include <__cxx03/forward_list>
# include <__cxx03/string>
# include <__cxx03/tuple>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
-# include <__cxx03/charconv>
-# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-# include <__cxx03/locale>
-# include <__cxx03/ostream>
-# endif
-#endif
-
#endif // _LIBCPP___CXX03_CHRONO
diff --git a/libcxx/include/__cxx03/cmath b/libcxx/include/__cxx03/cmath
index 6aa9ad9c7c4d5..6bbedfbf72592 100644
--- a/libcxx/include/__cxx03/cmath
+++ b/libcxx/include/__cxx03/cmath
@@ -596,50 +596,11 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isfinite(_A1 __lcpp_x)
return __builtin_isfinite(__lcpp_x);
}
-#if _LIBCPP_STD_VER >= 20
-template <typename _Fp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
- if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0))
- return __t * __b + (1 - __t) * __a;
-
- if (__t == 1)
- return __b;
- const _Fp __x = __a + __t * (__b - __a);
- if ((__t > 1) == (__b > __a))
- return __b < __x ? __x : __b;
- else
- return __x < __b ? __x : __b;
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr float lerp(float __a, float __b, float __t) _NOEXCEPT {
- return __lerp(__a, __b, __t);
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr double lerp(double __a, double __b, double __t) _NOEXCEPT {
- return __lerp(__a, __b, __t);
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr long double lerp(long double __a, long double __b, long double __t) _NOEXCEPT {
- return __lerp(__a, __b, __t);
-}
-
-template <class _A1, class _A2, class _A3>
-inline _LIBCPP_HIDE_FROM_ABI constexpr
- typename enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value,
- __promote<_A1, _A2, _A3> >::type
- lerp(_A1 __a, _A2 __b, _A3 __t) noexcept {
- typedef typename __promote<_A1, _A2, _A3>::type __result_type;
- static_assert(!(
- _IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value && _IsSame<_A3, __result_type>::value));
- return std::__lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
-}
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/codecvt b/libcxx/include/__cxx03/codecvt
index 22a4de3790d18..6e19fd0607f93 100644
--- a/libcxx/include/__cxx03/codecvt
+++ b/libcxx/include/__cxx03/codecvt
@@ -62,8 +62,6 @@ class codecvt_utf8_utf16
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
-
_LIBCPP_BEGIN_NAMESPACE_STD
enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
@@ -576,9 +574,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstddef>
diff --git a/libcxx/include/__cxx03/complex b/libcxx/include/__cxx03/complex
index c68bce75bb9be..d670a0b69c458 100644
--- a/libcxx/include/__cxx03/complex
+++ b/libcxx/include/__cxx03/complex
@@ -373,20 +373,6 @@ public:
*this = *this / complex(__c.real(), __c.imag());
return *this;
}
-
-#if _LIBCPP_STD_VER >= 26
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&&) noexcept;
-#endif
};
template <>
@@ -492,20 +478,6 @@ public:
*this = *this / complex(__c.real(), __c.imag());
return *this;
}
-
-#if _LIBCPP_STD_VER >= 26
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&&) noexcept;
-#endif
};
template <>
@@ -592,20 +564,6 @@ public:
*this = *this / complex(__c.real(), __c.imag());
return *this;
}
-
-#if _LIBCPP_STD_VER >= 26
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&&) noexcept;
-#endif
};
template <>
@@ -693,20 +651,6 @@ public:
*this = *this / complex(__c.real(), __c.imag());
return *this;
}
-
-#if _LIBCPP_STD_VER >= 26
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>&) noexcept;
-
- template <size_t _Ip, class _Xp>
- friend _LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&&) noexcept;
-#endif
};
inline _LIBCPP_CONSTEXPR complex<float>::complex(const complex<double>& __c) : __re_(__c.real()), __im_(__c.imag()) {}
@@ -861,8 +805,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator==(const
return __x.real() == __y && __x.imag() == 0;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator==(const _Tp& __x, const complex<_Tp>& __y) {
return __x == __y.real() && 0 == __y.imag();
@@ -884,8 +826,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator!=(const
return !(__x == __y);
}
-#endif
-
// 26.3.7 values:
template <class _Tp, bool = is_integral<_Tp>::value, bool = is_floating_point<_Tp>::value >
@@ -1383,95 +1323,11 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) {
}
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
-#if _LIBCPP_STD_VER >= 26
-
-// [complex.tuple], tuple interface
-
-template <class _Tp>
-struct tuple_size<complex<_Tp>> : integral_constant<size_t, 2> {};
-
-template <size_t _Ip, class _Tp>
-struct tuple_element<_Ip, complex<_Tp>> {
- static_assert(_Ip < 2, "Index value is out of range.");
- using type = _Tp;
-};
-
-template <size_t _Ip, class _Xp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Xp& get(complex<_Xp>& __z) noexcept {
- static_assert(_Ip < 2, "Index value is out of range.");
- if constexpr (_Ip == 0) {
- return __z.__re_;
- } else {
- return __z.__im_;
- }
-}
-
-template <size_t _Ip, class _Xp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Xp&& get(complex<_Xp>&& __z) noexcept {
- static_assert(_Ip < 2, "Index value is out of range.");
- if constexpr (_Ip == 0) {
- return std::move(__z.__re_);
- } else {
- return std::move(__z.__im_);
- }
-}
-
-template <size_t _Ip, class _Xp>
-_LIBCPP_HIDE_FROM_ABI constexpr const _Xp& get(const complex<_Xp>& __z) noexcept {
- static_assert(_Ip < 2, "Index value is out of range.");
- if constexpr (_Ip == 0) {
- return __z.__re_;
- } else {
- return __z.__im_;
- }
-}
-
-template <size_t _Ip, class _Xp>
-_LIBCPP_HIDE_FROM_ABI constexpr const _Xp&& get(const complex<_Xp>&& __z) noexcept {
- static_assert(_Ip < 2, "Index value is out of range.");
- if constexpr (_Ip == 0) {
- return std::move(__z.__re_);
- } else {
- return std::move(__z.__im_);
- }
-}
-
-#endif // _LIBCPP_STD_VER >= 26
-
-#if _LIBCPP_STD_VER >= 14
-// Literal suffix for complex number literals [complex.literals]
-inline namespace literals {
-inline namespace complex_literals {
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<long double> operator""il(long double __im) { return {0.0l, __im}; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<long double> operator""il(unsigned long long __im) {
- return {0.0l, static_cast<long double>(__im)};
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<double> operator""i(long double __im) {
- return {0.0, static_cast<double>(__im)};
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<double> operator""i(unsigned long long __im) {
- return {0.0, static_cast<double>(__im)};
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(long double __im) {
- return {0.0f, static_cast<float>(__im)};
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr complex<float> operator""if(unsigned long long __im) {
- return {0.0f, static_cast<float>(__im)};
-}
-} // namespace complex_literals
-} // namespace literals
-#endif
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/iosfwd>
# include <__cxx03/stdexcept>
# include <__cxx03/type_traits>
diff --git a/libcxx/include/__cxx03/condition_variable b/libcxx/include/__cxx03/condition_variable
index 5ad540c4626c0..26c9a08547a1f 100644
--- a/libcxx/include/__cxx03/condition_variable
+++ b/libcxx/include/__cxx03/condition_variable
@@ -172,21 +172,6 @@ public:
template <class _Lock, class _Rep, class _Period, class _Predicate>
bool _LIBCPP_HIDE_FROM_ABI wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);
-
-# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
-
- template <class _Lock, class _Predicate>
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool wait(_Lock& __lock, stop_token __stoken, _Predicate __pred);
-
- template <class _Lock, class _Clock, class _Duration, class _Predicate>
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool wait_until(
- _Lock& __lock, stop_token __stoken, const chrono::time_point<_Clock, _Duration>& __abs_time, _Predicate __pred);
-
- template <class _Lock, class _Rep, class _Period, class _Predicate>
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool
- wait_for(_Lock& __lock, stop_token __stoken, const chrono::duration<_Rep, _Period>& __rel_time, _Predicate __pred);
-
-# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
};
inline condition_variable_any::condition_variable_any() : __mut_(make_shared<mutex>()) {}
@@ -260,89 +245,6 @@ condition_variable_any::wait_for(_Lock& __lock, const chrono::duration<_Rep, _Pe
return wait_until(__lock, chrono::steady_clock::now() + __d, std::move(__pred));
}
-# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
-
-template <class _Lock, class _Predicate>
-bool condition_variable_any::wait(_Lock& __user_lock, stop_token __stoken, _Predicate __pred) {
- if (__stoken.stop_requested())
- return __pred();
-
- // Per https://eel.is/c++draft/thread.condition.condvarany#general-note-2,
- // we do need to take a copy of the shared pointer __mut_
- // This ensures that a thread can call the destructor immediately after calling
- // notify_all, without waiting all the wait calls.
- // A thread can also safely call the destructor immediately after calling
- // request_stop, as the call to request_stop would evaluate the callback,
- // which accesses the internal condition variable, immediately on the same thread.
- // In this situation, it is OK even without copying a shared ownership the internal
- // condition variable. However, this needs the evaluation of stop_callback to
- // happen-before the destruction.
- // The spec only says "Only the notification to unblock the wait needs to happen
- // before destruction". To make this work, we need to copy the shared ownership of
- // the internal condition variable inside this function, which is not possible
- // with the current ABI.
- shared_ptr<mutex> __mut = __mut_;
-
- stop_callback __cb(__stoken, [this] { notify_all(); });
-
- while (true) {
- if (__pred())
- return true;
-
- // We need to take the internal lock before checking stop_requested,
- // so that the notification cannot come in between the stop_requested
- // check and entering the wait.
- // Note that the stop_callback takes the same internal lock before notifying
- unique_lock<mutex> __internal_lock(*__mut);
- if (__stoken.stop_requested())
- break;
-
- __unlock_guard<_Lock> __unlock(__user_lock);
- unique_lock<mutex> __internal_lock2(
- std::move(__internal_lock)); // switch unlock order between __internal_lock and __user_lock
- __cv_.wait(__internal_lock2);
- } // __internal_lock2.unlock(), __user_lock.lock()
- return __pred();
-}
-
-template <class _Lock, class _Clock, class _Duration, class _Predicate>
-bool condition_variable_any::wait_until(
- _Lock& __user_lock,
- stop_token __stoken,
- const chrono::time_point<_Clock, _Duration>& __abs_time,
- _Predicate __pred) {
- if (__stoken.stop_requested())
- return __pred();
-
- shared_ptr<mutex> __mut = __mut_;
- stop_callback __cb(__stoken, [this] { notify_all(); });
-
- while (true) {
- if (__pred())
- return true;
-
- unique_lock<mutex> __internal_lock(*__mut);
- if (__stoken.stop_requested())
- break;
-
- __unlock_guard<_Lock> __unlock(__user_lock);
- unique_lock<mutex> __internal_lock2(
- std::move(__internal_lock)); // switch unlock order between __internal_lock and __user_lock
-
- if (__cv_.wait_until(__internal_lock2, __abs_time) == cv_status::timeout)
- break;
- } // __internal_lock2.unlock(), __user_lock.lock()
- return __pred();
-}
-
-template <class _Lock, class _Rep, class _Period, class _Predicate>
-bool condition_variable_any::wait_for(
- _Lock& __lock, stop_token __stoken, const chrono::duration<_Rep, _Period>& __rel_time, _Predicate __pred) {
- return wait_until(__lock, std::move(__stoken), chrono::steady_clock::now() + __rel_time, std::move(__pred));
-}
-
-# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
-
_LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
_LIBCPP_END_NAMESPACE_STD
@@ -351,7 +253,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdint>
diff --git a/libcxx/include/__cxx03/cstddef b/libcxx/include/__cxx03/cstddef
index 38f89a77d1ce7..f1527901bd6b5 100644
--- a/libcxx/include/__cxx03/cstddef
+++ b/libcxx/include/__cxx03/cstddef
@@ -59,75 +59,6 @@ using ::nullptr_t;
using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
-#if !defined(_LIBCPP_CXX03_LANG)
-using ::max_align_t _LIBCPP_USING_IF_EXISTS;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-namespace std // purposefully not versioned
-{
-enum class byte : unsigned char {};
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator|(byte __lhs, byte __rhs) noexcept {
- return static_cast<byte>(
- static_cast<unsigned char>(static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)));
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept {
- return __lhs = __lhs | __rhs;
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator&(byte __lhs, byte __rhs) noexcept {
- return static_cast<byte>(
- static_cast<unsigned char>(static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)));
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept {
- return __lhs = __lhs & __rhs;
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator^(byte __lhs, byte __rhs) noexcept {
- return static_cast<byte>(
- static_cast<unsigned char>(static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)));
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept {
- return __lhs = __lhs ^ __rhs;
-}
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator~(byte __b) noexcept {
- return static_cast<byte>(static_cast<unsigned char>(~static_cast<unsigned int>(__b)));
-}
-
-template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr byte& operator<<=(byte& __lhs, _Integer __shift) noexcept {
- return __lhs = __lhs << __shift;
-}
-
-template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr byte operator<<(byte __lhs, _Integer __shift) noexcept {
- return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift));
-}
-
-template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr byte& operator>>=(byte& __lhs, _Integer __shift) noexcept {
- return __lhs = __lhs >> __shift;
-}
-
-template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr byte operator>>(byte __lhs, _Integer __shift) noexcept {
- return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift));
-}
-
-template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Integer to_integer(byte __b) noexcept {
- return static_cast<_Integer>(__b);
-}
-
-} // namespace std
-
-#endif
-
#endif // _LIBCPP___CXX03_CSTDDEF
diff --git a/libcxx/include/__cxx03/cstdio b/libcxx/include/__cxx03/cstdio
index 801a58625c4ca..166ac0d8abb61 100644
--- a/libcxx/include/__cxx03/cstdio
+++ b/libcxx/include/__cxx03/cstdio
@@ -158,9 +158,7 @@ using ::tmpfile _LIBCPP_USING_IF_EXISTS;
using ::tmpnam _LIBCPP_USING_IF_EXISTS;
using ::getchar _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER <= 11
using ::gets _LIBCPP_USING_IF_EXISTS;
-#endif
using ::scanf _LIBCPP_USING_IF_EXISTS;
using ::vscanf _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/include/__cxx03/cstdlib b/libcxx/include/__cxx03/cstdlib
index ec4757dc3d35d..c8e4414690aee 100644
--- a/libcxx/include/__cxx03/cstdlib
+++ b/libcxx/include/__cxx03/cstdlib
@@ -141,13 +141,6 @@ using ::wctomb _LIBCPP_USING_IF_EXISTS;
using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
using ::wcstombs _LIBCPP_USING_IF_EXISTS;
#endif
-#if !defined(_LIBCPP_CXX03_LANG)
-using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
-using ::quick_exit _LIBCPP_USING_IF_EXISTS;
-#endif
-#if _LIBCPP_STD_VER >= 17
-using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/ctime b/libcxx/include/__cxx03/ctime
index 07432e6e9a43d..31a29ba2e532b 100644
--- a/libcxx/include/__cxx03/ctime
+++ b/libcxx/include/__cxx03/ctime
@@ -65,9 +65,6 @@ using ::clock_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
using ::time_t _LIBCPP_USING_IF_EXISTS;
using ::tm _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER >= 17
-using ::timespec _LIBCPP_USING_IF_EXISTS;
-#endif
using ::clock _LIBCPP_USING_IF_EXISTS;
using ::difftime _LIBCPP_USING_IF_EXISTS;
using ::mktime _LIBCPP_USING_IF_EXISTS;
@@ -77,9 +74,6 @@ using ::ctime _LIBCPP_USING_IF_EXISTS;
using ::gmtime _LIBCPP_USING_IF_EXISTS;
using ::localtime _LIBCPP_USING_IF_EXISTS;
using ::strftime _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER >= 17
-using ::timespec_get _LIBCPP_USING_IF_EXISTS;
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/cuchar b/libcxx/include/__cxx03/cuchar
index c9da0e7e55f0b..a11abaa4f99e7 100644
--- a/libcxx/include/__cxx03/cuchar
+++ b/libcxx/include/__cxx03/cuchar
@@ -54,22 +54,6 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_CXX03_LANG)
-
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-
-# if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
-using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
-using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
-# endif
-using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
-using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
-using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
-using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03_CUCHAR
diff --git a/libcxx/include/__cxx03/cwchar b/libcxx/include/__cxx03/cwchar
index 2da11571df1f1..0d029c0e80286 100644
--- a/libcxx/include/__cxx03/cwchar
+++ b/libcxx/include/__cxx03/cwchar
@@ -238,10 +238,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp
return reinterpret_cast<_Tp*>(
__builtin_wmemchr(reinterpret_cast<__copy_cv_t<_Tp, wchar_t>*>(__str), __value_buffer, __count));
}
-# if _LIBCPP_STD_VER >= 17
- else if constexpr (is_same_v<remove_cv_t<_Tp>, wchar_t>)
- return __builtin_wmemchr(__str, __value, __count);
-# endif
#endif // __has_builtin(__builtin_wmemchr)
for (; __count; --__count) {
@@ -254,7 +250,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstddef>
#endif
diff --git a/libcxx/include/__cxx03/deque b/libcxx/include/__cxx03/deque
index 8e40befbb71ea..f4737f40fb082 100644
--- a/libcxx/include/__cxx03/deque
+++ b/libcxx/include/__cxx03/deque
@@ -283,13 +283,7 @@ public:
typedef random_access_iterator_tag iterator_category;
typedef _Reference reference;
- _LIBCPP_HIDE_FROM_ABI __deque_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER >= 14
- : __m_iter_(nullptr),
- __ptr_(nullptr)
-#endif
- {
- }
+ _LIBCPP_HIDE_FROM_ABI __deque_iterator() _NOEXCEPT {}
template <class _Pp, class _Rp, class _MP, __enable_if_t<is_convertible<_Pp, pointer>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI
@@ -376,11 +370,9 @@ public:
return __x.__ptr_ == __y.__ptr_;
}
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI friend bool operator!=(const __deque_iterator& __x, const __deque_iterator& __y) {
return !(__x == __y);
}
-#endif
// TODO(mordante) disable these overloads in the LLVM 20 release.
_LIBCPP_HIDE_FROM_ABI friend bool operator<(const __deque_iterator& __x, const __deque_iterator& __y) {
@@ -399,29 +391,6 @@ public:
return !(__x < __y);
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
- if (__x.__m_iter_ < __y.__m_iter_)
- return strong_ordering::less;
-
- if (__x.__m_iter_ == __y.__m_iter_) {
- if constexpr (three_way_comparable<pointer, strong_ordering>) {
- return __x.__ptr_ <=> __y.__ptr_;
- } else {
- if (__x.__ptr_ < __y.__ptr_)
- return strong_ordering::less;
-
- if (__x.__ptr_ == __y.__ptr_)
- return strong_ordering::equal;
-
- return strong_ordering::greater;
- }
- }
-
- return strong_ordering::greater;
- }
-#endif // _LIBCPP_STD_VER >= 20
-
private:
_LIBCPP_HIDE_FROM_ABI explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
: __m_iter_(__m),
@@ -608,9 +577,6 @@ public:
}
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
-#if _LIBCPP_STD_VER >= 14
- explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);
-#endif
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
@@ -626,44 +592,11 @@ public:
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI deque(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
- : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- __append_with_size(ranges::begin(__range), ranges::distance(__range));
-
- } else {
- for (auto&& __e : __range) {
- emplace_back(std::forward<decltype(__e)>(__e));
- }
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c);
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c, const __type_identity_t<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI deque& operator=(initializer_list<value_type> __il) {
- assign(__il);
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
- _LIBCPP_HIDE_FROM_ABI deque&
- operator=(deque&& __c) noexcept(__alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
-
- _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) { assign(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
-
template <class _InputIter,
__enable_if_t<__has_input_iterator_category<_InputIter>::value &&
!__has_random_access_iterator_category<_InputIter>::value,
@@ -672,23 +605,6 @@ public:
template <class _RAIter, __enable_if_t<__has_random_access_iterator_category<_RAIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI void assign(_RAIter __f, _RAIter __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void assign_range(_Range&& __range) {
- if constexpr (ranges::random_access_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __assign_with_size_random_access(ranges::begin(__range), __n);
-
- } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __assign_with_size(ranges::begin(__range), __n);
-
- } else {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT;
@@ -756,42 +672,7 @@ public:
// 23.2.2.3 modifiers:
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
_LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
-# if _LIBCPP_STD_VER >= 17
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
-# else
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
-# endif
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
-
- _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
- _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void prepend_range(_Range&& __range) {
- insert_range(begin(), std::forward<_Range>(__range));
- }
-
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void append_range(_Range&& __range) {
- insert_range(end(), std::forward<_Range>(__range));
- }
-# endif
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v);
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
- return insert(__p, __il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
@@ -802,34 +683,13 @@ public:
template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) {
- if constexpr (ranges::bidirectional_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- return __insert_bidirectional(__position, ranges::begin(__range), ranges::end(__range), __n);
-
- } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- return __insert_with_size(__position, ranges::begin(__range), __n);
-
- } else {
- return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void pop_front();
_LIBCPP_HIDE_FROM_ABI void pop_back();
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
_LIBCPP_HIDE_FROM_ABI void swap(deque& __c)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
-#endif
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI bool __invariants() const {
@@ -1231,27 +1091,6 @@ template <class _Tp, class _Alloc>
_LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque<_Tp, _Alloc>::__block_size =
__deque_block_size<value_type, difference_type>::value;
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-deque(_InputIterator, _InputIterator) -> deque<__iter_value_type<_InputIterator>, _Alloc>;
-
-template <class _InputIterator,
- class _Alloc,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-deque(_InputIterator, _InputIterator, _Alloc) -> deque<__iter_value_type<_InputIterator>, _Alloc>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque<ranges::range_value_t<_Range>, _Alloc>;
-#endif
-
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0, __default_init_tag()) {
__annotate_new(0);
@@ -1259,16 +1098,6 @@ deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0, __default
__append(__n);
}
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
- : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {
- __annotate_new(0);
- if (__n > 0)
- __append(__n);
-}
-#endif
-
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v) : __start_(0), __size_(0, __default_init_tag()) {
__annotate_new(0);
@@ -1316,72 +1145,6 @@ deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(const deque& __c) {
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il) : __start_(0), __size_(0, __default_init_tag()) {
- __annotate_new(0);
- __append(__il.begin(), __il.end());
-}
-
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator_type& __a)
- : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {
- __annotate_new(0);
- __append(__il.begin(), __il.end());
-}
-
-template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value)
- : __map_(std::move(__c.__map_)), __start_(std::move(__c.__start_)), __size_(std::move(__c.__size_)) {
- __c.__start_ = 0;
- __c.__size() = 0;
-}
-
-template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<allocator_type>& __a)
- : __map_(std::move(__c.__map_), __pointer_allocator(__a)),
- __start_(std::move(__c.__start_)),
- __size_(std::move(__c.__size()), __a) {
- if (__a == __c.__alloc()) {
- __c.__start_ = 0;
- __c.__size() = 0;
- } else {
- __map_.clear();
- __start_ = 0;
- __size() = 0;
- typedef move_iterator<iterator> _Ip;
- assign(_Ip(__c.begin()), _Ip(__c.end()));
- }
-}
-
-template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) noexcept(
- __alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value) {
- __move_assign(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
- return *this;
-}
-
-template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) {
- if (__alloc() != __c.__alloc()) {
- typedef move_iterator<iterator> _Ip;
- assign(_Ip(__c.begin()), _Ip(__c.end()));
- } else
- __move_assign(__c, true_type());
-}
-
-template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_assign(deque& __c,
- true_type) noexcept(is_nothrow_move_assignable<allocator_type>::value) {
- clear();
- shrink_to_fit();
- __move_assign(__c);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
template <class _InputIter,
__enable_if_t<__has_input_iterator_category<_InputIter>::value &&
@@ -1568,168 +1331,6 @@ void deque<_Tp, _Allocator>::push_front(const value_type& __v) {
++__size();
}
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::push_back(value_type&& __v) {
- allocator_type& __a = __alloc();
- if (__back_spare() == 0)
- __add_back_capacity();
- // __back_spare() >= 1
- __annotate_increase_back(1);
- __alloc_traits::construct(__a, std::addressof(*end()), std::move(__v));
- ++__size();
-}
-
-template <class _Tp, class _Allocator>
-template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
-typename deque<_Tp, _Allocator>::reference
-# else
-void
-# endif
-deque<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
- allocator_type& __a = __alloc();
- if (__back_spare() == 0)
- __add_back_capacity();
- // __back_spare() >= 1
- __annotate_increase_back(1);
- __alloc_traits::construct(__a, std::addressof(*end()), std::forward<_Args>(__args)...);
- ++__size();
-# if _LIBCPP_STD_VER >= 17
- return *--end();
-# endif
-}
-
-template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::push_front(value_type&& __v) {
- allocator_type& __a = __alloc();
- if (__front_spare() == 0)
- __add_front_capacity();
- // __front_spare() >= 1
- __annotate_increase_front(1);
- __alloc_traits::construct(__a, std::addressof(*--begin()), std::move(__v));
- --__start_;
- ++__size();
-}
-
-template <class _Tp, class _Allocator>
-template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
-typename deque<_Tp, _Allocator>::reference
-# else
-void
-# endif
-deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {
- allocator_type& __a = __alloc();
- if (__front_spare() == 0)
- __add_front_capacity();
- // __front_spare() >= 1
- __annotate_increase_front(1);
- __alloc_traits::construct(__a, std::addressof(*--begin()), std::forward<_Args>(__args)...);
- --__start_;
- ++__size();
-# if _LIBCPP_STD_VER >= 17
- return *begin();
-# endif
-}
-
-template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) {
- size_type __pos = __p - begin();
- size_type __to_end = size() - __pos;
- allocator_type& __a = __alloc();
- if (__pos < __to_end) { // insert by shifting things backward
- if (__front_spare() == 0)
- __add_front_capacity();
- // __front_spare() >= 1
- __annotate_increase_front(1);
- if (__pos == 0) {
- __alloc_traits::construct(__a, std::addressof(*--begin()), std::move(__v));
- --__start_;
- ++__size();
- } else {
- iterator __b = begin();
- iterator __bm1 = std::prev(__b);
- __alloc_traits::construct(__a, std::addressof(*__bm1), std::move(*__b));
- --__start_;
- ++__size();
- if (__pos > 1)
- __b = std::move(std::next(__b), __b + __pos, __b);
- *__b = std::move(__v);
- }
- } else { // insert by shifting things forward
- if (__back_spare() == 0)
- __add_back_capacity();
- // __back_capacity >= 1
- __annotate_increase_back(1);
- size_type __de = size() - __pos;
- if (__de == 0) {
- __alloc_traits::construct(__a, std::addressof(*end()), std::move(__v));
- ++__size();
- } else {
- iterator __e = end();
- iterator __em1 = std::prev(__e);
- __alloc_traits::construct(__a, std::addressof(*__e), std::move(*__em1));
- ++__size();
- if (__de > 1)
- __e = std::move_backward(__e - __de, __em1, __e);
- *--__e = std::move(__v);
- }
- }
- return begin() + __pos;
-}
-
-template <class _Tp, class _Allocator>
-template <class... _Args>
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args) {
- size_type __pos = __p - begin();
- size_type __to_end = size() - __pos;
- allocator_type& __a = __alloc();
- if (__pos < __to_end) { // insert by shifting things backward
- if (__front_spare() == 0)
- __add_front_capacity();
- // __front_spare() >= 1
- __annotate_increase_front(1);
- if (__pos == 0) {
- __alloc_traits::construct(__a, std::addressof(*--begin()), std::forward<_Args>(__args)...);
- --__start_;
- ++__size();
- } else {
- __temp_value<value_type, _Allocator> __tmp(__alloc(), std::forward<_Args>(__args)...);
- iterator __b = begin();
- iterator __bm1 = std::prev(__b);
- __alloc_traits::construct(__a, std::addressof(*__bm1), std::move(*__b));
- --__start_;
- ++__size();
- if (__pos > 1)
- __b = std::move(std::next(__b), __b + __pos, __b);
- *__b = std::move(__tmp.get());
- }
- } else { // insert by shifting things forward
- if (__back_spare() == 0)
- __add_back_capacity();
- // __back_capacity >= 1
- __annotate_increase_back(1);
- size_type __de = size() - __pos;
- if (__de == 0) {
- __alloc_traits::construct(__a, std::addressof(*end()), std::forward<_Args>(__args)...);
- ++__size();
- } else {
- __temp_value<value_type, _Allocator> __tmp(__alloc(), std::forward<_Args>(__args)...);
- iterator __e = end();
- iterator __em1 = std::prev(__e);
- __alloc_traits::construct(__a, std::addressof(*__e), std::move(*__em1));
- ++__size();
- if (__de > 1)
- __e = std::move_backward(__e - __de, __em1, __e);
- *--__e = std::move(__tmp.get());
- }
- }
- return begin() + __pos;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) {
size_type __pos = __p - begin();
@@ -1951,11 +1552,7 @@ template <class _Tp, class _Allocator>
template <class _InputIterator, class _Sentinel>
_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__append_with_sentinel(_InputIterator __f, _Sentinel __l) {
for (; __f != __l; ++__f)
-#ifdef _LIBCPP_CXX03_LANG
push_back(*__f);
-#else
- emplace_back(*__f);
-#endif
}
template <class _Tp, class _Allocator>
@@ -2484,11 +2081,7 @@ void deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f) {
template <class _Tp, class _Allocator>
inline void deque<_Tp, _Allocator>::swap(deque& __c)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>)
-#endif
{
__map_.swap(__c.__map_);
std::swap(__start_, __c.__start_);
@@ -2524,8 +2117,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const deque<_Tp, _Allocator>& __x,
return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
return !(__x == __y);
@@ -2551,62 +2142,17 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
return !(__y < __x);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
-operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
-erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
- auto __old_size = __c.size();
- __c.erase(std::remove(__c.begin(), __c.end(), __v), __c.end());
- return __old_size - __c.size();
-}
-
-template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
-erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) {
- auto __old_size = __c.size();
- __c.erase(std::remove_if(__c.begin(), __c.end(), __pred), __c.end());
- return __old_size - __c.size();
-}
-
-template <>
-inline constexpr bool __format::__enable_insertable<std::deque<char>> = true;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <>
-inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
-# endif
-
-#endif // _LIBCPP_STD_VER >= 20
-
-_LIBCPP_END_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _ValueT>
-using deque _LIBCPP_AVAILABILITY_PMR = std::deque<_ValueT, polymorphic_allocator<_ValueT>>;
-} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
-#endif
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/atomic>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/exception b/libcxx/include/__cxx03/exception
index 17a8aefd29bff..36406c4f3e8d4 100644
--- a/libcxx/include/__cxx03/exception
+++ b/libcxx/include/__cxx03/exception
@@ -88,7 +88,7 @@ template <class E> void rethrow_if_nested(const E& e);
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/ext/hash_map b/libcxx/include/__cxx03/ext/hash_map
index f075ed19ea40f..003e5ddcb76b4 100644
--- a/libcxx/include/__cxx03/ext/hash_map
+++ b/libcxx/include/__cxx03/ext/hash_map
@@ -312,17 +312,10 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit __hash_map_node_destructor(allocator_type& __na)
: __na_(__na), __first_constructed(false), __second_constructed(false) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __hash_map_node_destructor(std::__hash_node_destructor<allocator_type>&& __x)
- : __na_(__x.__na_), __first_constructed(__x.__value_constructed), __second_constructed(__x.__value_constructed) {
- __x.__value_constructed = false;
- }
-#else // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __hash_map_node_destructor(const std::__hash_node_destructor<allocator_type>& __x)
: __na_(__x.__na_), __first_constructed(__x.__value_constructed), __second_constructed(__x.__value_constructed) {
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) {
if (__second_constructed)
@@ -863,8 +856,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multimap<_Key, _Tp, _Has
} // namespace __gnu_cxx
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/iterator>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/ext/hash_set b/libcxx/include/__cxx03/ext/hash_set
index fefad7c5833b1..74c601fc3558e 100644
--- a/libcxx/include/__cxx03/ext/hash_set
+++ b/libcxx/include/__cxx03/ext/hash_set
@@ -575,8 +575,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multiset<_Value, _Hash,
} // namespace __gnu_cxx
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/iterator>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/forward_list b/libcxx/include/__cxx03/forward_list
index ecffb9c8f3a10..c890456c4cc96 100644
--- a/libcxx/include/__cxx03/forward_list
+++ b/libcxx/include/__cxx03/forward_list
@@ -317,23 +317,12 @@ struct __forward_list_node : public __begin_node_of<_Tp, _VoidPtr> {
// We allow starting the lifetime of nodes without initializing the value held by the node,
// since that is handled by the list itself in order to be allocator-aware.
-#ifndef _LIBCPP_CXX03_LANG
-
-private:
- union {
- _Tp __value_;
- };
-
-public:
- _LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return __value_; }
-#else
private:
_ALIGNAS_TYPE(_Tp) char __buffer_[sizeof(_Tp)];
public:
_LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return *std::__launder(reinterpret_cast<_Tp*>(&__buffer_)); }
-#endif
_LIBCPP_HIDE_FROM_ABI explicit __forward_list_node(_NodePtr __next) : _Base(__next) {}
_LIBCPP_HIDE_FROM_ABI ~__forward_list_node() {}
@@ -513,12 +502,6 @@ protected:
: __before_begin_(__begin_node(), __a) {}
public:
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI
- __forward_list_base(__forward_list_base&& __x) noexcept(is_nothrow_move_constructible<__node_allocator>::value);
- _LIBCPP_HIDE_FROM_ABI __forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
-
__forward_list_base(const __forward_list_base&) = delete;
__forward_list_base& operator=(const __forward_list_base&) = delete;
@@ -563,11 +546,7 @@ protected:
public:
_LIBCPP_HIDE_FROM_ABI void swap(__forward_list_base& __x)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>);
-#endif
protected:
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
@@ -587,26 +566,6 @@ private:
}
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Alloc>
-inline __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x) noexcept(
- is_nothrow_move_constructible<__node_allocator>::value)
- : __before_begin_(std::move(__x.__before_begin_)) {
- __x.__before_begin()->__next_ = nullptr;
-}
-
-template <class _Tp, class _Alloc>
-inline __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x, const allocator_type& __a)
- : __before_begin_(__begin_node(), __node_allocator(__a)) {
- if (__alloc() == __x.__alloc()) {
- __before_begin()->__next_ = __x.__before_begin()->__next_;
- __x.__before_begin()->__next_ = nullptr;
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Alloc>
__forward_list_base<_Tp, _Alloc>::~__forward_list_base() {
clear();
@@ -614,11 +573,7 @@ __forward_list_base<_Tp, _Alloc>::~__forward_list_base() {
template <class _Tp, class _Alloc>
inline void __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)
-#endif
{
std::__swap_allocator(
__alloc(), __x.__alloc(), integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
@@ -666,19 +621,12 @@ public:
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
-#if _LIBCPP_STD_VER >= 20
- typedef size_type __remove_return_type;
-#else
typedef void __remove_return_type;
-#endif
_LIBCPP_HIDE_FROM_ABI forward_list() _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {
} // = default;
_LIBCPP_HIDE_FROM_ABI explicit forward_list(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n);
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n, const allocator_type& __a);
-#endif
_LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);
template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
@@ -692,48 +640,16 @@ public:
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI forward_list(_InputIterator __f, _InputIterator __l, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI forward_list(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
- : base(__a) {
- prepend_range(std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x);
_LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x, const __type_identity_t<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI forward_list& operator=(const forward_list& __x);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x) noexcept(is_nothrow_move_constructible<base>::value)
- : base(std::move(__x)) {}
- _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a);
-
- _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI forward_list& operator=(forward_list&& __x) noexcept(
- __node_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
-
- _LIBCPP_HIDE_FROM_ABI forward_list& operator=(initializer_list<value_type> __il);
-
- _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
-
// ~forward_list() = default;
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
void _LIBCPP_HIDE_FROM_ABI assign(_InputIterator __f, _InputIterator __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void assign_range(_Range&& __range) {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return allocator_type(base::__alloc()); }
@@ -766,48 +682,15 @@ public:
_LIBCPP_HIDE_FROM_ABI reference front() { return base::__before_begin()->__next_->__get_value(); }
_LIBCPP_HIDE_FROM_ABI const_reference front() const { return base::__before_begin()->__next_->__get_value(); }
-#ifndef _LIBCPP_CXX03_LANG
-# if _LIBCPP_STD_VER >= 17
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
-# else
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
-# endif
- _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void prepend_range(_Range&& __range) {
- insert_range_after(cbefore_begin(), std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void pop_front();
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_after(const_iterator __p, _Args&&... __args);
-
- _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, value_type&& __v);
- _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list<value_type> __il) {
- return insert_after(__p, __il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI iterator insert_range_after(const_iterator __position, _Range&& __range) {
- return __insert_after_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
- }
-#endif
-
template <class _InputIterator, class _Sentinel>
_LIBCPP_HIDE_FROM_ABI iterator __insert_after_with_sentinel(const_iterator __p, _InputIterator __f, _Sentinel __l);
@@ -815,11 +698,7 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __f, const_iterator __l);
_LIBCPP_HIDE_FROM_ABI void swap(forward_list& __x)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)
-#endif
{
base::swap(__x);
}
@@ -842,13 +721,6 @@ public:
_LIBCPP_HIDE_FROM_ABI __remove_return_type unique() { return unique(__equal_to()); }
template <class _BinaryPredicate>
_LIBCPP_HIDE_FROM_ABI __remove_return_type unique(_BinaryPredicate __binary_pred);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void merge(forward_list&& __x) { merge(__x, __less<>()); }
- template <class _Compare>
- _LIBCPP_HIDE_FROM_ABI void merge(forward_list&& __x, _Compare __comp) {
- merge(__x, std::move(__comp));
- }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void merge(forward_list& __x) { merge(__x, __less<>()); }
template <class _Compare>
_LIBCPP_HIDE_FROM_ABI void merge(forward_list& __x, _Compare __comp);
@@ -858,12 +730,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void reverse() _NOEXCEPT;
private:
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, true_type)
- _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
- _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, false_type);
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Iter, class _Sent>
_LIBCPP_HIDE_FROM_ABI void __assign_with_sentinel(_Iter __f, _Sent __l);
@@ -875,27 +741,6 @@ private:
static _LIBCPP_HIDDEN __node_pointer __sort(__node_pointer __f, difference_type __sz, _Compare& __comp);
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-forward_list(_InputIterator, _InputIterator) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
-
-template <class _InputIterator,
- class _Alloc,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-forward_list(_InputIterator, _InputIterator, _Alloc) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-forward_list(from_range_t, _Range&&, _Alloc = _Alloc()) -> forward_list<ranges::range_value_t<_Range>, _Alloc>;
-#endif
-
template <class _Tp, class _Alloc>
inline forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a) : base(__a) {}
@@ -908,17 +753,6 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n) {
}
}
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __base_alloc) : base(__base_alloc) {
- if (__n > 0) {
- for (__begin_node_pointer __p = base::__before_begin(); __n > 0; --__n, __p = __p->__next_as_begin()) {
- __p->__next_ = this->__create_node(/* next = */ nullptr);
- }
- }
-}
-#endif
-
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(size_type __n, const value_type& __v) {
insert_after(cbefore_begin(), __n, __v);
@@ -957,60 +791,6 @@ forward_list<_Tp, _Alloc>& forward_list<_Tp, _Alloc>::operator=(const forward_li
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a)
- : base(std::move(__x), __a) {
- if (base::__alloc() != __x.__alloc()) {
- typedef move_iterator<iterator> _Ip;
- insert_after(cbefore_begin(), _Ip(__x.begin()), _Ip(__x.end()));
- }
-}
-
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il) {
- insert_after(cbefore_begin(), __il.begin(), __il.end());
-}
-
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il, const allocator_type& __a) : base(__a) {
- insert_after(cbefore_begin(), __il.begin(), __il.end());
-}
-
-template <class _Tp, class _Alloc>
-void forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, true_type)
- _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
- clear();
- base::__move_assign_alloc(__x);
- base::__before_begin()->__next_ = __x.__before_begin()->__next_;
- __x.__before_begin()->__next_ = nullptr;
-}
-
-template <class _Tp, class _Alloc>
-void forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, false_type) {
- if (base::__alloc() == __x.__alloc())
- __move_assign(__x, true_type());
- else {
- typedef move_iterator<iterator> _Ip;
- assign(_Ip(__x.begin()), _Ip(__x.end()));
- }
-}
-
-template <class _Tp, class _Alloc>
-inline forward_list<_Tp, _Alloc>& forward_list<_Tp, _Alloc>::operator=(forward_list&& __x) _NOEXCEPT_(
- __node_traits::propagate_on_container_move_assignment::value&& is_nothrow_move_assignable<allocator_type>::value) {
- __move_assign(__x, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
- return *this;
-}
-
-template <class _Tp, class _Alloc>
-inline forward_list<_Tp, _Alloc>& forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Alloc>
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> >
void forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l) {
@@ -1044,35 +824,6 @@ void forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v) {
erase_after(__i, __e);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Alloc>
-inline void forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
-}
-
-template <class _Tp, class _Alloc>
-template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
-typename forward_list<_Tp, _Alloc>::reference
-# else
-void
-# endif
-forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args) {
- base::__before_begin()->__next_ =
- this->__create_node(/* next = */ base::__before_begin()->__next_, std::forward<_Args>(__args)...);
-# if _LIBCPP_STD_VER >= 17
- return base::__before_begin()->__next_->__get_value();
-# endif
-}
-
-template <class _Tp, class _Alloc>
-void forward_list<_Tp, _Alloc>::push_front(value_type&& __v) {
- base::__before_begin()->__next_ = this->__create_node(/* next = */ base::__before_begin()->__next_, std::move(__v));
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Alloc>
void forward_list<_Tp, _Alloc>::push_front(const value_type& __v) {
base::__before_begin()->__next_ = this->__create_node(/* next = */ base::__before_begin()->__next_, __v);
@@ -1085,27 +836,6 @@ void forward_list<_Tp, _Alloc>::pop_front() {
this->__delete_node(__p);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Alloc>
-template <class... _Args>
-typename forward_list<_Tp, _Alloc>::iterator
-forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args) {
- __begin_node_pointer const __r = __p.__get_begin();
- __r->__next_ = this->__create_node(/* next = */ __r->__next_, std::forward<_Args>(__args)...);
- return iterator(__r->__next_);
-}
-
-template <class _Tp, class _Alloc>
-typename forward_list<_Tp, _Alloc>::iterator
-forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v) {
- __begin_node_pointer const __r = __p.__get_begin();
- __r->__next_ = this->__create_node(/* next = */ __r->__next_, std::move(__v));
- return iterator(__r->__next_);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __v) {
@@ -1481,8 +1211,6 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const forward_list<_Tp, _Alloc>& __x, cons
return (__ix == __ex) == (__iy == __ey);
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const forward_list<_Tp, _Alloc>& __x, const forward_list<_Tp, _Alloc>& __y) {
@@ -1513,50 +1241,17 @@ operator<=(const forward_list<_Tp, _Alloc>& __x, const forward_list<_Tp, _Alloc>
return !(__y < __x);
}
-#else // #if _LIBCPP_STD_VER <= 17
-
-template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
-operator<=>(const forward_list<_Tp, _Allocator>& __x, const forward_list<_Tp, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // #if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI void swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename forward_list<_Tp, _Allocator>::size_type
-erase_if(forward_list<_Tp, _Allocator>& __c, _Predicate __pred) {
- return __c.remove_if(__pred);
-}
-
-template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI typename forward_list<_Tp, _Allocator>::size_type
-erase(forward_list<_Tp, _Allocator>& __c, const _Up& __v) {
- return std::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
-}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _ValueT>
-using forward_list _LIBCPP_AVAILABILITY_PMR = std::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/atomic>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/fstream b/libcxx/include/__cxx03/fstream
index 7e43a533fd794..157a7cb347914 100644
--- a/libcxx/include/__cxx03/fstream
+++ b/libcxx/include/__cxx03/fstream
@@ -218,9 +218,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-# if _LIBCPP_STD_VER >= 26 && defined(_LIBCPP_WIN32API)
-_LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;
-# endif
template <class _CharT, class _Traits>
class _LIBCPP_TEMPLATE_VIS basic_filebuf : public basic_streambuf<_CharT, _Traits> {
@@ -231,15 +228,6 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
typedef typename traits_type::state_type state_type;
-# if _LIBCPP_STD_VER >= 26
-# if defined(_LIBCPP_WIN32API)
- using native_handle_type = void*; // HANDLE
-# elif __has_include(<unistd.h>)
- using native_handle_type = int; // POSIX file descriptor
-# else
-# error "Provide a native file handle!"
-# endif
-# endif
// 27.9.1.2 Constructors/destructor:
basic_filebuf();
@@ -258,26 +246,8 @@ public:
# endif
_LIBCPP_HIDE_FROM_ABI basic_filebuf* open(const string& __s, ios_base::openmode __mode);
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI basic_filebuf*
- open(const filesystem::path& __p, ios_base::openmode __mode) {
- return open(__p.c_str(), __mode);
- }
-# endif
_LIBCPP_HIDE_FROM_ABI basic_filebuf* __open(int __fd, ios_base::openmode __mode);
basic_filebuf* close();
-# if _LIBCPP_STD_VER >= 26
- _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept {
- _LIBCPP_ASSERT_UNCATEGORIZED(this->is_open(), "File must be opened");
-# if defined(_LIBCPP_WIN32API)
- return std::__filebuf_windows_native_handle(__file_);
-# elif __has_include(<unistd.h>)
- return fileno(__file_);
-# else
-# error "Provide a way to determine the file native handle!"
-# endif
- }
-# endif // _LIBCPP_STD_VER >= 26
_LIBCPP_HIDE_FROM_ABI inline static const char* __make_mdstring(ios_base::openmode __mode) _NOEXCEPT;
# ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
@@ -611,18 +581,6 @@ const char* basic_filebuf<_CharT, _Traits>::__make_mdstring(ios_base::openmode _
case ios_base::in | ios_base::out | ios_base::app | ios_base::binary:
case ios_base::in | ios_base::app | ios_base::binary:
return "a+b" _LIBCPP_FOPEN_CLOEXEC_MODE;
-# if _LIBCPP_STD_VER >= 23
- case ios_base::out | ios_base::noreplace:
- case ios_base::out | ios_base::trunc | ios_base::noreplace:
- return "wx" _LIBCPP_FOPEN_CLOEXEC_MODE;
- case ios_base::in | ios_base::out | ios_base::trunc | ios_base::noreplace:
- return "w+x" _LIBCPP_FOPEN_CLOEXEC_MODE;
- case ios_base::out | ios_base::binary | ios_base::noreplace:
- case ios_base::out | ios_base::trunc | ios_base::binary | ios_base::noreplace:
- return "wbx" _LIBCPP_FOPEN_CLOEXEC_MODE;
- case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary | ios_base::noreplace:
- return "w+bx" _LIBCPP_FOPEN_CLOEXEC_MODE;
-# endif // _LIBCPP_STD_VER >= 23
default:
return nullptr;
}
@@ -663,18 +621,6 @@ const wchar_t* basic_filebuf<_CharT, _Traits>::__make_mdwstring(ios_base::openmo
case ios_base::in | ios_base::out | ios_base::app | ios_base::binary:
case ios_base::in | ios_base::app | ios_base::binary:
return L"a+b";
-# if _LIBCPP_STD_VER >= 23
- case ios_base::out | ios_base::noreplace:
- case ios_base::out | ios_base::trunc | ios_base::noreplace:
- return L"wx";
- case ios_base::in | ios_base::out | ios_base::trunc | ios_base::noreplace:
- return L"w+x";
- case ios_base::out | ios_base::binary | ios_base::noreplace:
- case ios_base::out | ios_base::trunc | ios_base::binary | ios_base::noreplace:
- return L"wbx";
- case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary | ios_base::noreplace:
- return L"w+bx";
-# endif // _LIBCPP_STD_VER >= 23
default:
return nullptr;
}
@@ -1091,9 +1037,6 @@ public:
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
-# if _LIBCPP_STD_VER >= 26
- using native_handle_type = typename basic_filebuf<_CharT, _Traits>::native_handle_type;
-# endif
_LIBCPP_HIDE_FROM_ABI basic_ifstream();
_LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);
@@ -1101,32 +1044,17 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
# endif
_LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
-# if _LIBCPP_STD_VER >= 17
- template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
- _LIBCPP_HIDE_FROM_ABI explicit basic_ifstream(const _Tp& __p, ios_base::openmode __mode = ios_base::in)
- : basic_ifstream(__p.c_str(), __mode) {}
-# endif // _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI basic_ifstream(basic_ifstream&& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_ifstream& operator=(basic_ifstream&& __rhs);
_LIBCPP_HIDE_FROM_ABI void swap(basic_ifstream& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
-# if _LIBCPP_STD_VER >= 26
- _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }
-# endif
_LIBCPP_HIDE_FROM_ABI bool is_open() const;
void open(const char* __s, ios_base::openmode __mode = ios_base::in);
# ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
# endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void
- open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) {
- return open(__p.c_str(), __mode);
- }
-# endif // _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI void __open(int __fd, ios_base::openmode __mode);
_LIBCPP_HIDE_FROM_ABI void close();
@@ -1245,9 +1173,6 @@ public:
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
-# if _LIBCPP_STD_VER >= 26
- using native_handle_type = typename basic_filebuf<_CharT, _Traits>::native_handle_type;
-# endif
_LIBCPP_HIDE_FROM_ABI basic_ofstream();
_LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
@@ -1256,21 +1181,11 @@ public:
# endif
_LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
-# if _LIBCPP_STD_VER >= 17
- template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
- _LIBCPP_HIDE_FROM_ABI explicit basic_ofstream(const _Tp& __p, ios_base::openmode __mode = ios_base::out)
- : basic_ofstream(__p.c_str(), __mode) {}
-# endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI basic_ofstream(basic_ofstream&& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_ofstream& operator=(basic_ofstream&& __rhs);
_LIBCPP_HIDE_FROM_ABI void swap(basic_ofstream& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
-# if _LIBCPP_STD_VER >= 26
- _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }
-# endif
_LIBCPP_HIDE_FROM_ABI bool is_open() const;
void open(const char* __s, ios_base::openmode __mode = ios_base::out);
# ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
@@ -1278,13 +1193,6 @@ public:
# endif
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void
- open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) {
- return open(__p.c_str(), __mode);
- }
-# endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI void __open(int __fd, ios_base::openmode __mode);
_LIBCPP_HIDE_FROM_ABI void close();
@@ -1402,9 +1310,6 @@ public:
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
-# if _LIBCPP_STD_VER >= 26
- using native_handle_type = typename basic_filebuf<_CharT, _Traits>::native_handle_type;
-# endif
_LIBCPP_HIDE_FROM_ABI basic_fstream();
_LIBCPP_HIDE_FROM_ABI explicit basic_fstream(const char* __s,
@@ -1416,13 +1321,6 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit basic_fstream(const string& __s,
ios_base::openmode __mode = ios_base::in | ios_base::out);
-# if _LIBCPP_STD_VER >= 17
- template <class _Tp, class = enable_if_t<is_same_v<_Tp, filesystem::path>>>
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI explicit basic_fstream(
- const _Tp& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
- : basic_fstream(__p.c_str(), __mode) {}
-# endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI basic_fstream(basic_fstream&& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_fstream& operator=(basic_fstream&& __rhs);
@@ -1430,9 +1328,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void swap(basic_fstream& __rhs);
_LIBCPP_HIDE_FROM_ABI basic_filebuf<char_type, traits_type>* rdbuf() const;
-# if _LIBCPP_STD_VER >= 26
- _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() const noexcept { return rdbuf()->native_handle(); }
-# endif
_LIBCPP_HIDE_FROM_ABI bool is_open() const;
_LIBCPP_HIDE_FROM_ABI void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
# ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
@@ -1440,13 +1335,6 @@ public:
# endif
_LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_HIDE_FROM_ABI void
- open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) {
- return open(__p.c_str(), __mode);
- }
-# endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI void close();
private:
@@ -1557,7 +1445,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/functional b/libcxx/include/__cxx03/functional
index 985fcfa953204..a8cba5c13fec6 100644
--- a/libcxx/include/__cxx03/functional
+++ b/libcxx/include/__cxx03/functional
@@ -544,44 +544,25 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <__cxx03/__functional/unary_function.h>
#include <__cxx03/__functional/unary_negate.h>
-#ifndef _LIBCPP_CXX03_LANG
-# include <__cxx03/__functional/function.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-# include <__cxx03/__functional/boyer_moore_searcher.h>
-# include <__cxx03/__functional/default_searcher.h>
-# include <__cxx03/__functional/invoke.h>
-# include <__cxx03/__functional/not_fn.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-# include <__cxx03/__functional/bind_back.h>
-# include <__cxx03/__functional/bind_front.h>
-# include <__cxx03/__functional/identity.h>
-# include <__cxx03/__functional/ranges_operations.h>
-# include <__cxx03/__type_traits/unwrap_ref.h>
-#endif
-
#include <__cxx03/version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/limits>
# include <__cxx03/new>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/array>
# include <__cxx03/initializer_list>
# include <__cxx03/unordered_map>
# include <__cxx03/vector>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/future b/libcxx/include/__cxx03/future
index 9f43b87e04f32..20e739885ad0e 100644
--- a/libcxx/include/__cxx03/future
+++ b/libcxx/include/__cxx03/future
@@ -411,52 +411,13 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc> : public true_type {};
-# ifdef _LIBCPP_CXX03_LANG
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc::__lx> : public true_type {};
-# endif
// enum class launch
_LIBCPP_DECLARE_STRONG_ENUM(launch){async = 1, deferred = 2, any = async | deferred};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)
-# ifndef _LIBCPP_CXX03_LANG
-
-typedef underlying_type<launch>::type __launch_underlying_type;
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator&(launch __x, launch __y) {
- return static_cast<launch>(static_cast<__launch_underlying_type>(__x) & static_cast<__launch_underlying_type>(__y));
-}
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator|(launch __x, launch __y) {
- return static_cast<launch>(static_cast<__launch_underlying_type>(__x) | static_cast<__launch_underlying_type>(__y));
-}
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator^(launch __x, launch __y) {
- return static_cast<launch>(static_cast<__launch_underlying_type>(__x) ^ static_cast<__launch_underlying_type>(__y));
-}
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr launch operator~(launch __x) {
- return static_cast<launch>(~static_cast<__launch_underlying_type>(__x) & 3);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI launch& operator&=(launch& __x, launch __y) {
- __x = __x & __y;
- return __x;
-}
-
-inline _LIBCPP_HIDE_FROM_ABI launch& operator|=(launch& __x, launch __y) {
- __x = __x | __y;
- return __x;
-}
-
-inline _LIBCPP_HIDE_FROM_ABI launch& operator^=(launch& __x, launch __y) {
- __x = __x ^ __y;
- return __x;
-}
-
-# endif // !_LIBCPP_CXX03_LANG
-
// enum class future_status
_LIBCPP_DECLARE_STRONG_ENUM(future_status){ready, timeout, deferred};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
@@ -482,10 +443,6 @@ class _LIBCPP_EXPORTED_FROM_ABI future_error : public logic_error {
friend class promise;
public:
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI explicit future_error(future_errc __ec) : future_error(std::make_error_code(__ec)) {}
-# endif
-
_LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
_LIBCPP_HIDE_FROM_ABI future_error(const future_error&) _NOEXCEPT = default;
@@ -1730,16 +1687,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void reset();
};
-# if _LIBCPP_STD_VER >= 17
-
-template <class _Rp, class... _Args>
-packaged_task(_Rp (*)(_Args...)) -> packaged_task<_Rp(_Args...)>;
-
-template <class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
-packaged_task(_Fp) -> packaged_task<_Stripped>;
-
-# endif
-
template <class... _ArgTypes>
void packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args) {
if (__p_.__state_ == nullptr)
@@ -1807,69 +1754,6 @@ _LIBCPP_HIDE_FROM_ABI future<_Rp> __make_async_assoc_state(_Fp&& __f) {
return future<_Rp>(__h.get());
}
-# ifndef _LIBCPP_CXX03_LANG
-
-template <class _Fp, class... _Args>
-class _LIBCPP_HIDDEN __async_func {
- tuple<_Fp, _Args...> __f_;
-
-public:
- typedef typename __invoke_of<_Fp, _Args...>::type _Rp;
-
- _LIBCPP_HIDE_FROM_ABI explicit __async_func(_Fp&& __f, _Args&&... __args)
- : __f_(std::move(__f), std::move(__args)...) {}
-
- _LIBCPP_HIDE_FROM_ABI __async_func(__async_func&& __f) : __f_(std::move(__f.__f_)) {}
-
- _LIBCPP_HIDE_FROM_ABI _Rp operator()() {
- typedef typename __make_tuple_indices<1 + sizeof...(_Args), 1>::type _Index;
- return __execute(_Index());
- }
-
-private:
- template <size_t... _Indices>
- _LIBCPP_HIDE_FROM_ABI _Rp __execute(__tuple_indices<_Indices...>) {
- return std::__invoke(std::move(std::get<0>(__f_)), std::move(std::get<_Indices>(__f_))...);
- }
-};
-
-inline _LIBCPP_HIDE_FROM_ABI bool __does_policy_contain(launch __policy, launch __value) {
- return (int(__policy) & int(__value)) != 0;
-}
-
-template <class _Fp, class... _Args>
-_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
-async(launch __policy, _Fp&& __f, _Args&&... __args) {
- typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF;
- typedef typename _BF::_Rp _Rp;
-
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif
- if (__does_policy_contain(__policy, launch::async))
- return std::__make_async_assoc_state<_Rp>(
- _BF(_LIBCPP_AUTO_CAST(std::forward<_Fp>(__f)), _LIBCPP_AUTO_CAST(std::forward<_Args>(__args))...));
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- if (__policy == launch::async)
- throw;
- }
-# endif
-
- if (__does_policy_contain(__policy, launch::deferred))
- return std::__make_deferred_assoc_state<_Rp>(
- _BF(_LIBCPP_AUTO_CAST(std::forward<_Fp>(__f)), _LIBCPP_AUTO_CAST(std::forward<_Args>(__args))...));
- return future<_Rp>{};
-}
-
-template <class _Fp, class... _Args>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
-async(_Fp&& __f, _Args&&... __args) {
- return std::async(launch::any, std::forward<_Fp>(__f), std::forward<_Args>(__args)...);
-}
-
-# endif // C++03
-
// shared_future
template <class _Rp>
@@ -2047,11 +1931,11 @@ _LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/chrono>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/cstdlib>
# include <__cxx03/exception>
diff --git a/libcxx/include/__cxx03/iomanip b/libcxx/include/__cxx03/iomanip
index 8f75e23f67ac7..faade2ec4e649 100644
--- a/libcxx/include/__cxx03/iomanip
+++ b/libcxx/include/__cxx03/iomanip
@@ -505,38 +505,6 @@ __quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT
return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
}
-#if _LIBCPP_STD_VER >= 14
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto quoted(const _CharT* __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
- const _CharT* __end = __s;
- while (*__end)
- ++__end;
- return __quoted_output_proxy<_CharT, void>(__s, __end, __delim, __escape);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI auto
-quoted(const basic_string<_CharT, _Traits, _Allocator>& __s,
- _CharT __delim = _CharT('"'),
- _CharT __escape = _CharT('\\')) {
- return __quoted_output_proxy<_CharT, _Traits>(__s.data(), __s.data() + __s.size(), __delim, __escape);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI auto
-quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
- return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
-}
-
-template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI auto
-quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
- return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
-}
-
-#endif // _LIBCPP_STD_VER >= 14
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___CXX03_IOMANIP
diff --git a/libcxx/include/__cxx03/ios b/libcxx/include/__cxx03/ios
index ace6d666d6b58..1ae5e8145fa8e 100644
--- a/libcxx/include/__cxx03/ios
+++ b/libcxx/include/__cxx03/ios
@@ -283,20 +283,15 @@ public:
static const openmode in = 0x08;
static const openmode out = 0x10;
static const openmode trunc = 0x20;
-# if _LIBCPP_STD_VER >= 23
- static const openmode noreplace = 0x40;
-# endif
enum seekdir { beg, cur, end };
-# if _LIBCPP_STD_VER <= 14
typedef iostate io_state;
typedef openmode open_mode;
typedef seekdir seek_dir;
typedef std::streamoff streamoff;
typedef std::streampos streampos;
-# endif
class _LIBCPP_EXPORTED_FROM_ABI Init;
@@ -416,10 +411,8 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type {};
-# ifdef _LIBCPP_CXX03_LANG
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type {};
-# endif
_LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;
@@ -565,13 +558,9 @@ public:
static_assert(is_same<_CharT, typename traits_type::char_type>::value,
"traits_type::char_type must be the same type as CharT");
-# ifdef _LIBCPP_CXX03_LANG
// Preserve the ability to compare with literal 0,
// and implicitly convert to bool, but not implicitly convert to int.
_LIBCPP_HIDE_FROM_ABI operator void*() const { return fail() ? nullptr : (void*)this; }
-# else
- _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }
-# endif
_LIBCPP_HIDE_FROM_ABI bool operator!() const { return fail(); }
_LIBCPP_HIDE_FROM_ABI iostate rdstate() const { return ios_base::rdstate(); }
@@ -870,7 +859,7 @@ _LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstddef>
diff --git a/libcxx/include/__cxx03/iosfwd b/libcxx/include/__cxx03/iosfwd
index 624bd157d4962..674e901c30650 100644
--- a/libcxx/include/__cxx03/iosfwd
+++ b/libcxx/include/__cxx03/iosfwd
@@ -140,26 +140,6 @@ typedef fpos<mbstate_t> u8streampos;
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;
-#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
-
-template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
-class basic_syncbuf;
-
-using syncbuf = basic_syncbuf<char>;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wsyncbuf = basic_syncbuf<wchar_t>;
-# endif
-
-template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
-class basic_osyncstream;
-
-using osyncstream = basic_osyncstream<char>;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wosyncstream = basic_osyncstream<wchar_t>;
-# endif
-
-#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
-
template <class _CharT, class _Traits>
class __save_flags {
typedef basic_ios<_CharT, _Traits> __stream_type;
diff --git a/libcxx/include/__cxx03/istream b/libcxx/include/__cxx03/istream
index b1f7b0888d71b..9e2eadc60b400 100644
--- a/libcxx/include/__cxx03/istream
+++ b/libcxx/include/__cxx03/istream
@@ -515,31 +515,6 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
return __is;
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _CharT, class _Traits, size_t _Np>
-inline _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>& __is, _CharT (&__buf)[_Np]) {
- size_t __n = _Np;
- if (__is.width() > 0)
- __n = std::min(size_t(__is.width()), _Np);
- return std::__input_c_string(__is, __buf, __n);
-}
-
-template <class _Traits, size_t _Np>
-inline _LIBCPP_HIDE_FROM_ABI basic_istream<char, _Traits>&
-operator>>(basic_istream<char, _Traits>& __is, unsigned char (&__buf)[_Np]) {
- return __is >> (char(&)[_Np])__buf;
-}
-
-template <class _Traits, size_t _Np>
-inline _LIBCPP_HIDE_FROM_ABI basic_istream<char, _Traits>&
-operator>>(basic_istream<char, _Traits>& __is, signed char (&__buf)[_Np]) {
- return __is >> (char(&)[_Np])__buf;
-}
-
-#else
-
template <class _CharT, class _Traits>
inline _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s) {
@@ -561,8 +536,6 @@ operator>>(basic_istream<char, _Traits>& __is, signed char* __s) {
return __is >> (char*)__s;
}
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c) {
ios_base::iostate __state = ios_base::goodbit;
@@ -1361,8 +1334,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/iosfwd>
# include <__cxx03/ostream>
# include <__cxx03/type_traits>
diff --git a/libcxx/include/__cxx03/iterator b/libcxx/include/__cxx03/iterator
index 5ac8a4274b3dd..aa9cb94f70638 100644
--- a/libcxx/include/__cxx03/iterator
+++ b/libcxx/include/__cxx03/iterator
@@ -738,11 +738,7 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <__cxx03/variant>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/exception>
# include <__cxx03/new>
diff --git a/libcxx/include/__cxx03/limits b/libcxx/include/__cxx03/limits
index bfc3cb8e1bb19..f4f8eb70062a7 100644
--- a/libcxx/include/__cxx03/limits
+++ b/libcxx/include/__cxx03/limits
@@ -577,7 +577,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/list b/libcxx/include/__cxx03/list
index 647bb770646ca..e3d2e53a52ab1 100644
--- a/libcxx/include/__cxx03/list
+++ b/libcxx/include/__cxx03/list
@@ -313,23 +313,12 @@ template <class _Tp, class _VoidPtr>
struct __list_node : public __list_node_base<_Tp, _VoidPtr> {
// We allow starting the lifetime of nodes without initializing the value held by the node,
// since that is handled by the list itself in order to be allocator-aware.
-#ifndef _LIBCPP_CXX03_LANG
-
-private:
- union {
- _Tp __value_;
- };
-
-public:
- _LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return __value_; }
-#else
private:
_ALIGNAS_TYPE(_Tp) char __buffer_[sizeof(_Tp)];
public:
_LIBCPP_HIDE_FROM_ABI _Tp& __get_value() { return *std::__launder(reinterpret_cast<_Tp*>(&__buffer_)); }
-#endif
typedef __list_node_base<_Tp, _VoidPtr> __base;
typedef typename __base::__link_pointer __link_pointer;
@@ -516,9 +505,6 @@ protected:
_LIBCPP_HIDE_FROM_ABI __list_imp() _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
_LIBCPP_HIDE_FROM_ABI __list_imp(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI __list_imp(const __node_allocator& __a);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __list_imp(__node_allocator&& __a) _NOEXCEPT;
-#endif
_LIBCPP_HIDE_FROM_ABI ~__list_imp();
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __sz() == 0; }
@@ -529,11 +515,7 @@ protected:
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_as_link()); }
_LIBCPP_HIDE_FROM_ABI void swap(__list_imp& __c)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
-#endif
_LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __list_imp& __c) {
__copy_assign_alloc(
@@ -608,11 +590,6 @@ inline __list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a) : __size_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, std::move(__a)) {}
-#endif
-
template <class _Tp, class _Alloc>
__list_imp<_Tp, _Alloc>::~__list_imp() {
clear();
@@ -635,11 +612,7 @@ void __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT {
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_v<allocator_type>)
-#endif
{
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__alloc_traits::propagate_on_container_swap::value || this->__node_alloc() == __c.__node_alloc(),
@@ -686,18 +659,11 @@ public:
typedef typename base::const_iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER >= 20
- typedef size_type __remove_return_type;
-#else
typedef void __remove_return_type;
-#endif
_LIBCPP_HIDE_FROM_ABI list() _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {}
_LIBCPP_HIDE_FROM_ABI explicit list(const allocator_type& __a) : base(__a) {}
_LIBCPP_HIDE_FROM_ABI explicit list(size_type __n);
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);
-#endif
_LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);
template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x, const allocator_type& __a) : base(__a) {
@@ -711,44 +677,13 @@ public:
template <class _InpIter, __enable_if_t<__has_input_iterator_category<_InpIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI list(_InpIter __f, _InpIter __l, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI list(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type()) : base(__a) {
- prepend_range(std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI list(const list& __c);
_LIBCPP_HIDE_FROM_ABI list(const list& __c, const __type_identity_t<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI list& operator=(const list& __c);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI list(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI list(initializer_list<value_type> __il, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI list(list&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
- _LIBCPP_HIDE_FROM_ABI list(list&& __c, const __type_identity_t<allocator_type>& __a);
- _LIBCPP_HIDE_FROM_ABI list& operator=(list&& __c)
- _NOEXCEPT_(__node_alloc_traits::propagate_on_container_move_assignment::value&&
- is_nothrow_move_assignable<__node_allocator>::value);
-
- _LIBCPP_HIDE_FROM_ABI list& operator=(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) { assign(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
template <class _InpIter, __enable_if_t<__has_input_iterator_category<_InpIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI void assign(_InpIter __f, _InpIter __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void assign_range(_Range&& __range) {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __x);
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT;
@@ -790,55 +725,10 @@ public:
return base::__end_.__prev_->__as_node()->__get_value();
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
- _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void prepend_range(_Range&& __range) {
- insert_range(begin(), std::forward<_Range>(__range));
- }
-
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void append_range(_Range&& __range) {
- insert_range(end(), std::forward<_Range>(__range));
- }
-# endif
-
- template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
-# else
- _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
-# endif
- template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
-# else
- _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
-# endif
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x);
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
- return insert(__p, __il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __x);
_LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __x);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Arg>
- _LIBCPP_HIDE_FROM_ABI void __emplace_back(_Arg&& __arg) {
- emplace_back(std::forward<_Arg>(__arg));
- }
-#else
_LIBCPP_HIDE_FROM_ABI void __emplace_back(value_type const& __arg) { push_back(__arg); }
-#endif
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x);
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __x);
@@ -846,19 +736,8 @@ public:
template <class _InpIter, __enable_if_t<__has_input_iterator_category<_InpIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InpIter __f, _InpIter __l);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) {
- return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(list& __c)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>)
-#endif
{
base::swap(__c);
}
@@ -874,13 +753,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __x);
_LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list&& __c) { splice(__p, __c); }
- _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list&& __c, const_iterator __i) { splice(__p, __c, __i); }
- _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l) {
- splice(__p, __c, __f, __l);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c, const_iterator __i);
_LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
@@ -891,14 +763,6 @@ public:
template <class _BinaryPred>
_LIBCPP_HIDE_FROM_ABI __remove_return_type unique(_BinaryPred __binary_pred);
_LIBCPP_HIDE_FROM_ABI void merge(list& __c);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void merge(list&& __c) { merge(__c); }
-
- template <class _Comp>
- _LIBCPP_HIDE_FROM_ABI void merge(list&& __c, _Comp __comp) {
- merge(__c, __comp);
- }
-#endif
template <class _Comp>
_LIBCPP_HIDE_FROM_ABI void merge(list& __c, _Comp __comp);
@@ -930,27 +794,6 @@ private:
_LIBCPP_HIDE_FROM_ABI 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<__has_input_iterator_category<_InputIterator>::value>,
- 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<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-list(_InputIterator, _InputIterator, _Alloc) -> list<__iter_value_type<_InputIterator>, _Alloc>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-list(from_range_t, _Range&&, _Alloc = _Alloc()) -> list<ranges::range_value_t<_Range>, _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) {
@@ -986,21 +829,9 @@ inline typename list<_Tp, _Alloc>::iterator list<_Tp, _Alloc>::__iterator(size_t
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n) {
for (; __n > 0; --__n)
-#ifndef _LIBCPP_CXX03_LANG
- emplace_back();
-#else
push_back(value_type());
-#endif
}
-#if _LIBCPP_STD_VER >= 14
-template <class _Tp, class _Alloc>
-list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a) {
- for (; __n > 0; --__n)
- emplace_back();
-}
-#endif
-
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x) {
for (; __n > 0; --__n)
@@ -1034,63 +865,6 @@ list<_Tp, _Alloc>::list(const list& __c, const __type_identity_t<allocator_type>
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) {
- 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) {
- 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(std::move(__c.__node_alloc())) {
- splice(end(), __c);
-}
-
-template <class _Tp, class _Alloc>
-inline list<_Tp, _Alloc>::list(list&& __c, const __type_identity_t<allocator_type>& __a) : base(__a) {
- 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 != std::addressof(__c)) {
@@ -1237,82 +1011,6 @@ void list<_Tp, _Alloc>::push_back(const value_type& __x) {
++base::__sz();
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::push_front(value_type&& __x) {
- __node_pointer __node = this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::move(__x));
- __link_pointer __nl = __node->__as_link();
- __link_nodes_at_front(__nl, __nl);
- ++base::__sz();
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::push_back(value_type&& __x) {
- __node_pointer __node = this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::move(__x));
- __link_pointer __nl = __node->__as_link();
- __link_nodes_at_back(__nl, __nl);
- ++base::__sz();
-}
-
-template <class _Tp, class _Alloc>
-template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
-typename list<_Tp, _Alloc>::reference
-# else
-void
-# endif
-list<_Tp, _Alloc>::emplace_front(_Args&&... __args) {
- __node_pointer __node =
- this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::forward<_Args>(__args)...);
- __link_pointer __nl = __node->__as_link();
- __link_nodes_at_front(__nl, __nl);
- ++base::__sz();
-# if _LIBCPP_STD_VER >= 17
- return __node->__get_value();
-# endif
-}
-
-template <class _Tp, class _Alloc>
-template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
-typename list<_Tp, _Alloc>::reference
-# else
-void
-# endif
-list<_Tp, _Alloc>::emplace_back(_Args&&... __args) {
- __node_pointer __node =
- this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::forward<_Args>(__args)...);
- __link_pointer __nl = __node->__as_link();
- __link_nodes_at_back(__nl, __nl);
- ++base::__sz();
-# if _LIBCPP_STD_VER >= 17
- return __node->__get_value();
-# endif
-}
-
-template <class _Tp, class _Alloc>
-template <class... _Args>
-typename list<_Tp, _Alloc>::iterator list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args) {
- __node_pointer __node =
- this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::forward<_Args>(__args)...);
- __link_pointer __nl = __node->__as_link();
- __link_nodes(__p.__ptr_, __nl, __nl);
- ++base::__sz();
- return iterator(__nl);
-}
-
-template <class _Tp, class _Alloc>
-typename list<_Tp, _Alloc>::iterator list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x) {
- __node_pointer __node = this->__create_node(/* prev = */ nullptr, /* next = */ nullptr, std::move(__x));
- __link_pointer __nl = __node->__as_link();
- __link_nodes(__p.__ptr_, __nl, __nl);
- ++base::__sz();
- return iterator(__nl);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::pop_front() {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::pop_front() called with empty list");
@@ -1647,8 +1345,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const list<_Tp, _Alloc>& __x, const
return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) {
return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
@@ -1674,58 +1370,17 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const list<_Tp, _Alloc>& __x, const
return !(__y < __x);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
-operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI void swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI 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_HIDE_FROM_ABI typename list<_Tp, _Allocator>::size_type
-erase(list<_Tp, _Allocator>& __c, const _Up& __v) {
- return std::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
-}
-
-template <>
-inline constexpr bool __format::__enable_insertable<std::list<char>> = true;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <>
-inline constexpr bool __format::__enable_insertable<std::list<wchar_t>> = true;
-# endif
-
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _ValueT>
-using list _LIBCPP_AVAILABILITY_PMR = std::list<_ValueT, polymorphic_allocator<_ValueT>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/atomic>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/locale b/libcxx/include/__cxx03/locale
index 6360bbc2f6b60..4c1006d672e20 100644
--- a/libcxx/include/__cxx03/locale
+++ b/libcxx/include/__cxx03/locale
@@ -3136,8 +3136,6 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
# endif
-# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT)
-
template <class _Codecvt,
class _Elem = wchar_t,
class _WideAlloc = allocator<_Elem>,
@@ -3157,19 +3155,11 @@ private:
size_t __cvtcount_;
public:
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI wstring_convert() : wstring_convert(new _Codecvt) {}
- _LIBCPP_HIDE_FROM_ABI explicit wstring_convert(_Codecvt* __pcvt);
-# else
_LIBCPP_HIDE_FROM_ABI _LIBCPP_EXPLICIT_SINCE_CXX14 wstring_convert(_Codecvt* __pcvt = new _Codecvt);
-# endif
_LIBCPP_HIDE_FROM_ABI wstring_convert(_Codecvt* __pcvt, state_type __state);
_LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string());
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI wstring_convert(wstring_convert&& __wc);
-# endif
_LIBCPP_HIDE_FROM_ABI ~wstring_convert();
wstring_convert(const wstring_convert& __wc) = delete;
@@ -3214,20 +3204,6 @@ wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(
__cvtptr_ = new _Codecvt;
}
-# ifndef _LIBCPP_CXX03_LANG
-
-template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
-inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(wstring_convert&& __wc)
- : __byte_err_string_(std::move(__wc.__byte_err_string_)),
- __wide_err_string_(std::move(__wc.__wide_err_string_)),
- __cvtptr_(__wc.__cvtptr_),
- __cvtstate_(__wc.__cvtstate_),
- __cvtcount_(__wc.__cvtcount_) {
- __wc.__cvtptr_ = nullptr;
-}
-
-# endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::~wstring_convert() {
@@ -3380,14 +3356,8 @@ private:
bool __always_noconv_;
public:
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI wbuffer_convert() : wbuffer_convert(nullptr) {}
- explicit _LIBCPP_HIDE_FROM_ABI
- wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type());
-# else
_LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
wbuffer_convert(streambuf* __bytebuf = nullptr, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type());
-# endif
_LIBCPP_HIDE_FROM_ABI ~wbuffer_convert();
@@ -3743,8 +3713,6 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::__
_LIBCPP_SUPPRESS_DEPRECATED_POP
-# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT)
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
@@ -3753,7 +3721,7 @@ _LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdarg>
diff --git a/libcxx/include/__cxx03/map b/libcxx/include/__cxx03/map
index bd03d8b741a71..090fb94d84356 100644
--- a/libcxx/include/__cxx03/map
+++ b/libcxx/include/__cxx03/map
@@ -645,18 +645,6 @@ public:
using std::swap;
swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
}
-
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _CP& __y) const {
- return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);
- }
-
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _K2& __y) const {
- return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);
- }
-#endif
};
template <class _Key, class _CP, class _Compare>
@@ -683,18 +671,6 @@ public:
using std::swap;
swap(__comp_, __y.__comp_);
}
-
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _CP& __y) const {
- return __comp_(__x, __y.__get_value().first);
- }
-
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _K2& __y) const {
- return __comp_(__x.__get_value().first, __y);
- }
-#endif
};
template <class _Key, class _CP, class _Compare, bool __b>
@@ -724,15 +700,6 @@ public:
__first_constructed(false),
__second_constructed(false) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
- : __na_(__x.__na_),
- __first_constructed(__x.__value_constructed),
- __second_constructed(__x.__value_constructed) {
- __x.__value_constructed = false;
- }
-#endif // _LIBCPP_CXX03_LANG
-
__map_node_destructor& operator=(const __map_node_destructor&) = delete;
_LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {
@@ -752,70 +719,6 @@ class multimap;
template <class _TreeIterator>
class __map_const_iterator;
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Tp>
-struct _LIBCPP_STANDALONE_DEBUG __value_type {
- typedef _Key key_type;
- typedef _Tp mapped_type;
- typedef pair<const key_type, mapped_type> value_type;
- typedef pair<key_type&, mapped_type&> __nc_ref_pair_type;
- typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type;
-
-private:
- value_type __cc_;
-
-public:
- _LIBCPP_HIDE_FROM_ABI value_type& __get_value() {
-# if _LIBCPP_STD_VER >= 17
- return *std::launder(std::addressof(__cc_));
-# else
- return __cc_;
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI const value_type& __get_value() const {
-# if _LIBCPP_STD_VER >= 17
- return *std::launder(std::addressof(__cc_));
-# else
- return __cc_;
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI __nc_ref_pair_type __ref() {
- value_type& __v = __get_value();
- return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second);
- }
-
- _LIBCPP_HIDE_FROM_ABI __nc_rref_pair_type __move() {
- value_type& __v = __get_value();
- return __nc_rref_pair_type(std::move(const_cast<key_type&>(__v.first)), std::move(__v.second));
- }
-
- _LIBCPP_HIDE_FROM_ABI __value_type& operator=(const __value_type& __v) {
- __ref() = __v.__get_value();
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI __value_type& operator=(__value_type&& __v) {
- __ref() = __v.__move();
- return *this;
- }
-
- template <class _ValueTp, __enable_if_t<__is_same_uncvref<_ValueTp, value_type>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI __value_type& operator=(_ValueTp&& __v) {
- __ref() = std::forward<_ValueTp>(__v);
- return *this;
- }
-
- __value_type() = delete;
- ~__value_type() = delete;
- __value_type(const __value_type&) = delete;
- __value_type(__value_type&&) = delete;
-};
-
-#else
-
template <class _Key, class _Tp>
struct __value_type {
typedef _Key key_type;
@@ -835,8 +738,6 @@ public:
~__value_type() = delete;
};
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
struct __extract_key_value_types;
@@ -1011,11 +912,6 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
- typedef __insert_return_type<iterator, node_type> insert_return_type;
-#endif
-
template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS map;
template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
@@ -1046,80 +942,18 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- map(from_range_t,
- _Range&& __range,
- const key_compare& __comp = key_compare(),
- const allocator_type& __a = allocator_type())
- : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
- : map(__f, __l, key_compare(), __a) {}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI map(from_range_t, _Range&& __range, const allocator_type& __a)
- : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI map(const map& __m) : __tree_(__m.__tree_) { insert(__m.begin(), __m.end()); }
_LIBCPP_HIDE_FROM_ABI map& operator=(const map& __m) {
-#ifndef _LIBCPP_CXX03_LANG
- __tree_ = __m.__tree_;
-#else
if (this != std::addressof(__m)) {
__tree_.clear();
__tree_.value_comp() = __m.__tree_.value_comp();
__tree_.__copy_assign_alloc(__m.__tree_);
insert(__m.begin(), __m.end());
}
-#endif
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI map(map&& __m) noexcept(is_nothrow_move_constructible<__base>::value)
- : __tree_(std::move(__m.__tree_)) {}
-
- _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) noexcept(is_nothrow_move_assignable<__base>::value) {
- __tree_ = std::move(__m.__tree_);
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
- : __tree_(__vc(__comp)) {
- insert(__il.begin(), __il.end());
- }
-
- _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
- insert(__il.begin(), __il.end());
- }
-
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const allocator_type& __a)
- : map(__il, key_compare(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI map& operator=(initializer_list<value_type> __il) {
- __tree_.__assign_unique(__il.begin(), __il.end());
- return *this;
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit map(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}
_LIBCPP_HIDE_FROM_ABI map(const map& __m, const allocator_type& __a)
@@ -1149,9 +983,6 @@ public:
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
_LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
-#endif
_LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
_LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
@@ -1160,150 +991,18 @@ public:
_LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }
_LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return value_compare(__tree_.value_comp().key_comp()); }
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
- return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...);
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __p) {
- return __tree_.__insert_unique(std::forward<_Pp>(__p));
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {
- return __tree_.__insert_unique(__pos.__i_, std::forward<_Pp>(__p));
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__insert_unique(__v); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
return __tree_.__insert_unique(__p.__i_, __v);
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {
- return __tree_.__insert_unique(std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
- return __tree_.__insert_unique(__p.__i_, std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-#endif
-
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {
for (const_iterator __e = cend(); __f != __l; ++__f)
insert(__e.__i_, *__f);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- const_iterator __end = cend();
- for (auto&& __element : __range) {
- insert(__end.__i_, std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {
- return __tree_.__emplace_unique_key_args(
- __k,
- std::piecewise_construct,
- std::forward_as_tuple(__k),
- std::forward_as_tuple(std::forward<_Args>(__args)...));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {
- return __tree_.__emplace_unique_key_args(
- __k,
- std::piecewise_construct,
- std::forward_as_tuple(std::move(__k)),
- std::forward_as_tuple(std::forward<_Args>(__args)...));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) {
- return __tree_
- .__emplace_hint_unique_key_args(
- __h.__i_,
- __k,
- std::piecewise_construct,
- std::forward_as_tuple(__k),
- std::forward_as_tuple(std::forward<_Args>(__args)...))
- .first;
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) {
- return __tree_
- .__emplace_hint_unique_key_args(
- __h.__i_,
- __k,
- std::piecewise_construct,
- std::forward_as_tuple(std::move(__k)),
- std::forward_as_tuple(std::forward<_Args>(__args)...))
- .first;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
- iterator __p = lower_bound(__k);
- if (__p != end() && !key_comp()(__k, __p->first)) {
- __p->second = std::forward<_Vp>(__v);
- return std::make_pair(__p, false);
- }
- return std::make_pair(emplace_hint(__p, __k, std::forward<_Vp>(__v)), true);
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
- iterator __p = lower_bound(__k);
- if (__p != end() && !key_comp()(__k, __p->first)) {
- __p->second = std::forward<_Vp>(__v);
- return std::make_pair(__p, false);
- }
- return std::make_pair(emplace_hint(__p, std::move(__k), std::forward<_Vp>(__v)), true);
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {
- auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, __k, std::forward<_Vp>(__v));
-
- if (!__inserted)
- __r->__get_value().second = std::forward<_Vp>(__v);
-
- return __r;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {
- auto [__r, __inserted] =
- __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, std::move(__k), std::forward<_Vp>(__v));
-
- if (!__inserted)
- __r->__get_value().second = std::forward<_Vp>(__v);
-
- return __r;
- }
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }
@@ -1312,106 +1011,18 @@ public:
}
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to map::insert()");
- return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to map::insert()");
- return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __tree_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __tree_.template __node_handle_extract<node_type>(__it.__i_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); }
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __tree_.find(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __tree_.find(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __tree_.__count_multi(__k);
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
- return __tree_.lower_bound(__k);
- }
-
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
- return __tree_.lower_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
- return __tree_.upper_bound(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
- return __tree_.upper_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __tree_.__equal_range_unique(__k);
@@ -1419,16 +1030,6 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __tree_.__equal_range_unique(__k);
}
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __tree_.__equal_range_multi(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __tree_.__equal_range_multi(__k);
- }
-#endif
private:
typedef typename __base::__node __node;
@@ -1440,95 +1041,9 @@ private:
typedef __map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
-#ifdef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);
-#endif
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Compare = less<__iter_key_type<_InputIterator>>,
- class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Compare = less<__range_key_type<_Range>>,
- class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
- -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
-# endif
-
-template <class _Key,
- class _Tp,
- class _Compare = less<remove_const_t<_Key>>,
- class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(initializer_list<pair<_Key, _Tp>>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(_InputIterator, _InputIterator, _Allocator)
- -> map<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- less<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(from_range_t, _Range&&, _Allocator)
- -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
-# endif
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(initializer_list<pair<_Key, _Tp>>,
- _Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
- : __tree_(std::move(__m.__tree_), typename __base::allocator_type(__a)) {
- if (__a != __m.get_allocator()) {
- const_iterator __e = cend();
- while (!__m.empty())
- __tree_.__insert_unique(__e.__i_, __m.__tree_.remove(__m.begin().__i_)->__value_.__move());
- }
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
- return __tree_
- .__emplace_unique_key_args(__k, std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
- .first->__get_value()
- .second;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) {
- // TODO investigate this clang-tidy warning.
- // NOLINTBEGIN(bugprone-use-after-move)
- return __tree_
- .__emplace_unique_key_args(
- __k, std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
- .first->__get_value()
- .second;
- // NOLINTEND(bugprone-use-after-move)
-}
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type& __k) {
@@ -1554,8 +1069,6 @@ _Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
return __r->__value_.__get_value().second;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) {
__parent_pointer __parent;
@@ -1580,8 +1093,6 @@ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,
return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator<(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
@@ -1612,16 +1123,6 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,
return !(__y < __x);
}
-#else // #if _LIBCPP_STD_VER <= 17
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
-operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // #if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void
swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1629,14 +1130,6 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Alloca
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename map<_Key, _Tp, _Compare, _Allocator>::size_type
-erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS multimap {
public:
@@ -1687,10 +1180,6 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
-#endif
-
template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS map;
template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
@@ -1721,30 +1210,6 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- multimap(from_range_t,
- _Range&& __range,
- const key_compare& __comp = key_compare(),
- const allocator_type& __a = allocator_type())
- : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
- : multimap(__f, __l, key_compare(), __a) {}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI multimap(from_range_t, _Range&& __range, const allocator_type& __a)
- : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m)
: __tree_(__m.__tree_.value_comp(),
__alloc_traits::select_on_container_copy_construction(__m.__tree_.__alloc())) {
@@ -1752,54 +1217,15 @@ public:
}
_LIBCPP_HIDE_FROM_ABI multimap& operator=(const multimap& __m) {
-#ifndef _LIBCPP_CXX03_LANG
- __tree_ = __m.__tree_;
-#else
if (this != std::addressof(__m)) {
__tree_.clear();
__tree_.value_comp() = __m.__tree_.value_comp();
__tree_.__copy_assign_alloc(__m.__tree_);
insert(__m.begin(), __m.end());
}
-#endif
- return *this;
- }
-
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) noexcept(is_nothrow_move_constructible<__base>::value)
- : __tree_(std::move(__m.__tree_)) {}
-
- _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI multimap& operator=(multimap&& __m) noexcept(is_nothrow_move_assignable<__base>::value) {
- __tree_ = std::move(__m.__tree_);
return *this;
}
- _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
- : __tree_(__vc(__comp)) {
- insert(__il.begin(), __il.end());
- }
-
- _LIBCPP_HIDE_FROM_ABI
- multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
- insert(__il.begin(), __il.end());
- }
-
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const allocator_type& __a)
- : multimap(__il, key_compare(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI multimap& operator=(initializer_list<value_type> __il) {
- __tree_.__assign_multi(__il.begin(), __il.end());
- return *this;
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit multimap(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}
_LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m, const allocator_type& __a)
@@ -1832,38 +1258,6 @@ public:
_LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }
_LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return value_compare(__tree_.value_comp().key_comp()); }
-#ifndef _LIBCPP_CXX03_LANG
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
- return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __tree_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __p) {
- return __tree_.__insert_multi(std::forward<_Pp>(__p));
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {
- return __tree_.__insert_multi(__pos.__i_, std::forward<_Pp>(__p));
- }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
- return __tree_.__insert_multi(__p.__i_, std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
@@ -1876,16 +1270,6 @@ public:
__tree_.__insert_multi(__e.__i_, *__f);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- const_iterator __end = cend();
- for (auto&& __element : __range) {
- __tree_.__insert_multi(__end.__i_, std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }
@@ -1893,49 +1277,6 @@ public:
return __tree_.erase(__f.__i_, __l.__i_);
}
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to multimap::insert()");
- return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to multimap::insert()");
- return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __tree_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __tree_.template __node_handle_extract<node_type>(__it.__i_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __tree_.__node_handle_merge_multi(__source.__tree_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
_LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
@@ -1944,59 +1285,14 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __tree_.find(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __tree_.find(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __tree_.__count_multi(__k);
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
- return __tree_.lower_bound(__k);
- }
-
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
- return __tree_.lower_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
- return __tree_.upper_bound(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
- return __tree_.upper_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __tree_.__equal_range_multi(__k);
@@ -2004,16 +1300,6 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __tree_.__equal_range_multi(__k);
}
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __tree_.__equal_range_multi(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __tree_.__equal_range_multi(__k);
- }
-#endif
private:
typedef typename __base::__node __node;
@@ -2024,77 +1310,12 @@ private:
typedef unique_ptr<__node, _Dp> __node_holder;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Compare = less<__iter_key_type<_InputIterator>>,
- class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Compare = less<__range_key_type<_Range>>,
- class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
- -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
-# endif
-
-template <class _Key,
- class _Tp,
- class _Compare = less<remove_const_t<_Key>>,
- class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(initializer_list<pair<_Key, _Tp>>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(_InputIterator, _InputIterator, _Allocator)
- -> multimap<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- less<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(from_range_t, _Range&&, _Allocator)
- -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
-# endif
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(initializer_list<pair<_Key, _Tp>>,
- _Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
- : __tree_(std::move(__m.__tree_), typename __base::allocator_type(__a)) {
- if (__a != __m.get_allocator()) {
- const_iterator __e = cend();
- while (!__m.empty())
- __tree_.__insert_multi(__e.__i_, std::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__move()));
- }
-}
-#endif
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
@@ -2125,17 +1346,6 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<
return !(__y < __x);
}
-#else // #if _LIBCPP_STD_VER <= 17
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
-operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
- const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);
-}
-
-#endif // #if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void
swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2143,34 +1353,11 @@ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compar
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename multimap<_Key, _Tp, _Compare, _Allocator>::size_type
-erase_if(multimap<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using map _LIBCPP_AVAILABILITY_PMR =
- std::map<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
-
-template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using multimap _LIBCPP_AVAILABILITY_PMR =
- std::multimap<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/functional>
# include <__cxx03/iterator>
diff --git a/libcxx/include/__cxx03/memory b/libcxx/include/__cxx03/memory
index ea417bb827c78..4c2eab7e3d5f6 100644
--- a/libcxx/include/__cxx03/memory
+++ b/libcxx/include/__cxx03/memory
@@ -951,24 +951,6 @@ template<class Pointer = void, class Smart, class... Args>
#include <__cxx03/__memory/unique_ptr.h>
#include <__cxx03/__memory/uses_allocator.h>
-// standard-mandated includes
-
-#if _LIBCPP_STD_VER >= 17
-# include <__cxx03/__memory/construct_at.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-# include <__cxx03/__memory/assume_aligned.h>
-# include <__cxx03/__memory/concepts.h>
-# include <__cxx03/__memory/ranges_construct_at.h>
-# include <__cxx03/__memory/ranges_uninitialized_algorithms.h>
-# include <__cxx03/__memory/uses_allocator_construction.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-# include <__cxx03/__memory/allocate_at_least.h>
-#endif
-
#include <__cxx03/version>
// [memory.syn]
@@ -978,7 +960,7 @@ template<class Pointer = void, class Smart, class... Args>
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstddef>
diff --git a/libcxx/include/__cxx03/mutex b/libcxx/include/__cxx03/mutex
index a799a0b774ad7..eca5a23f89680 100644
--- a/libcxx/include/__cxx03/mutex
+++ b/libcxx/include/__cxx03/mutex
@@ -201,9 +201,6 @@ template<class Callable, class ...Args>
#include <__cxx03/__utility/forward.h>
#include <__cxx03/cstddef>
#include <__cxx03/limits>
-#ifndef _LIBCPP_CXX03_LANG
-# include <__cxx03/tuple>
-#endif
#include <__cxx03/version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -335,24 +332,6 @@ _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) {
return 0;
}
-# ifndef _LIBCPP_CXX03_LANG
-
-template <class _L0, class _L1, class _L2, class... _L3>
-_LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
- int __r = 0;
- unique_lock<_L0> __u0(__l0, try_to_lock);
- if (__u0.owns_lock()) {
- __r = std::try_lock(__l1, __l2, __l3...);
- if (__r == -1)
- __u0.release();
- else
- ++__r;
- }
- return __r;
-}
-
-# endif // _LIBCPP_CXX03_LANG
-
template <class _L0, class _L1>
_LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) {
while (true) {
@@ -374,131 +353,13 @@ _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) {
__libcpp_thread_yield();
}
}
-
-# ifndef _LIBCPP_CXX03_LANG
-
-template <class _L0, class _L1, class _L2, class... _L3>
-void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
- while (true) {
- switch (__i) {
- case 0: {
- unique_lock<_L0> __u0(__l0);
- __i = std::try_lock(__l1, __l2, __l3...);
- if (__i == -1) {
- __u0.release();
- return;
- }
- }
- ++__i;
- __libcpp_thread_yield();
- break;
- case 1: {
- unique_lock<_L1> __u1(__l1);
- __i = std::try_lock(__l2, __l3..., __l0);
- if (__i == -1) {
- __u1.release();
- return;
- }
- }
- if (__i == sizeof...(_L3) + 1)
- __i = 0;
- else
- __i += 2;
- __libcpp_thread_yield();
- break;
- default:
- std::__lock_first(__i - 2, __l2, __l3..., __l0, __l1);
- return;
- }
- }
-}
-
-template <class _L0, class _L1, class _L2, class... _L3>
-inline _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
- std::__lock_first(0, __l0, __l1, __l2, __l3...);
-}
-
-# endif // _LIBCPP_CXX03_LANG
-
-# if _LIBCPP_STD_VER >= 17
-template <class... _Mutexes>
-class _LIBCPP_TEMPLATE_VIS scoped_lock;
-
-template <>
-class _LIBCPP_TEMPLATE_VIS scoped_lock<> {
-public:
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock() {}
- ~scoped_lock() = default;
-
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t) {}
-
- scoped_lock(scoped_lock const&) = delete;
- scoped_lock& operator=(scoped_lock const&) = delete;
-};
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) scoped_lock<_Mutex> {
-public:
- typedef _Mutex mutex_type;
-
-private:
- mutex_type& __m_;
-
-public:
- [[nodiscard]]
- _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
- : __m_(__m) {
- __m_.lock();
- }
-
- ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) { __m_.unlock(); }
-
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t, mutex_type& __m)
- _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
- : __m_(__m) {}
-
- scoped_lock(scoped_lock const&) = delete;
- scoped_lock& operator=(scoped_lock const&) = delete;
-};
-
-template <class... _MArgs>
-class _LIBCPP_TEMPLATE_VIS scoped_lock {
- static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");
- typedef tuple<_MArgs&...> _MutexTuple;
-
-public:
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(_MArgs&... __margs) : __t_(__margs...) {
- std::lock(__margs...);
- }
-
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {}
-
- _LIBCPP_HIDE_FROM_ABI ~scoped_lock() {
- typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
- __unlock_unpack(_Indices{}, __t_);
- }
-
- scoped_lock(scoped_lock const&) = delete;
- scoped_lock& operator=(scoped_lock const&) = delete;
-
-private:
- template <size_t... _Indx>
- _LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
- (std::get<_Indx>(__mt).unlock(), ...);
- }
-
- _MutexTuple __t_;
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
-
-# endif // _LIBCPP_STD_VER >= 17
#endif // !_LIBCPP_HAS_NO_THREADS
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/new b/libcxx/include/__cxx03/new
index 9a893e727b44b..c9994c876c200 100644
--- a/libcxx/include/__cxx03/new
+++ b/libcxx/include/__cxx03/new
@@ -107,7 +107,7 @@ void operator delete[](void* ptr, void*) noexcept;
# define _LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION
#endif
-#if !defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_STD_VER < 14 && defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
+#if !defined(_LIBCPP_BUILDING_LIBRARY) && defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
# define _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
#endif
@@ -177,29 +177,11 @@ _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_array_new_length(
}
#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && !defined(_LIBCPP_ABI_VCRUNTIME)
-# ifndef _LIBCPP_CXX03_LANG
-enum class align_val_t : size_t {};
-# else
enum align_val_t { __zero = 0, __max = (size_t)-1 };
-# endif
#endif
-
-#if _LIBCPP_STD_VER >= 20
-// Enable the declaration even if the compiler doesn't support the language
-// feature.
-struct destroying_delete_t {
- explicit destroying_delete_t() = default;
-};
-inline constexpr destroying_delete_t destroying_delete{};
-#endif // _LIBCPP_STD_VER >= 20
-
} // namespace std
-#if defined(_LIBCPP_CXX03_LANG)
# define _THROW_BAD_ALLOC throw(std::bad_alloc)
-#else
-# define _THROW_BAD_ALLOC
-#endif
#if !defined(_LIBCPP_ABI_VCRUNTIME)
@@ -334,27 +316,9 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(
return __builtin_launder(__p);
}
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp>
-[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept {
- return std::__launder(__p);
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-
-# if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
-
-inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;
-inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;
-
-# endif // defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
-
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/numeric b/libcxx/include/__cxx03/numeric
index 992641b8c210b..01101cf759ea6 100644
--- a/libcxx/include/__cxx03/numeric
+++ b/libcxx/include/__cxx03/numeric
@@ -186,12 +186,11 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
-# include <__cxx03/initializer_list>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/limits>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/climits>
# include <__cxx03/cmath>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/ostream b/libcxx/include/__cxx03/ostream
index 4400fa60ba7e7..4c98eea328ca8 100644
--- a/libcxx/include/__cxx03/ostream
+++ b/libcxx/include/__cxx03/ostream
@@ -176,17 +176,13 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
#include <__cxx03/__ostream/basic_ostream.h>
-#if _LIBCPP_STD_VER >= 23
-# include <__cxx03/__ostream/print.h>
-#endif
-
#include <__cxx03/version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdio>
diff --git a/libcxx/include/__cxx03/queue b/libcxx/include/__cxx03/queue
index 5f0189e61ee45..cf98e27a03620 100644
--- a/libcxx/include/__cxx03/queue
+++ b/libcxx/include/__cxx03/queue
@@ -313,47 +313,12 @@ public:
_LIBCPP_HIDE_FROM_ABI queue(const queue& __q) : c(__q.c) {}
-#if _LIBCPP_STD_VER >= 23
- template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI queue(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
-
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI queue(from_range_t, _Range&& __range) : c(from_range, std::forward<_Range>(__range)) {}
-
- template <class _InputIterator,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI queue(_InputIterator __first, _InputIterator __second, const _Alloc& __alloc)
- : c(__first, __second, __alloc) {}
-
- template <_ContainerCompatibleRange<_Tp> _Range,
- class _Alloc,
- __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI queue(from_range_t, _Range&& __range, const _Alloc& __alloc)
- : c(from_range, std::forward<_Range>(__range), __alloc) {}
-
-#endif
-
_LIBCPP_HIDE_FROM_ABI queue& operator=(const queue& __q) {
c = __q.c;
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI queue(queue&& __q) noexcept(is_nothrow_move_constructible<container_type>::value)
- : c(std::move(__q.c)) {}
-
- _LIBCPP_HIDE_FROM_ABI queue& operator=(queue&& __q) noexcept(is_nothrow_move_assignable<container_type>::value) {
- c = std::move(__q.c);
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit queue(const container_type& __c) : c(__c) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI explicit queue(container_type&& __c) : c(std::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit queue(const _Alloc& __a) : c(__a) {}
@@ -364,14 +329,6 @@ public:
template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI queue(const container_type& __c, const _Alloc& __a) : c(__c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI queue(container_type&& __c, const _Alloc& __a) : c(std::move(__c), __a) {}
-
- template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI queue(queue&& __q, const _Alloc& __a) : c(std::move(__q.c), __a) {}
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
_LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
@@ -381,34 +338,6 @@ public:
_LIBCPP_HIDE_FROM_ABI const_reference back() const { return c.back(); }
_LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void push(value_type&& __v) { c.push_back(std::move(__v)); }
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void push_range(_Range&& __range) {
- if constexpr (requires(container_type& __c) { __c.append_range(std::forward<_Range>(__range)); }) {
- c.append_range(std::forward<_Range>(__range));
- } else {
- ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
- }
- }
-# endif
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI
-# if _LIBCPP_STD_VER >= 17
- decltype(auto)
- emplace(_Args&&... __args) {
- return c.emplace_back(std::forward<_Args>(__args)...);
- }
-# else
- void
- emplace(_Args&&... __args) {
- c.emplace_back(std::forward<_Args>(__args)...);
- }
-# endif
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void pop() { c.pop_front(); }
_LIBCPP_HIDE_FROM_ABI void swap(queue& __q) _NOEXCEPT_(__is_nothrow_swappable_v<container_type>) {
@@ -427,38 +356,6 @@ public:
operator<(const queue<_T1, _OtherContainer>& __x, const queue<_T1, _OtherContainer>& __y);
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >
-queue(_Container) -> queue<typename _Container::value_type, _Container>;
-
-template <class _Container,
- class _Alloc,
- class = enable_if_t<!__is_allocator<_Container>::value>,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
-queue(_Container, _Alloc) -> queue<typename _Container::value_type, _Container>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
-queue(_InputIterator, _InputIterator) -> queue<__iter_value_type<_InputIterator>>;
-
-template <ranges::input_range _Range>
-queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;
-
-template <class _InputIterator,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-queue(_InputIterator,
- _InputIterator,
- _Alloc) -> queue<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
-
-template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-queue(from_range_t,
- _Range&&,
- _Alloc) -> queue<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
-#endif
-
template <class _Tp, class _Container>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y) {
return __x.c == __y.c;
@@ -489,17 +386,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const queue<_Tp, _Container>& __x,
return !(__y < __x);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp, three_way_comparable _Container>
-_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
-operator<=>(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y) {
- // clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
- return __x.__get_container() <=> __y.__get_container();
-}
-
-#endif
-
template <class _Tp, class _Container, __enable_if_t<__is_swappable_v<_Container>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI void swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
@@ -538,24 +424,8 @@ public:
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI priority_queue(priority_queue&& __q) noexcept(
- is_nothrow_move_constructible<container_type>::value && is_nothrow_move_constructible<value_compare>::value)
- : c(std::move(__q.c)), comp(std::move(__q.comp)) {}
-
- _LIBCPP_HIDE_FROM_ABI priority_queue& operator=(priority_queue&& __q) noexcept(
- is_nothrow_move_assignable<container_type>::value && is_nothrow_move_assignable<value_compare>::value) {
- c = std::move(__q.c);
- comp = std::move(__q.comp);
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit priority_queue(const value_compare& __comp) : c(), comp(__comp) {}
_LIBCPP_HIDE_FROM_ABI priority_queue(const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI priority_queue(const value_compare& __comp, container_type&& __c);
-#endif
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp = value_compare());
@@ -563,20 +433,6 @@ public:
_LIBCPP_HIDE_FROM_ABI
priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI
- priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c);
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI priority_queue(from_range_t, _Range&& __range, const value_compare& __comp = value_compare())
- : c(from_range, std::forward<_Range>(__range)), comp(__comp) {
- std::make_heap(c.begin(), c.end(), comp);
- }
-#endif
-
template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit priority_queue(const _Alloc& __a);
@@ -589,14 +445,6 @@ public:
template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI priority_queue(const priority_queue& __q, const _Alloc& __a);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a);
-
- template <class _Alloc, __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI priority_queue(priority_queue&& __q, const _Alloc& __a);
-#endif // _LIBCPP_CXX03_LANG
-
template <
class _InputIter,
class _Alloc,
@@ -619,60 +467,11 @@ public:
_LIBCPP_HIDE_FROM_ABI priority_queue(
_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c, const _Alloc& __a);
-#ifndef _LIBCPP_CXX03_LANG
- template <
- class _InputIter,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIter>::value && uses_allocator<container_type, _Alloc>::value,
- int> = 0>
- _LIBCPP_HIDE_FROM_ABI
- priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c, const _Alloc& __a);
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER >= 23
-
- template <_ContainerCompatibleRange<_Tp> _Range,
- class _Alloc,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value>>
- _LIBCPP_HIDE_FROM_ABI priority_queue(from_range_t, _Range&& __range, const value_compare& __comp, const _Alloc& __a)
- : c(from_range, std::forward<_Range>(__range), __a), comp(__comp) {
- std::make_heap(c.begin(), c.end(), comp);
- }
-
- template <_ContainerCompatibleRange<_Tp> _Range,
- class _Alloc,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value>>
- _LIBCPP_HIDE_FROM_ABI priority_queue(from_range_t, _Range&& __range, const _Alloc& __a)
- : c(from_range, std::forward<_Range>(__range), __a), comp() {
- std::make_heap(c.begin(), c.end(), comp);
- }
-
-#endif
-
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
_LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
_LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.front(); }
_LIBCPP_HIDE_FROM_ABI void push(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void push(value_type&& __v);
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void push_range(_Range&& __range) {
- if constexpr (requires(container_type& __c) { __c.append_range(std::forward<_Range>(__range)); }) {
- c.append_range(std::forward<_Range>(__range));
- } else {
- ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
- }
-
- std::make_heap(c.begin(), c.end(), comp);
- }
-# endif
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI void emplace(_Args&&... __args);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void pop();
_LIBCPP_HIDE_FROM_ABI void swap(priority_queue& __q)
@@ -681,100 +480,12 @@ public:
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI const _Container& __get_container() const { return c; }
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Compare,
- class _Container,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value> >
-priority_queue(_Compare, _Container) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
-
-template <class _InputIterator,
- class _Compare = less<__iter_value_type<_InputIterator>>,
- class _Container = vector<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value> >
-priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())
- -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>;
-
-template <class _Compare,
- class _Container,
- class _Alloc,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value>,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
-priority_queue(_Compare, _Container, _Alloc) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
-priority_queue(_InputIterator, _InputIterator, _Allocator)
- -> priority_queue<__iter_value_type<_InputIterator>,
- vector<__iter_value_type<_InputIterator>, _Allocator>,
- less<__iter_value_type<_InputIterator>>>;
-
-template <class _InputIterator,
- class _Compare,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
-priority_queue(_InputIterator, _InputIterator, _Compare, _Allocator)
- -> priority_queue<__iter_value_type<_InputIterator>,
- vector<__iter_value_type<_InputIterator>, _Allocator>,
- _Compare>;
-
-template <class _InputIterator,
- class _Compare,
- class _Container,
- class _Alloc,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value>,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
-priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
- -> priority_queue<typename _Container::value_type, _Container, _Compare>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-
-template <ranges::input_range _Range,
- class _Compare = less<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value>>
-priority_queue(from_range_t, _Range&&, _Compare = _Compare())
- -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>>, _Compare>;
-
-template <ranges::input_range _Range,
- class _Compare,
- class _Alloc,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value>>
-priority_queue(from_range_t, _Range&&, _Compare, _Alloc)
- -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>, _Compare>;
-
-template <ranges::input_range _Range, class _Alloc, class = enable_if_t<__is_allocator<_Alloc>::value>>
-priority_queue(from_range_t, _Range&&, _Alloc)
- -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>>;
-
-#endif
-
template <class _Tp, class _Container, class _Compare>
inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp, const container_type& __c)
: c(__c), comp(__comp) {
std::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Container, class _Compare>
-inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, container_type&& __c)
- : c(std::move(__c)), comp(__comp) {
- std::make_heap(c.begin(), c.end(), comp);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Container, class _Compare>
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
@@ -792,19 +503,6 @@ inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
std::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Container, class _Compare>
-template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
-inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
- _InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c)
- : c(std::move(__c)), comp(__comp) {
- c.insert(c.end(), __f, __l);
- std::make_heap(c.begin(), c.end(), comp);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Container, class _Compare>
template <class _Alloc, __enable_if_t<uses_allocator<_Container, _Alloc>::value, int> >
inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a) : c(__a) {}
@@ -827,23 +525,6 @@ template <class _Alloc, __enable_if_t<uses_allocator<_Container, _Alloc>::value,
inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q, const _Alloc& __a)
: c(__q.c, __a), comp(__q.comp) {}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Container, class _Compare>
-template <class _Alloc, __enable_if_t<uses_allocator<_Container, _Alloc>::value, int> >
-inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
- const value_compare& __comp, container_type&& __c, const _Alloc& __a)
- : c(std::move(__c), __a), comp(__comp) {
- std::make_heap(c.begin(), c.end(), comp);
-}
-
-template <class _Tp, class _Container, class _Compare>
-template <class _Alloc, __enable_if_t<uses_allocator<_Container, _Alloc>::value, int> >
-inline priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q, const _Alloc& __a)
- : c(std::move(__q.c), __a), comp(std::move(__q.comp)) {}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Container, class _Compare>
template <
class _InputIter,
@@ -877,43 +558,12 @@ inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
std::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp, class _Container, class _Compare>
-template <
- class _InputIter,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIter>::value && uses_allocator<_Container, _Alloc>::value, int> >
-inline priority_queue<_Tp, _Container, _Compare>::priority_queue(
- _InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c, const _Alloc& __a)
- : c(std::move(__c), __a), comp(__comp) {
- c.insert(c.end(), __f, __l);
- std::make_heap(c.begin(), c.end(), comp);
-}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Container, class _Compare>
inline void priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v) {
c.push_back(__v);
std::push_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Container, class _Compare>
-inline void priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v) {
- c.push_back(std::move(__v));
- std::push_heap(c.begin(), c.end(), comp);
-}
-
-template <class _Tp, class _Container, class _Compare>
-template <class... _Args>
-inline void priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args) {
- c.emplace_back(std::forward<_Args>(__args)...);
- std::push_heap(c.begin(), c.end(), comp);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Container, class _Compare>
inline void priority_queue<_Tp, _Container, _Compare>::pop() {
std::pop_heap(c.begin(), c.end(), comp);
@@ -946,8 +596,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/functional>
# include <__cxx03/type_traits>
diff --git a/libcxx/include/__cxx03/random b/libcxx/include/__cxx03/random
index 71c59edecfec0..1eb766ca42ad0 100644
--- a/libcxx/include/__cxx03/random
+++ b/libcxx/include/__cxx03/random
@@ -1723,7 +1723,7 @@ class piecewise_linear_distribution
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/climits>
# include <__cxx03/cmath>
diff --git a/libcxx/include/__cxx03/ratio b/libcxx/include/__cxx03/ratio
index 57b5dcbf2ddce..1280a272d6db7 100644
--- a/libcxx/include/__cxx03/ratio
+++ b/libcxx/include/__cxx03/ratio
@@ -296,18 +296,9 @@ public:
__ll_mul<_R2::den / __gcd_n1_d2, _R1::den / __gcd_d1_n2>::value >::type type;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _R1, class _R2>
-using ratio_multiply = typename __ratio_multiply<_R1, _R2>::type;
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct _LIBCPP_TEMPLATE_VIS ratio_multiply : public __ratio_multiply<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct __ratio_divide {
private:
@@ -322,18 +313,9 @@ public:
__ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value >::type type;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _R1, class _R2>
-using ratio_divide = typename __ratio_divide<_R1, _R2>::type;
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct _LIBCPP_TEMPLATE_VIS ratio_divide : public __ratio_divide<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct __ratio_add {
private:
@@ -351,18 +333,9 @@ public:
_R2::den > >::type type;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _R1, class _R2>
-using ratio_add = typename __ratio_add<_R1, _R2>::type;
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct _LIBCPP_TEMPLATE_VIS ratio_add : public __ratio_add<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct __ratio_subtract {
private:
@@ -380,18 +353,9 @@ public:
_R2::den > >::type type;
};
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _R1, class _R2>
-using ratio_subtract = typename __ratio_subtract<_R1, _R2>::type;
-
-#else // _LIBCPP_CXX03_LANG
-
template <class _R1, class _R2>
struct _LIBCPP_TEMPLATE_VIS ratio_subtract : public __ratio_subtract<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
-
// ratio_equal
template <class _R1, class _R2>
@@ -486,31 +450,11 @@ struct __ratio_gcd {
typedef ratio<__static_gcd<_R1::num, _R2::num>::value, __static_lcm<_R1::den, _R2::den>::value> type;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _R1, class _R2>
-inline constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
-
-template <class _R1, class _R2>
-inline constexpr bool ratio_not_equal_v = ratio_not_equal<_R1, _R2>::value;
-
-template <class _R1, class _R2>
-inline constexpr bool ratio_less_v = ratio_less<_R1, _R2>::value;
-
-template <class _R1, class _R2>
-inline constexpr bool ratio_less_equal_v = ratio_less_equal<_R1, _R2>::value;
-
-template <class _R1, class _R2>
-inline constexpr bool ratio_greater_v = ratio_greater<_R1, _R2>::value;
-
-template <class _R1, class _R2>
-inline constexpr bool ratio_greater_equal_v = ratio_greater_equal<_R1, _R2>::value;
-#endif
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/regex b/libcxx/include/__cxx03/regex
index ea9512cd56953..f1a98818d941d 100644
--- a/libcxx/include/__cxx03/regex
+++ b/libcxx/include/__cxx03/regex
@@ -2335,21 +2335,12 @@ public:
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), __end_(nullptr) {
__init(__first, __last);
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI basic_regex(initializer_list<value_type> __il, flag_type __f = regex_constants::ECMAScript)
- : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), __end_(nullptr) {
- __init(__il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
// ~basic_regex() = default;
// basic_regex& operator=(const basic_regex&) = default;
// basic_regex& operator=(basic_regex&&) = default;
_LIBCPP_HIDE_FROM_ABI basic_regex& operator=(const value_type* __p) { return assign(__p); }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI basic_regex& operator=(initializer_list<value_type> __il) { return assign(__il); }
-#endif // _LIBCPP_CXX03_LANG
template <class _ST, class _SA>
_LIBCPP_HIDE_FROM_ABI basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p) {
return assign(__p);
@@ -2357,9 +2348,6 @@ public:
// assign:
_LIBCPP_HIDE_FROM_ABI basic_regex& assign(const basic_regex& __that) { return *this = __that; }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI basic_regex& assign(basic_regex&& __that) _NOEXCEPT { return *this = std::move(__that); }
-#endif
_LIBCPP_HIDE_FROM_ABI basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript) {
return assign(__p, __p + __traits_.length(__p), __f);
}
@@ -2396,15 +2384,6 @@ public:
return assign(basic_regex(__first, __last, __f));
}
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI basic_regex&
- assign(initializer_list<value_type> __il, flag_type __f = regex_constants::ECMAScript) {
- return assign(__il.begin(), __il.end(), __f);
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
// const operations:
_LIBCPP_HIDE_FROM_ABI unsigned mark_count() const { return __marked_count_; }
_LIBCPP_HIDE_FROM_ABI flag_type flags() const { return __flags_; }
@@ -2644,12 +2623,6 @@ private:
friend class __lookahead;
};
-#if _LIBCPP_STD_VER >= 17
-template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
-basic_regex(_ForwardIterator, _ForwardIterator, regex_constants::syntax_option_type = regex_constants::ECMAScript)
- -> basic_regex<typename iterator_traits<_ForwardIterator>::value_type>;
-#endif
-
template <class _CharT, class _Traits>
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase;
template <class _CharT, class _Traits>
@@ -4224,15 +4197,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const sub_match<_BiIter>& __x, cons
return __x.compare(__y) == 0;
}
-#if _LIBCPP_STD_VER >= 20
-template <class _BiIter>
-using __sub_match_cat = compare_three_way_result_t<basic_string<typename iterator_traits<_BiIter>::value_type>>;
-
-template <class _BiIter>
-_LIBCPP_HIDE_FROM_ABI auto operator<=>(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y) {
- return static_cast<__sub_match_cat<_BiIter>>(__x.compare(__y) <=> 0);
-}
-#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y) {
return !(__x == __y);
@@ -4299,7 +4263,6 @@ operator<=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST
const sub_match<_BiIter>& __y) {
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter, class _ST, class _SA>
inline _LIBCPP_HIDE_FROM_ABI bool
@@ -4308,15 +4271,6 @@ operator==(const sub_match<_BiIter>& __x,
return __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) == 0;
}
-#if _LIBCPP_STD_VER >= 20
-template <class _BiIter, class _ST, class _SA>
-_LIBCPP_HIDE_FROM_ABI auto
-operator<=>(const sub_match<_BiIter>& __x,
- const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y) {
- return static_cast<__sub_match_cat<_BiIter>>(
- __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) <=> 0);
-}
-#else // _LIBCPP_STD_VER >= 20
template <class _BiIter, class _ST, class _SA>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const sub_match<_BiIter>& __x,
@@ -4387,7 +4341,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool
operator<=(typename iterator_traits<_BiIter>::value_type const* __x, const sub_match<_BiIter>& __y) {
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI bool
@@ -4395,13 +4348,6 @@ operator==(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::val
return __x.compare(__y) == 0;
}
-#if _LIBCPP_STD_VER >= 20
-template <class _BiIter>
-_LIBCPP_HIDE_FROM_ABI auto
-operator<=>(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const* __y) {
- return static_cast<__sub_match_cat<_BiIter>>(__x.compare(__y) <=> 0);
-}
-#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const* __y) {
@@ -4469,7 +4415,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool
operator<=(typename iterator_traits<_BiIter>::value_type const& __x, const sub_match<_BiIter>& __y) {
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI bool
@@ -4478,14 +4423,6 @@ operator==(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::val
return __x.compare(string_type(1, __y)) == 0;
}
-#if _LIBCPP_STD_VER >= 20
-template <class _BiIter>
-_LIBCPP_HIDE_FROM_ABI auto
-operator<=>(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const& __y) {
- using string_type = basic_string<typename iterator_traits<_BiIter>::value_type>;
- return static_cast<__sub_match_cat<_BiIter>>(__x.compare(string_type(1, __y)) <=> 0);
-}
-#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const& __y) {
@@ -4516,7 +4453,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool
operator<=(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const& __y) {
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER >= 20
template <class _CharT, class _ST, class _BiIter>
inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _ST>&
@@ -4559,12 +4495,7 @@ public:
typedef basic_string<char_type> string_type;
// construct/copy/destroy:
-#ifndef _LIBCPP_CXX03_LANG
- match_results() : match_results(allocator_type()) {}
- explicit match_results(const allocator_type& __a);
-#else
explicit match_results(const allocator_type& __a = allocator_type());
-#endif
// match_results(const match_results&) = default;
// match_results& operator=(const match_results&) = default;
@@ -4814,13 +4745,11 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const match_results<_BidirectionalIterator
return __x.__matches_ == __y.__matches_ && __x.__prefix_ == __y.__prefix_ && __x.__suffix_ == __y.__suffix_;
}
-#if _LIBCPP_STD_VER < 20
template <class _BidirectionalIterator, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const match_results<_BidirectionalIterator, _Allocator>& __x,
const match_results<_BidirectionalIterator, _Allocator>& __y) {
return !(__x == __y);
}
-#endif
template <class _BidirectionalIterator, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void
@@ -5232,14 +5161,6 @@ regex_search(const basic_string<_CharT, _ST, _SA>& __s,
return __r;
}
-#if _LIBCPP_STD_VER >= 14
-template <class _ST, class _SA, class _Ap, class _Cp, class _Tp>
-bool regex_search(const basic_string<_Cp, _ST, _SA>&& __s,
- match_results<typename basic_string<_Cp, _ST, _SA>::const_iterator, _Ap>&,
- const basic_regex<_Cp, _Tp>& __e,
- regex_constants::match_flag_type __flags = regex_constants::match_default) = delete;
-#endif
-
// regex_match
template <class _BidirectionalIterator, class _Allocator, class _CharT, class _Traits>
@@ -5287,15 +5208,6 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
return std::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
}
-#if _LIBCPP_STD_VER >= 14
-template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_HIDE_FROM_ABI bool
-regex_match(const basic_string<_CharT, _ST, _SA>&& __s,
- match_results<typename basic_string<_CharT, _ST, _SA>::const_iterator, _Allocator>& __m,
- const basic_regex<_CharT, _Traits>& __e,
- regex_constants::match_flag_type __flags = regex_constants::match_default) = delete;
-#endif
-
template <class _CharT, class _Traits>
inline _LIBCPP_HIDE_FROM_ABI bool
regex_match(const _CharT* __str,
@@ -5337,9 +5249,6 @@ public:
typedef const value_type* pointer;
typedef const value_type& reference;
typedef forward_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER >= 20
- typedef input_iterator_tag iterator_concept;
-#endif
private:
_BidirectionalIterator __begin_;
@@ -5354,20 +5263,9 @@ public:
_BidirectionalIterator __b,
const regex_type& __re,
regex_constants::match_flag_type __m = regex_constants::match_default);
-#if _LIBCPP_STD_VER >= 14
- regex_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type&& __re,
- regex_constants::match_flag_type __m = regex_constants::match_default) = delete;
-#endif
_LIBCPP_HIDE_FROM_ABI bool operator==(const regex_iterator& __x) const;
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const { return *this == regex_iterator(); }
-#endif
-#if _LIBCPP_STD_VER < 20
_LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_iterator& __x) const { return !(*this == __x); }
-#endif
_LIBCPP_HIDE_FROM_ABI reference operator*() const { return __match_; }
_LIBCPP_HIDE_FROM_ABI pointer operator->() const { return std::addressof(__match_); }
@@ -5468,9 +5366,6 @@ public:
typedef const value_type* pointer;
typedef const value_type& reference;
typedef forward_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER >= 20
- typedef input_iterator_tag iterator_concept;
-#endif
private:
typedef regex_iterator<_BidirectionalIterator, _CharT, _Traits> _Position;
@@ -5488,67 +5383,25 @@ public:
const regex_type& __re,
int __submatch = 0,
regex_constants::match_flag_type __m = regex_constants::match_default);
-#if _LIBCPP_STD_VER >= 14
- regex_token_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type&& __re,
- int __submatch = 0,
- regex_constants::match_flag_type __m = regex_constants::match_default) = delete;
-#endif
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
const regex_type& __re,
const vector<int>& __submatches,
regex_constants::match_flag_type __m = regex_constants::match_default);
-#if _LIBCPP_STD_VER >= 14
- regex_token_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type&& __re,
- const vector<int>& __submatches,
- regex_constants::match_flag_type __m = regex_constants::match_default) = delete;
-#endif
-#ifndef _LIBCPP_CXX03_LANG
- regex_token_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type& __re,
- initializer_list<int> __submatches,
- regex_constants::match_flag_type __m = regex_constants::match_default);
-
-# if _LIBCPP_STD_VER >= 14
- regex_token_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type&& __re,
- initializer_list<int> __submatches,
- regex_constants::match_flag_type __m = regex_constants::match_default) = delete;
-# endif
-#endif // _LIBCPP_CXX03_LANG
template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
const regex_type& __re,
const int (&__submatches)[_Np],
regex_constants::match_flag_type __m = regex_constants::match_default);
-#if _LIBCPP_STD_VER >= 14
- template <size_t _Np>
- regex_token_iterator(_BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type&& __re,
- const int (&__submatches)[_Np],
- regex_constants::match_flag_type __m = regex_constants::match_default) = delete;
-#endif
regex_token_iterator(const regex_token_iterator&);
regex_token_iterator& operator=(const regex_token_iterator&);
_LIBCPP_HIDE_FROM_ABI bool operator==(const regex_token_iterator& __x) const;
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); }
-#endif
-#if _LIBCPP_STD_VER < 20
_LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_token_iterator& __x) const { return !(*this == __x); }
-#endif
_LIBCPP_HIDE_FROM_ABI const value_type& operator*() const { return *__result_; }
_LIBCPP_HIDE_FROM_ABI const value_type* operator->() const { return __result_; }
@@ -5610,21 +5463,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::regex_token_itera
__init(__a, __b);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _BidirectionalIterator, class _CharT, class _Traits>
-regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::regex_token_iterator(
- _BidirectionalIterator __a,
- _BidirectionalIterator __b,
- const regex_type& __re,
- initializer_list<int> __submatches,
- regex_constants::match_flag_type __m)
- : __position_(__a, __b, __re, __m), __n_(0), __subs_(__submatches) {
- __init(__a, __b);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _BidirectionalIterator, class _CharT, class _Traits>
template <size_t _Np>
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::regex_token_iterator(
@@ -5798,27 +5636,9 @@ regex_replace(const _CharT* __s,
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _BidirT>
-using match_results _LIBCPP_AVAILABILITY_PMR =
- std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
-
-using cmatch _LIBCPP_AVAILABILITY_PMR = match_results<const char*>;
-using smatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::string::const_iterator>;
-
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wcmatch _LIBCPP_AVAILABILITY_PMR = match_results<const wchar_t*>;
-using wsmatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::wstring::const_iterator>;
-# endif
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/atomic>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/set b/libcxx/include/__cxx03/set
index 2b14ef8b39a9f..46e8b52b66760 100644
--- a/libcxx/include/__cxx03/set
+++ b/libcxx/include/__cxx03/set
@@ -592,11 +592,6 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
- typedef __insert_return_type<iterator, node_type> insert_return_type;
-#endif
-
template <class _Key2, class _Compare2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS set;
template <class _Key2, class _Compare2, class _Alloc2>
@@ -625,30 +620,6 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- set(from_range_t,
- _Range&& __range,
- const key_compare& __comp = key_compare(),
- const allocator_type& __a = allocator_type())
- : __tree_(__comp, __a) {
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
- : set(__f, __l, key_compare(), __a) {}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI set(from_range_t, _Range&& __range, const allocator_type& __a)
- : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI set(const set& __s) : __tree_(__s.__tree_) { insert(__s.begin(), __s.end()); }
_LIBCPP_HIDE_FROM_ABI set& operator=(const set& __s) {
@@ -656,46 +627,12 @@ public:
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI set(set&& __s) noexcept(is_nothrow_move_constructible<__base>::value)
- : __tree_(std::move(__s.__tree_)) {}
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit set(const allocator_type& __a) : __tree_(__a) {}
_LIBCPP_HIDE_FROM_ABI set(const set& __s, const allocator_type& __a) : __tree_(__s.__tree_.value_comp(), __a) {
insert(__s.begin(), __s.end());
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
- : __tree_(__comp) {
- insert(__il.begin(), __il.end());
- }
-
- _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)
- : __tree_(__comp, __a) {
- insert(__il.begin(), __il.end());
- }
-
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const allocator_type& __a)
- : set(__il, key_compare(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI set& operator=(initializer_list<value_type> __il) {
- __tree_.__assign_unique(__il.begin(), __il.end());
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) noexcept(is_nothrow_move_assignable<__base>::value) {
- __tree_ = std::move(__s.__tree_);
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
@@ -718,17 +655,6 @@ public:
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
// modifiers:
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
- return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
- }
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...);
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__insert_unique(__v); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
return __tree_.__insert_unique(__p, __v);
@@ -740,76 +666,11 @@ public:
__tree_.__insert_unique(__e, *__f);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- const_iterator __end = cend();
- for (auto&& __element : __range) {
- __tree_.__insert_unique(__end, std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {
- return __tree_.__insert_unique(std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
- return __tree_.__insert_unique(__p, std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to set::insert()");
- return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to set::insert()");
- return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __tree_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __tree_.template __node_handle_extract<node_type>(__it);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_unique(__source.__tree_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); }
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }
@@ -819,59 +680,14 @@ public:
// set operations:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __tree_.find(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __tree_.find(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __tree_.__count_multi(__k);
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
- return __tree_.lower_bound(__k);
- }
-
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
- return __tree_.lower_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
- return __tree_.upper_bound(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
- return __tree_.upper_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __tree_.__equal_range_unique(__k);
@@ -879,85 +695,14 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __tree_.__equal_range_unique(__k);
}
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __tree_.__equal_range_multi(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __tree_.__equal_range_multi(__k);
- }
-#endif
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Compare = less<__iter_value_type<_InputIterator>>,
- class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Compare = less<ranges::range_value_t<_Range>>,
- class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
- -> set<ranges::range_value_t<_Range>, _Compare, _Allocator>;
-# endif
-
-template <class _Key,
- class _Compare = less<_Key>,
- class _Allocator = allocator<_Key>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> set<_Key, _Compare, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(_InputIterator,
- _InputIterator,
- _Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(from_range_t,
- _Range&&,
- _Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
-# endif
-
-template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(initializer_list<_Key>, _Allocator) -> set<_Key, less<_Key>, _Allocator>;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Compare, class _Allocator>
-set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a) : __tree_(std::move(__s.__tree_), __a) {
- if (__a != __s.get_allocator()) {
- const_iterator __e = cend();
- while (!__s.empty())
- insert(__e, std::move(__s.__tree_.remove(__s.begin())->__value_));
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator==(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator<(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
@@ -988,16 +733,6 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,
return !(__y < __x);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Key, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
-operator<=>(const set<_Key, _Allocator>& __x, const set<_Key, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
// specialized algorithms:
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void swap(set<_Key, _Compare, _Allocator>& __x, set<_Key, _Compare, _Allocator>& __y)
@@ -1005,14 +740,6 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(set<_Key, _Compare, _Allocator>& __x, set
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename set<_Key, _Compare, _Allocator>::size_type
-erase_if(set<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Key, class _Compare = less<_Key>, class _Allocator = allocator<_Key> >
class _LIBCPP_TEMPLATE_VIS multiset {
public:
@@ -1046,10 +773,6 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
-#endif
-
template <class _Key2, class _Compare2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS set;
template <class _Key2, class _Compare2, class _Alloc2>
@@ -1073,12 +796,6 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
- : multiset(__f, __l, key_compare(), __a) {}
-#endif
-
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI
multiset(_InputIterator __f, _InputIterator __l, const value_compare& __comp, const allocator_type& __a)
@@ -1086,22 +803,6 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- multiset(from_range_t,
- _Range&& __range,
- const key_compare& __comp = key_compare(),
- const allocator_type& __a = allocator_type())
- : __tree_(__comp, __a) {
- insert_range(std::forward<_Range>(__range));
- }
-
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI multiset(from_range_t, _Range&& __range, const allocator_type& __a)
- : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s)
: __tree_(__s.__tree_.value_comp(),
__alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc())) {
@@ -1113,46 +814,12 @@ public:
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) noexcept(is_nothrow_move_constructible<__base>::value)
- : __tree_(std::move(__s.__tree_)) {}
-
- _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit multiset(const allocator_type& __a) : __tree_(__a) {}
_LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s, const allocator_type& __a)
: __tree_(__s.__tree_.value_comp(), __a) {
insert(__s.begin(), __s.end());
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
- : __tree_(__comp) {
- insert(__il.begin(), __il.end());
- }
-
- _LIBCPP_HIDE_FROM_ABI
- multiset(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)
- : __tree_(__comp, __a) {
- insert(__il.begin(), __il.end());
- }
-
-# if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const allocator_type& __a)
- : multiset(__il, key_compare(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI multiset& operator=(initializer_list<value_type> __il) {
- __tree_.__assign_multi(__il.begin(), __il.end());
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) {
- __tree_ = std::move(__s.__tree_);
- return *this;
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI ~multiset() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
@@ -1175,17 +842,6 @@ public:
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
// modifiers:
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
- return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
- }
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __tree_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
return __tree_.__insert_multi(__p, __v);
@@ -1197,74 +853,11 @@ public:
__tree_.__insert_multi(__e, *__f);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- const_iterator __end = cend();
- for (auto&& __element : __range) {
- __tree_.__insert_multi(__end, std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
- return __tree_.__insert_multi(__p, std::move(__v));
- }
-
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to multiset::insert()");
- return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to multiset::insert()");
- return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __tree_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __tree_.template __node_handle_extract<node_type>(__it);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_multi(__source.__tree_);
- }
- template <class _Compare2>
- _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __tree_.__node_handle_merge_multi(__source.__tree_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
__tree_.swap(__s.__tree_);
}
@@ -1276,59 +869,14 @@ public:
// set operations:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __tree_.find(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __tree_.find(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __tree_.__count_multi(__k);
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
- return __tree_.lower_bound(__k);
- }
-
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
- return __tree_.lower_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
- return __tree_.upper_bound(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
- return __tree_.upper_bound(__k);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __tree_.__equal_range_multi(__k);
@@ -1336,87 +884,14 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __tree_.__equal_range_multi(__k);
}
-#if _LIBCPP_STD_VER >= 14
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __tree_.__equal_range_multi(__k);
- }
- template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __tree_.__equal_range_multi(__k);
- }
-#endif
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Compare = less<__iter_value_type<_InputIterator>>,
- class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Compare = less<ranges::range_value_t<_Range>>,
- class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
- -> multiset<ranges::range_value_t<_Range>, _Compare, _Allocator>;
-# endif
-
-template <class _Key,
- class _Compare = less<_Key>,
- class _Allocator = allocator<_Key>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-multiset(initializer_list<_Key>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multiset(_InputIterator, _InputIterator, _Allocator)
- -> multiset<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multiset(from_range_t,
- _Range&&,
- _Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
-# endif
-
-template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Compare, class _Allocator>
-multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
- : __tree_(std::move(__s.__tree_), __a) {
- if (__a != __s.get_allocator()) {
- const_iterator __e = cend();
- while (!__s.empty())
- insert(__e, std::move(__s.__tree_.remove(__s.begin())->__value_));
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator==(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator<(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
@@ -1447,16 +922,6 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,
return !(__y < __x);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Key, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
-operator<=>(const multiset<_Key, _Allocator>& __x, const multiset<_Key, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void
swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Allocator>& __y)
@@ -1464,32 +929,11 @@ swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Alloca
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename multiset<_Key, _Compare, _Allocator>::size_type
-erase_if(multiset<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using set _LIBCPP_AVAILABILITY_PMR = std::set<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
-
-template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using multiset _LIBCPP_AVAILABILITY_PMR = std::multiset<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/functional>
# include <__cxx03/iterator>
diff --git a/libcxx/include/__cxx03/sstream b/libcxx/include/__cxx03/sstream
index 744c6365cebf0..de56cd99553e2 100644
--- a/libcxx/include/__cxx03/sstream
+++ b/libcxx/include/__cxx03/sstream
@@ -364,149 +364,23 @@ public:
str(__s);
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const allocator_type& __a)
- : basic_stringbuf(ios_base::in | ios_base::out, __a) {}
-
- _LIBCPP_HIDE_FROM_ABI basic_stringbuf(ios_base::openmode __wch, const allocator_type& __a)
- : __str_(__a), __hm_(nullptr), __mode_(__wch) {}
-
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(string_type&& __s,
- ios_base::openmode __wch = ios_base::in | ios_base::out)
- : __str_(std::move(__s)), __hm_(nullptr), __mode_(__wch) {
- __init_buf_ptrs();
- }
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI
- basic_stringbuf(const basic_string<char_type, traits_type, _SAlloc>& __s, const allocator_type& __a)
- : basic_stringbuf(__s, ios_base::in | ios_base::out, __a) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_stringbuf(
- const basic_string<char_type, traits_type, _SAlloc>& __s, ios_base::openmode __wch, const allocator_type& __a)
- : __str_(__s, __a), __hm_(nullptr), __mode_(__wch) {
- __init_buf_ptrs();
- }
-
- template <class _SAlloc>
- requires(!is_same_v<_SAlloc, allocator_type>)
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const basic_string<char_type, traits_type, _SAlloc>& __s,
- ios_base::openmode __wch = ios_base::in | ios_base::out)
- : __str_(__s), __hm_(nullptr), __mode_(__wch) {
- __init_buf_ptrs();
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const _Tp& __t,
- ios_base::openmode __which = ios_base::in | ios_base::out)
- : basic_stringbuf(__t, __which, _Allocator()) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_stringbuf(const _Tp& __t, const _Allocator& __a)
- : basic_stringbuf(__t, ios_base::in | ios_base::out, __a) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_stringbuf(const _Tp& __t, ios_base::openmode __which, const _Allocator& __a)
- : __hm_(nullptr), __mode_(__which) {
- basic_string_view<_CharT, _Traits> __sv = __t;
- __str_ = string_type(__sv, __a);
- __init_buf_ptrs();
- }
-
-#endif // _LIBCPP_STD_VER >= 26
-
basic_stringbuf(const basic_stringbuf&) = delete;
basic_stringbuf(basic_stringbuf&& __rhs) : __mode_(__rhs.__mode_) { __move_init(std::move(__rhs)); }
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI basic_stringbuf(basic_stringbuf&& __rhs, const allocator_type& __a)
- : basic_stringbuf(__rhs.__mode_, __a) {
- __move_init(std::move(__rhs));
- }
-#endif
-
// [stringbuf.assign] Assign and swap:
basic_stringbuf& operator=(const basic_stringbuf&) = delete;
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
- void swap(basic_stringbuf& __rhs)
-#if _LIBCPP_STD_VER >= 20
- noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value ||
- allocator_traits<allocator_type>::is_always_equal::value)
-#endif
- ;
+ void swap(basic_stringbuf& __rhs);
// [stringbuf.members] Member functions:
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }
-#endif
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
string_type str() const;
-#else
- _LIBCPP_HIDE_FROM_ABI string_type str() const& { return str(__str_.get_allocator()); }
-
- _LIBCPP_HIDE_FROM_ABI string_type str() && {
- const basic_string_view<_CharT, _Traits> __view = view();
- typename string_type::size_type __pos = __view.empty() ? 0 : __view.data() - __str_.data();
- // In C++23, this is just string_type(std::move(__str_), __pos, __view.size(), __str_.get_allocator());
- // But we need something that works in C++20 also.
- string_type __result(std::move(__str_), __str_.get_allocator());
- __result.resize(__pos + __view.size());
- __result.erase(0, __pos);
- __init_buf_ptrs();
- return __result;
- }
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
- _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
- return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);
- }
-
- _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept;
-#endif // _LIBCPP_STD_VER >= 20
void str(const string_type& __s) {
__str_ = __s;
__init_buf_ptrs();
}
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- requires(!is_same_v<_SAlloc, allocator_type>)
- _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
- __str_ = __s;
- __init_buf_ptrs();
- }
-
- _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) {
- __str_ = std::move(__s);
- __init_buf_ptrs();
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI void str(const _Tp& __t) {
- basic_string_view<_CharT, _Traits> __sv = __t;
- __str_ = __sv;
- __init_buf_ptrs();
- }
-
-#endif // _LIBCPP_STD_VER >= 26
-
protected:
// [stringbuf.virtuals] Overridden virtual functions:
int_type underflow() override;
@@ -600,12 +474,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
}
template <class _CharT, class _Traits, class _Allocator>
-void basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
-#if _LIBCPP_STD_VER >= 20
- noexcept(allocator_traits<_Allocator>::propagate_on_container_swap::value ||
- allocator_traits<_Allocator>::is_always_equal::value)
-#endif
-{
+void basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs) {
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
ptrdiff_t __rbinp = -1;
ptrdiff_t __rninp = -1;
@@ -673,15 +542,10 @@ void basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI void
-swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x, basic_stringbuf<_CharT, _Traits, _Allocator>& __y)
-#if _LIBCPP_STD_VER >= 20
- noexcept(noexcept(__x.swap(__y)))
-#endif
-{
+swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x, basic_stringbuf<_CharT, _Traits, _Allocator>& __y) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator> basic_stringbuf<_CharT, _Traits, _Allocator>::str() const {
if (__mode_ & ios_base::out) {
@@ -692,7 +556,6 @@ basic_string<_CharT, _Traits, _Allocator> basic_stringbuf<_CharT, _Traits, _Allo
return string_type(this->eback(), this->egptr(), __str_.get_allocator());
return string_type(__str_.get_allocator());
}
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI void basic_stringbuf<_CharT, _Traits, _Allocator>::__init_buf_ptrs() {
@@ -718,20 +581,6 @@ _LIBCPP_HIDE_FROM_ABI void basic_stringbuf<_CharT, _Traits, _Allocator>::__init_
}
}
-#if _LIBCPP_STD_VER >= 20
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI basic_string_view<_CharT, _Traits>
-basic_stringbuf<_CharT, _Traits, _Allocator>::view() const noexcept {
- if (__mode_ & ios_base::out) {
- if (__hm_ < this->pptr())
- __hm_ = this->pptr();
- return basic_string_view<_CharT, _Traits>(this->pbase(), __hm_);
- } else if (__mode_ & ios_base::in)
- return basic_string_view<_CharT, _Traits>(this->eback(), this->egptr());
- return basic_string_view<_CharT, _Traits>();
-}
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _CharT, class _Traits, class _Allocator>
typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type
basic_stringbuf<_CharT, _Traits, _Allocator>::underflow() {
@@ -872,47 +721,6 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(const string_type& __s, ios_base::openmode __wch = ios_base::in)
: basic_istream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch | ios_base::in) {}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI basic_istringstream(ios_base::openmode __wch, const _Allocator& __a)
- : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch | ios_base::in, __a) {}
-
- _LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(string_type&& __s, ios_base::openmode __wch = ios_base::in)
- : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch | ios_base::in) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_istringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
- : basic_istringstream(__s, ios_base::in, __a) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_istringstream(
- const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
- : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::in, __a) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
- ios_base::openmode __wch = ios_base::in)
- : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::in) {}
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(const _Tp& __t, ios_base::openmode __which = ios_base::in)
- : basic_istringstream(__t, __which, _Allocator()) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_istringstream(const _Tp& __t, const _Allocator& __a)
- : basic_istringstream(__t, ios_base::in, __a) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_istringstream(const _Tp& __t, ios_base::openmode __which, const _Allocator& __a)
- : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__t, __which | ios_base::in, __a) {}
-
-#endif // _LIBCPP_STD_VER >= 26
-
basic_istringstream(const basic_istringstream&) = delete;
_LIBCPP_HIDE_FROM_ABI basic_istringstream(basic_istringstream&& __rhs)
: basic_istream<_CharT, _Traits>(std::move(__rhs)), __sb_(std::move(__rhs.__sb_)) {
@@ -936,42 +744,9 @@ public:
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
-#else
- _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
-
- _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
- _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
- return __sb_.str(__sa);
- }
-
- _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
- __sb_.str(__s);
- }
-
- _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI void str(const _Tp& __t) {
- rdbuf()->str(__t);
- }
-#endif // _LIBCPP_STD_VER >= 26
};
template <class _CharT, class _Traits, class _Allocator>
@@ -1007,48 +782,6 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(const string_type& __s, ios_base::openmode __wch = ios_base::out)
: basic_ostream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch | ios_base::out) {}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI basic_ostringstream(ios_base::openmode __wch, const _Allocator& __a)
- : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch | ios_base::out, __a) {}
-
- _LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(string_type&& __s, ios_base::openmode __wch = ios_base::out)
- : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch | ios_base::out) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_ostringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
- : basic_ostringstream(__s, ios_base::out, __a) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_ostringstream(
- const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
- : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::out, __a) {}
-
- template <class _SAlloc>
- requires(!is_same_v<_SAlloc, allocator_type>)
- _LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
- ios_base::openmode __wch = ios_base::out)
- : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::out) {}
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(const _Tp& __t, ios_base::openmode __which = ios_base::out)
- : basic_ostringstream(__t, __which | ios_base::out, _Allocator()) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_ostringstream(const _Tp& __t, const _Allocator& __a)
- : basic_ostringstream(__t, ios_base::out, __a) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_ostringstream(const _Tp& __t, ios_base::openmode __which, const _Allocator& __a)
- : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__t, __which | ios_base::out, __a) {}
-
-#endif // _LIBCPP_STD_VER >= 26
-
basic_ostringstream(const basic_ostringstream&) = delete;
_LIBCPP_HIDE_FROM_ABI basic_ostringstream(basic_ostringstream&& __rhs)
: basic_ostream<_CharT, _Traits>(std::move(__rhs)), __sb_(std::move(__rhs.__sb_)) {
@@ -1073,42 +806,8 @@ public:
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
-#else
- _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
-
- _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
- _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
- return __sb_.str(__sa);
- }
-
- _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
- __sb_.str(__s);
- }
-
- _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI void str(const _Tp& __t) {
- rdbuf()->str(__t);
- }
-#endif // _LIBCPP_STD_VER >= 26
};
template <class _CharT, class _Traits, class _Allocator>
@@ -1146,50 +845,6 @@ public:
ios_base::openmode __wch = ios_base::in | ios_base::out)
: basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch) {}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI basic_stringstream(ios_base::openmode __wch, const _Allocator& __a)
- : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch, __a) {}
-
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringstream(string_type&& __s,
- ios_base::openmode __wch = ios_base::out | ios_base::in)
- : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI basic_stringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
- : basic_stringstream(__s, ios_base::out | ios_base::in, __a) {}
-
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI
- basic_stringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
- : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch, __a) {}
-
- template <class _SAlloc>
- requires(!is_same_v<_SAlloc, allocator_type>)
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
- ios_base::openmode __wch = ios_base::out | ios_base::in)
- : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch) {}
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI explicit basic_stringstream(const _Tp& __t,
- ios_base::openmode __which = ios_base::out | ios_base::in)
- : basic_stringstream(__t, __which, _Allocator()) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_stringstream(const _Tp& __t, const _Allocator& __a)
- : basic_stringstream(__t, ios_base::out | ios_base::in, __a) {}
-
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI basic_stringstream(const _Tp& __t, ios_base::openmode __which, const _Allocator& __a)
- : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__t, __which, __a) {}
-
-#endif // _LIBCPP_STD_VER >= 26
-
basic_stringstream(const basic_stringstream&) = delete;
_LIBCPP_HIDE_FROM_ABI basic_stringstream(basic_stringstream&& __rhs)
: basic_iostream<_CharT, _Traits>(std::move(__rhs)), __sb_(std::move(__rhs.__sb_)) {
@@ -1213,42 +868,9 @@ public:
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
-#else
- _LIBCPP_HIDE_FROM_ABI string_type str() const& { return __sb_.str(); }
-
- _LIBCPP_HIDE_FROM_ABI string_type str() && { return std::move(__sb_).str(); }
-#endif
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
- _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
- return __sb_.str(__sa);
- }
-
- _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
-
-#if _LIBCPP_STD_VER >= 20
- template <class _SAlloc>
- _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
- __sb_.str(__s);
- }
-
- _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 26
- template <class _Tp>
- requires is_convertible_v<const _Tp&, basic_string_view<_CharT, _Traits>>
- _LIBCPP_HIDE_FROM_ABI void str(const _Tp& __t) {
- rdbuf()->str(__t);
- }
-#endif // _LIBCPP_STD_VER >= 26
};
template <class _CharT, class _Traits, class _Allocator>
@@ -1268,7 +890,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if _LIBCPP_STD_VER <= 20 && !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/ostream>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/stack b/libcxx/include/__cxx03/stack
index e4988362b8010..809931e9d39ea 100644
--- a/libcxx/include/__cxx03/stack
+++ b/libcxx/include/__cxx03/stack
@@ -172,18 +172,6 @@ public:
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI stack(stack&& __q) noexcept(is_nothrow_move_constructible<container_type>::value)
- : c(std::move(__q.c)) {}
-
- _LIBCPP_HIDE_FROM_ABI stack& operator=(stack&& __q) noexcept(is_nothrow_move_assignable<container_type>::value) {
- c = std::move(__q.c);
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI explicit stack(container_type&& __c) : c(std::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI explicit stack(const container_type& __c) : c(__c) {}
template <class _Alloc>
@@ -198,38 +186,6 @@ public:
_LIBCPP_HIDE_FROM_ABI
stack(const stack& __s, const _Alloc& __a, __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__s.c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Alloc>
- _LIBCPP_HIDE_FROM_ABI
- stack(container_type&& __c, const _Alloc& __a, __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
- : c(std::move(__c), __a) {}
- template <class _Alloc>
- _LIBCPP_HIDE_FROM_ABI
- stack(stack&& __s, const _Alloc& __a, __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
- : c(std::move(__s.c), __a) {}
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER >= 23
- template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI stack(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
-
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI stack(from_range_t, _Range&& __range) : c(from_range, std::forward<_Range>(__range)) {}
-
- template <class _InputIterator,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc)
- : c(__first, __last, __alloc) {}
-
- template <_ContainerCompatibleRange<_Tp> _Range,
- class _Alloc,
- __enable_if_t<uses_allocator<container_type, _Alloc>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI stack(from_range_t, _Range&& __range, const _Alloc& __alloc)
- : c(from_range, std::forward<_Range>(__range), __alloc) {}
-
-#endif
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
_LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
@@ -237,34 +193,6 @@ public:
_LIBCPP_HIDE_FROM_ABI const_reference top() const { return c.back(); }
_LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void push(value_type&& __v) { c.push_back(std::move(__v)); }
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void push_range(_Range&& __range) {
- if constexpr (requires(container_type& __c) { __c.append_range(std::forward<_Range>(__range)); }) {
- c.append_range(std::forward<_Range>(__range));
- } else {
- ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
- }
- }
-# endif
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI
-# if _LIBCPP_STD_VER >= 17
- decltype(auto)
- emplace(_Args&&... __args) {
- return c.emplace_back(std::forward<_Args>(__args)...);
- }
-# else
- void
- emplace(_Args&&... __args) {
- c.emplace_back(std::forward<_Args>(__args)...);
- }
-# endif
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void pop() { c.pop_back(); }
@@ -282,39 +210,6 @@ public:
friend bool operator<(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >
-stack(_Container) -> stack<typename _Container::value_type, _Container>;
-
-template <class _Container,
- class _Alloc,
- class = enable_if_t<!__is_allocator<_Container>::value>,
- class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
-stack(_Container, _Alloc) -> stack<typename _Container::value_type, _Container>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
-stack(_InputIterator, _InputIterator) -> stack<__iter_value_type<_InputIterator>>;
-
-template <ranges::input_range _Range>
-stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;
-
-template <class _InputIterator,
- class _Alloc,
- __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-stack(_InputIterator,
- _InputIterator,
- _Alloc) -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
-
-template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-stack(from_range_t,
- _Range&&,
- _Alloc) -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
-
-#endif
-
template <class _Tp, class _Container>
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) {
return __x.c == __y.c;
@@ -345,17 +240,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const stack<_Tp, _Container>& __x,
return !(__y < __x);
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp, three_way_comparable _Container>
-_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
-operator<=>(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) {
- // clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
- return __x.__get_container() <=> __y.__get_container();
-}
-
-#endif
-
template <class _Tp, class _Container, __enable_if_t<__is_swappable_v<_Container>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI void swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
@@ -370,8 +254,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/functional>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/stdatomic.h b/libcxx/include/__cxx03/stdatomic.h
index 44e693aefb4ab..78bb745303c1a 100644
--- a/libcxx/include/__cxx03/stdatomic.h
+++ b/libcxx/include/__cxx03/stdatomic.h
@@ -121,7 +121,7 @@ using std::atomic_signal_fence // see below
# pragma GCC system_header
#endif
-#if defined(__cplusplus) && _LIBCPP_STD_VER >= 23
+#if defined(__cplusplus) && false
# include <__cxx03/atomic>
# include <__cxx03/version>
@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
# include_next <stdatomic.h>
# endif
-#endif // defined(__cplusplus) && _LIBCPP_STD_VER >= 23
+#endif // defined(__cplusplus) && false
#endif // _LIBCPP___CXX03_STDATOMIC_H
diff --git a/libcxx/include/__cxx03/stdexcept b/libcxx/include/__cxx03/stdexcept
index 772f8b543b172..1831196d1101d 100644
--- a/libcxx/include/__cxx03/stdexcept
+++ b/libcxx/include/__cxx03/stdexcept
@@ -277,7 +277,7 @@ _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void __throw_underflow_error(const
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/exception>
# include <__cxx03/iosfwd>
diff --git a/libcxx/include/__cxx03/streambuf b/libcxx/include/__cxx03/streambuf
index 8920fce1f78cc..6fcbcd0dfcfcd 100644
--- a/libcxx/include/__cxx03/streambuf
+++ b/libcxx/include/__cxx03/streambuf
@@ -438,7 +438,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdint>
#endif
diff --git a/libcxx/include/__cxx03/string b/libcxx/include/__cxx03/string
index c4431dcb04d41..0cdaddad3cc09 100644
--- a/libcxx/include/__cxx03/string
+++ b/libcxx/include/__cxx03/string
@@ -706,28 +706,6 @@ template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
-#if _LIBCPP_STD_VER >= 26
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
- type_identity_t<basic_string_view<_CharT, _Traits>> __rhs);
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, type_identity_t<basic_string_view<_CharT, _Traits>> __rhs);
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(type_identity_t<basic_string_view<_CharT, _Traits>> __lhs,
- const basic_string<_CharT, _Traits, _Allocator>& __rhs);
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(type_identity_t<basic_string_view<_CharT, _Traits>> __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs);
-
-#endif
-
extern template _LIBCPP_EXPORTED_FROM_ABI string operator+
<char, char_traits<char>, allocator<char> >(char const*, string const&);
@@ -987,11 +965,7 @@ public:
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
-#else
- _NOEXCEPT
-#endif
: __r_(__value_init_tag(), __a) {
__annotate_new(0);
}
@@ -1015,45 +989,6 @@ public:
__init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
-# if _LIBCPP_STD_VER <= 14
- _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-# else
- _NOEXCEPT
-# endif
- // Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS
- // does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
- // __str's memory needs to be unpoisoned only in the case where it's a short string.
- : __r_([](basic_string& __s) -> decltype(__s.__r_)&& {
- if (!__s.__is_long())
- __s.__annotate_delete();
- return std::move(__s.__r_);
- }(__str)) {
- __str.__r_.first() = __rep();
- __str.__annotate_new(0);
- if (!__is_long())
- __annotate_new(size());
- }
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str, const allocator_type& __a)
- : __r_(__default_init_tag(), __a) {
- if (__str.__is_long() && __a != __str.__alloc()) // copy, not move
- __init(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
- else {
- if (__libcpp_is_constant_evaluated())
- __r_.first() = __rep();
- if (!__str.__is_long())
- __str.__annotate_delete();
- __r_.first() = __str.__r_.first();
- __str.__r_.first() = __rep();
- __str.__annotate_new(0);
- if (!__is_long() && this != &__str)
- __annotate_new(size());
- }
- }
-#endif // _LIBCPP_CXX03_LANG
-
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
: __r_(__default_init_tag(), __default_init_tag()) {
@@ -1068,10 +1003,6 @@ public:
__init(__s, traits_type::length(__s));
}
-#if _LIBCPP_STD_VER >= 23
- basic_string(nullptr_t) = delete;
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)
: __r_(__default_init_tag(), __default_init_tag()) {
_LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
@@ -1090,27 +1021,6 @@ public:
__init(__n, __c);
}
-#if _LIBCPP_STD_VER >= 23
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string(
- basic_string&& __str, size_type __pos, const _Allocator& __alloc = _Allocator())
- : basic_string(std::move(__str), __pos, npos, __alloc) {}
-
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string(
- basic_string&& __str, size_type __pos, size_type __n, const _Allocator& __alloc = _Allocator())
- : __r_(__default_init_tag(), __alloc) {
- if (__pos > __str.size())
- __throw_out_of_range();
-
- auto __len = std::min<size_type>(__n, __str.size() - __pos);
- if (__alloc_traits::is_always_equal::value || __alloc == __str.__alloc()) {
- __move_assign(std::move(__str), __pos, __len);
- } else {
- // Perform a copy because the allocators are not compatible.
- __init(__str.data() + __pos, __len);
- }
- }
-#endif
-
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
: __r_(__default_init_tag(), __a) {
@@ -1181,31 +1091,6 @@ public:
__init(__first, __last);
}
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_CharT> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string(
- from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
- : __r_(__default_init_tag(), __a) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- __init_with_size(ranges::begin(__range), ranges::end(__range), ranges::distance(__range));
- } else {
- __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il)
- : __r_(__default_init_tag(), __default_init_tag()) {
- __init(__il.begin(), __il.end());
- }
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il, const _Allocator& __a)
- : __r_(__default_init_tag(), __a) {
- __init(__il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
-
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {
__annotate_delete();
if (__is_long())
@@ -1228,23 +1113,9 @@ public:
return assign(__sv);
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
- operator=(basic_string&& __str) noexcept(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) {
- __move_assign(__str, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(initializer_list<value_type> __il) {
- return assign(__il.begin(), __il.size());
- }
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const value_type* __s) {
return assign(__s);
}
-#if _LIBCPP_STD_VER >= 23
- basic_string& operator=(nullptr_t) = delete;
-#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {
@@ -1304,19 +1175,9 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __requested_capacity);
-#if _LIBCPP_STD_VER >= 23
- template <class _Op>
- _LIBCPP_HIDE_FROM_ABI constexpr void resize_and_overwrite(size_type __n, _Op __op) {
- __resize_default_init(__n);
- __erase_to_end(std::move(__op)(data(), _LIBCPP_AUTO_CAST(__n)));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __resize_default_init(size_type __n);
-#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRING_RESERVE)
_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve() _NOEXCEPT { shrink_to_fit(); }
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT;
@@ -1366,12 +1227,6 @@ public:
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(initializer_list<value_type> __il) {
- return append(__il);
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str) {
return append(__str.data(), __str.size());
}
@@ -1415,20 +1270,6 @@ public:
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(_ForwardIterator __first, _ForwardIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_CharT> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string& append_range(_Range&& __range) {
- insert_range(end(), std::forward<_Range>(__range));
- return *this;
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(initializer_list<value_type> __il) {
- return append(__il.begin(), __il.size());
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(value_type __c);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();
@@ -1459,39 +1300,10 @@ public:
return assign(__sv.data(), __sv.size());
}
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI constexpr void __move_assign(basic_string&& __str, size_type __pos, size_type __len) {
- // Pilfer the allocation from __str.
- _LIBCPP_ASSERT_INTERNAL(__alloc() == __str.__alloc(), "__move_assign called with wrong allocator");
- size_type __old_sz = __str.size();
- if (!__str.__is_long())
- __str.__annotate_delete();
- __r_.first() = __str.__r_.first();
- __str.__r_.first() = __rep();
- __str.__annotate_new(0);
-
- _Traits::move(data(), data() + __pos, __len);
- __set_size(__len);
- _Traits::assign(data()[__len], value_type());
-
- if (!__is_long()) {
- __annotate_new(__len);
- } else if (__old_sz > __len) {
- __annotate_shrink(__old_sz);
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str) {
return *this = __str;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
- assign(basic_string&& __str) noexcept(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) {
- *this = std::move(__str);
- return *this;
- }
-#endif
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n = npos);
template <class _Tp,
@@ -1512,28 +1324,6 @@ public:
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
assign(_ForwardIterator __first, _ForwardIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_CharT> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string& assign_range(_Range&& __range) {
- if constexpr (__string_is_trivial_iterator<ranges::iterator_t<_Range>>::value &&
- (ranges::forward_range<_Range> || ranges::sized_range<_Range>)) {
- size_type __n = static_cast<size_type>(ranges::distance(__range));
- __assign_trivial(ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
-
- return *this;
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(initializer_list<value_type> __il) {
- return assign(__il.begin(), __il.size());
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
insert(size_type __pos1, const basic_string& __str) {
return insert(__pos1, __str.data(), __str.size());
@@ -1560,20 +1350,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
_LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_CharT> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- basic_string __temp(from_range, std::forward<_Range>(__range), __alloc());
- return insert(__position, __temp.data(), __temp.data() + __temp.size());
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
insert(const_iterator __pos, size_type __n, value_type __c) {
difference_type __p = __pos - begin();
@@ -1589,13 +1365,6 @@ public:
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
- insert(const_iterator __pos, initializer_list<value_type> __il) {
- return insert(__pos, __il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& erase(size_type __pos = 0, size_type __n = npos);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __pos);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last);
@@ -1659,55 +1428,20 @@ public:
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_CharT> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string&
- replace_with_range(const_iterator __i1, const_iterator __i2, _Range&& __range) {
- basic_string __temp(from_range, std::forward<_Range>(__range), __alloc());
- return replace(__i1, __i2, __temp);
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
- replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il) {
- return replace(__i1, __i2, __il.begin(), __il.end());
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
-#if _LIBCPP_STD_VER <= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string
substr(size_type __pos = 0, size_type __n = npos) const {
return basic_string(*this, __pos, __n);
}
-#else
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) const& {
- return basic_string(*this, __pos, __n);
- }
-
- _LIBCPP_HIDE_FROM_ABI constexpr basic_string substr(size_type __pos = 0, size_type __n = npos) && {
- return basic_string(std::move(*this), __pos, __n);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(basic_string& __str)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* c_str() const _NOEXCEPT { return data(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* data() const _NOEXCEPT {
return std::__to_address(__get_pointer());
}
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 value_type* data() _NOEXCEPT {
- return std::__to_address(__get_pointer());
- }
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {
return __alloc();
@@ -1820,46 +1554,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 int
compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
-#if _LIBCPP_STD_VER >= 20
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(__self_view __sv) const noexcept {
- return __self_view(data(), size()).starts_with(__sv);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {
- return !empty() && _Traits::eq(front(), __c);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* __s) const noexcept {
- return starts_with(__self_view(__s));
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(__self_view __sv) const noexcept {
- return __self_view(data(), size()).ends_with(__sv);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {
- return !empty() && _Traits::eq(back(), __c);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* __s) const noexcept {
- return ends_with(__self_view(__s));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(__self_view __sv) const noexcept {
- return __self_view(data(), size()).contains(__sv);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept {
- return __self_view(data(), size()).contains(__c);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* __s) const {
- return __self_view(data(), size()).contains(__s);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __invariants() const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __clear_and_shrink() _NOEXCEPT;
@@ -1881,15 +1575,8 @@ private:
}
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __begin_lifetime(pointer __begin, size_type __n) {
-#if _LIBCPP_STD_VER >= 20
- if (__libcpp_is_constant_evaluated()) {
- for (size_type __i = 0; __i != __n; ++__i)
- std::construct_at(std::addressof(__begin[__i]));
- }
-#else
(void)__begin;
(void)__n;
-#endif // _LIBCPP_STD_VER >= 20
}
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) { return __sz < __min_cap; }
@@ -1905,14 +1592,6 @@ private:
template <class _ForwardIter, class _Sent>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static value_type*
__copy_non_overlapping_range(_ForwardIter __first, _Sent __last, value_type* __dest) {
-#ifndef _LIBCPP_CXX03_LANG
- if constexpr (__libcpp_is_contiguous_iterator<_ForwardIter>::value &&
- is_same<value_type, __iter_value_type<_ForwardIter>>::value && is_same<_ForwardIter, _Sent>::value) {
- traits_type::copy(__dest, std::__to_address(__first), __last - __first);
- return __dest + (__last - __first);
- }
-#endif
-
for (; __first != __last; ++__first)
traits_type::assign(*__dest++, *__first);
return __dest;
@@ -2169,18 +1848,6 @@ private:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
__copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
- __move_assign(basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value);
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void
- __move_assign(basic_string& __str, true_type)
-# if _LIBCPP_STD_VER >= 17
- noexcept;
-# else
- noexcept(is_nothrow_move_assignable<allocator_type>::value);
-# endif
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign_alloc(basic_string& __str)
_NOEXCEPT_(!__alloc_traits::propagate_on_container_move_assignment::value ||
is_nothrow_move_assignable<allocator_type>::value) {
@@ -2242,10 +1909,6 @@ private:
friend _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string operator+ <>(value_type, const basic_string&);
friend _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string operator+ <>(const basic_string&, const value_type*);
friend _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string operator+ <>(const basic_string&, value_type);
-#if _LIBCPP_STD_VER >= 26
- friend constexpr basic_string operator+ <>(const basic_string&, type_identity_t<__self_view>);
- friend constexpr basic_string operator+ <>(type_identity_t<__self_view>, const basic_string&);
-#endif
};
// These declarations must appear before any functions are implicitly used
@@ -2264,39 +1927,6 @@ _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, wchar_t)
#endif
#undef _LIBCPP_DECLARE
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _CharT = __iter_value_type<_InputIterator>,
- class _Allocator = allocator<_CharT>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
-basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator())
- -> basic_string<_CharT, char_traits<_CharT>, _Allocator>;
-
-template <class _CharT,
- class _Traits,
- class _Allocator = allocator<_CharT>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
-explicit basic_string(basic_string_view<_CharT, _Traits>,
- const _Allocator& = _Allocator()) -> basic_string<_CharT, _Traits, _Allocator>;
-
-template <class _CharT,
- class _Traits,
- class _Allocator = allocator<_CharT>,
- class = enable_if_t<__is_allocator<_Allocator>::value>,
- class _Sz = typename allocator_traits<_Allocator>::size_type >
-basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator())
- -> basic_string<_CharT, _Traits, _Allocator>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
-basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
- -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;
-#endif
-
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) {
@@ -2668,66 +2298,6 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__move_assign(
- basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value) {
- if (__alloc() != __str.__alloc())
- assign(__str);
- else
- __move_assign(__str, true_type());
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void
-basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
-# if _LIBCPP_STD_VER >= 17
- noexcept
-# else
- noexcept(is_nothrow_move_assignable<allocator_type>::value)
-# endif
-{
- __annotate_delete();
- if (__is_long()) {
- __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
-# if _LIBCPP_STD_VER <= 14
- if (!is_nothrow_move_assignable<allocator_type>::value) {
- __set_short_size(0);
- traits_type::assign(__get_short_pointer()[0], value_type());
- __annotate_new(0);
- }
-# endif
- }
- size_type __str_old_size = __str.size();
- bool __str_was_short = !__str.__is_long();
-
- __move_assign_alloc(__str);
- __r_.first() = __str.__r_.first();
- __str.__set_short_size(0);
- traits_type::assign(__str.__get_short_pointer()[0], value_type());
-
- if (__str_was_short && this != &__str)
- __str.__annotate_shrink(__str_old_size);
- else
- // ASan annotations: was long, so object memory is unpoisoned as new.
- // Or is same as *this, and __annotate_delete() was called.
- __str.__annotate_new(0);
-
- // ASan annotations: Guard against `std::string s; s = std::move(s);`
- // You can find more here: https://en.cppreference.com/w/cpp/utility/move
- // Quote: "Unless otherwise specified, all standard library objects that have been moved
- // from are placed in a "valid but unspecified state", meaning the object's class
- // invariants hold (so functions without preconditions, such as the assignment operator,
- // can be safely used on the object after it was moved from):"
- // Quote: "v = std::move(v); // the value of v is unspecified"
- if (!__is_long() && &__str != this)
- // If it is long string, delete was never called on original __str's buffer.
- __annotate_new(__get_short_size());
-}
-
-#endif
-
template <class _CharT, class _Traits, class _Allocator>
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
@@ -3434,11 +3004,7 @@ basic_string<_CharT, _Traits, _Allocator>::copy(value_type* __s, size_type __n,
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>)
-#endif
{
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__alloc_traits::propagate_on_container_swap::value || __alloc_traits::is_always_equal::value ||
@@ -3821,12 +3387,8 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
-#if _LIBCPP_STD_VER >= 20
- return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
-#else
size_t __lhs_sz = __lhs.size();
return __lhs_sz == __rhs.size() && _Traits::compare(__lhs.data(), __rhs.data(), __lhs_sz) == 0;
-#endif
}
template <class _Allocator>
@@ -3839,7 +3401,6 @@ operator==(const basic_string<char, char_traits<char>, _Allocator>& __lhs,
return char_traits<char>::compare(__lhs.data(), __rhs.data(), __sz) == 0;
}
-#if _LIBCPP_STD_VER <= 17
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool
operator==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
@@ -3850,39 +3411,18 @@ operator==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>&
return false;
return __rhs.compare(0, _String::npos, __lhs, __lhs_len) == 0;
}
-#endif // _LIBCPP_STD_VER <= 17
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) _NOEXCEPT {
-#if _LIBCPP_STD_VER >= 20
- return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
-#else
typedef basic_string<_CharT, _Traits, _Allocator> _String;
_LIBCPP_ASSERT_NON_NULL(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
size_t __rhs_len = _Traits::length(__rhs);
if (__rhs_len != __lhs.size())
return false;
return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
-#endif
}
-#if _LIBCPP_STD_VER >= 20
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
- const basic_string<_CharT, _Traits, _Allocator>& __rhs) noexcept {
- return basic_string_view<_CharT, _Traits>(__lhs) <=> basic_string_view<_CharT, _Traits>(__rhs);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr auto
-operator<=>(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) {
- return basic_string_view<_CharT, _Traits>(__lhs) <=> basic_string_view<_CharT, _Traits>(__rhs);
-}
-
-#else // _LIBCPP_STD_VER >= 20
-
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
@@ -3980,7 +3520,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool
operator>=(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
return !(__lhs < __rhs);
}
-#endif // _LIBCPP_STD_VER >= 20
// operator +
@@ -4063,108 +3602,6 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)
return __r;
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) {
- return std::move(__lhs.append(__rhs));
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) {
- return std::move(__rhs.insert(0, __lhs));
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) {
- return std::move(__lhs.append(__rhs));
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(const _CharT* __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) {
- return std::move(__rhs.insert(0, __lhs));
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(_CharT __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) {
- __rhs.insert(__rhs.begin(), __lhs);
- return std::move(__rhs);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const _CharT* __rhs) {
- return std::move(__lhs.append(__rhs));
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs) {
- __lhs.push_back(__rhs);
- return std::move(__lhs);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER >= 26
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
- type_identity_t<basic_string_view<_CharT, _Traits>> __rhs) {
- using _String = basic_string<_CharT, _Traits, _Allocator>;
- typename _String::size_type __lhs_sz = __lhs.size();
- typename _String::size_type __rhs_sz = __rhs.size();
- _String __r(__uninitialized_size_tag(),
- __lhs_sz + __rhs_sz,
- _String::__alloc_traits::select_on_container_copy_construction(__lhs.get_allocator()));
- auto __ptr = std::__to_address(__r.__get_pointer());
- _Traits::copy(__ptr, __lhs.data(), __lhs_sz);
- _Traits::copy(__ptr + __lhs_sz, __rhs.data(), __rhs_sz);
- _Traits::assign(__ptr + __lhs_sz + __rhs_sz, 1, _CharT());
- return __r;
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs,
- type_identity_t<basic_string_view<_CharT, _Traits>> __rhs) {
- __lhs.append(__rhs);
- return std::move(__lhs);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(type_identity_t<basic_string_view<_CharT, _Traits>> __lhs,
- const basic_string<_CharT, _Traits, _Allocator>& __rhs) {
- using _String = basic_string<_CharT, _Traits, _Allocator>;
- typename _String::size_type __lhs_sz = __lhs.size();
- typename _String::size_type __rhs_sz = __rhs.size();
- _String __r(__uninitialized_size_tag(),
- __lhs_sz + __rhs_sz,
- _String::__alloc_traits::select_on_container_copy_construction(__rhs.get_allocator()));
- auto __ptr = std::__to_address(__r.__get_pointer());
- _Traits::copy(__ptr, __lhs.data(), __lhs_sz);
- _Traits::copy(__ptr + __lhs_sz, __rhs.data(), __rhs_sz);
- _Traits::assign(__ptr + __lhs_sz + __rhs_sz, 1, _CharT());
- return __r;
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr basic_string<_CharT, _Traits, _Allocator>
-operator+(type_identity_t<basic_string_view<_CharT, _Traits>> __lhs,
- basic_string<_CharT, _Traits, _Allocator>&& __rhs) {
- __rhs.insert(0, __lhs);
- return std::move(__rhs);
-}
-
-#endif // _LIBCPP_STD_VER >= 26
-
// swap
template <class _CharT, class _Traits, class _Allocator>
@@ -4271,74 +3708,11 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is, basic_string<_CharT, _Traits, _Allocator>& __str);
-#if _LIBCPP_STD_VER >= 20
-template <class _CharT, class _Traits, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI typename basic_string<_CharT, _Traits, _Allocator>::size_type
-erase(basic_string<_CharT, _Traits, _Allocator>& __str, const _Up& __v) {
- auto __old_size = __str.size();
- __str.erase(std::remove(__str.begin(), __str.end(), __v), __str.end());
- return __old_size - __str.size();
-}
-
-template <class _CharT, class _Traits, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename basic_string<_CharT, _Traits, _Allocator>::size_type
-erase_if(basic_string<_CharT, _Traits, _Allocator>& __str, _Predicate __pred) {
- auto __old_size = __str.size();
- __str.erase(std::remove_if(__str.begin(), __str.end(), __pred), __str.end());
- return __old_size - __str.size();
-}
-#endif
-
-#if _LIBCPP_STD_VER >= 14
-// Literal suffixes for basic_string [basic.string.literals]
-inline namespace literals {
-inline namespace string_literals {
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char>
-operator""s(const char* __str, size_t __len) {
- return basic_string<char>(__str, __len);
-}
-
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<wchar_t>
-operator""s(const wchar_t* __str, size_t __len) {
- return basic_string<wchar_t>(__str, __len);
-}
-# endif
-
-# ifndef _LIBCPP_HAS_NO_CHAR8_T
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string<char8_t> operator""s(const char8_t* __str, size_t __len) {
- return basic_string<char8_t>(__str, __len);
-}
-# endif
-
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char16_t>
-operator""s(const char16_t* __str, size_t __len) {
- return basic_string<char16_t>(__str, __len);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char32_t>
-operator""s(const char32_t* __str, size_t __len) {
- return basic_string<char32_t>(__str, __len);
-}
-} // namespace string_literals
-} // namespace literals
-
-# if _LIBCPP_STD_VER >= 20
-template <>
-inline constexpr bool __format::__enable_insertable<std::basic_string<char>> = true;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <>
-inline constexpr bool __format::__enable_insertable<std::basic_string<wchar_t>> = true;
-# endif
-# endif
-
-#endif
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/string_view b/libcxx/include/__cxx03/string_view
index c6876ab5f4446..483bd9ee8ac02 100644
--- a/libcxx/include/__cxx03/string_view
+++ b/libcxx/include/__cxx03/string_view
@@ -309,46 +309,11 @@ public:
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
: __data_(__s),
- __size_(__len) {
-#if _LIBCPP_STD_VER >= 14
- // Allocations must fit in `ptrdiff_t` for pointer arithmetic to work. If `__len` exceeds it, the input
- // range could not have been valid. Most likely the caller underflowed some arithmetic and inadvertently
- // passed in a negative length.
- _LIBCPP_ASSERT_VALID_INPUT_RANGE(
- __len <= static_cast<size_type>(numeric_limits<difference_type>::max()),
- "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
- _LIBCPP_ASSERT_NON_NULL(
- __len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
-#endif
- }
-
-#if _LIBCPP_STD_VER >= 20
- template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
- requires(is_same_v<iter_value_t<_It>, _CharT> && !is_convertible_v<_End, size_type>)
- constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end)
- : __data_(std::to_address(__begin)), __size_(__end - __begin) {
- _LIBCPP_ASSERT_VALID_INPUT_RANGE(
- (__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 23
- template <class _Range>
- requires(!is_same_v<remove_cvref_t<_Range>, basic_string_view> && ranges::contiguous_range<_Range> &&
- ranges::sized_range<_Range> && is_same_v<ranges::range_value_t<_Range>, _CharT> &&
- !is_convertible_v<_Range, const _CharT*> &&
- (!requires(remove_cvref_t<_Range>& __d) { __d.operator std::basic_string_view<_CharT, _Traits>(); }))
- constexpr explicit _LIBCPP_HIDE_FROM_ABI basic_string_view(_Range&& __r)
- : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}
-#endif // _LIBCPP_STD_VER >= 23
+ __size_(__len) {}
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI basic_string_view(const _CharT* __s)
: __data_(__s), __size_(std::__char_traits_length_checked<_Traits>(__s)) {}
-#if _LIBCPP_STD_VER >= 23
- basic_string_view(nullptr_t) = delete;
-#endif
-
// [string.view.iterators], iterators
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return cbegin(); }
@@ -639,93 +604,12 @@ public:
data(), size(), __s, __pos, traits_type::length(__s));
}
-#if _LIBCPP_STD_VER >= 20
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(basic_string_view __s) const noexcept {
- return size() >= __s.size() && compare(0, __s.size(), __s) == 0;
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(value_type __c) const noexcept {
- return !empty() && _Traits::eq(front(), __c);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* __s) const noexcept {
- return starts_with(basic_string_view(__s));
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(basic_string_view __s) const noexcept {
- return size() >= __s.size() && compare(size() - __s.size(), npos, __s) == 0;
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(value_type __c) const noexcept {
- return !empty() && _Traits::eq(back(), __c);
- }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* __s) const noexcept {
- return ends_with(basic_string_view(__s));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(basic_string_view __sv) const noexcept { return find(__sv) != npos; }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(value_type __c) const noexcept { return find(__c) != npos; }
-
- constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* __s) const { return find(__s) != npos; }
-#endif
-
private:
const value_type* __data_;
size_type __size_;
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_string_view);
-#if _LIBCPP_STD_VER >= 20
-template <class _CharT, class _Traits>
-inline constexpr bool ranges::enable_view<basic_string_view<_CharT, _Traits>> = true;
-
-template <class _CharT, class _Traits>
-inline constexpr bool ranges::enable_borrowed_range<basic_string_view<_CharT, _Traits> > = true;
-#endif // _LIBCPP_STD_VER >= 20
-
-// [string.view.deduct]
-
-#if _LIBCPP_STD_VER >= 20
-template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
-basic_string_view(_It, _End) -> basic_string_view<iter_value_t<_It>>;
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::contiguous_range _Range>
-basic_string_view(_Range) -> basic_string_view<ranges::range_value_t<_Range>>;
-#endif
-
-// [string.view.comparison]
-
-#if _LIBCPP_STD_VER >= 20
-
-template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(basic_string_view<_CharT, _Traits> __lhs,
- type_identity_t<basic_string_view<_CharT, _Traits>> __rhs) noexcept {
- if (__lhs.size() != __rhs.size())
- return false;
- return __lhs.compare(__rhs) == 0;
-}
-
-template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(basic_string_view<_CharT, _Traits> __lhs,
- type_identity_t<basic_string_view<_CharT, _Traits>> __rhs) noexcept {
- if constexpr (requires { typename _Traits::comparison_category; }) {
- // [string.view]/4
- static_assert(
- __comparison_category<typename _Traits::comparison_category>, "return type is not a comparison category type");
- return static_cast<typename _Traits::comparison_category>(__lhs.compare(__rhs) <=> 0);
- } else {
- return static_cast<weak_ordering>(__lhs.compare(__rhs) <=> 0);
- }
-}
-
-#else
-
// operator ==
template <class _CharT, class _Traits>
@@ -867,8 +751,6 @@ operator>=(__type_identity_t<basic_string_view<_CharT, _Traits> > __lhs,
return __lhs.compare(__rhs) >= 0;
}
-#endif // _LIBCPP_STD_VER >= 20
-
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __str);
@@ -900,44 +782,11 @@ template <>
struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_hash<wchar_t> {};
#endif
-#if _LIBCPP_STD_VER >= 14
-inline namespace literals {
-inline namespace string_view_literals {
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char> operator""sv(const char* __str, size_t __len) noexcept {
- return basic_string_view<char>(__str, __len);
-}
-
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<wchar_t>
-operator""sv(const wchar_t* __str, size_t __len) noexcept {
- return basic_string_view<wchar_t>(__str, __len);
-}
-# endif
-
-# ifndef _LIBCPP_HAS_NO_CHAR8_T
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char8_t>
-operator""sv(const char8_t* __str, size_t __len) noexcept {
- return basic_string_view<char8_t>(__str, __len);
-}
-# endif
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char16_t>
-operator""sv(const char16_t* __str, size_t __len) noexcept {
- return basic_string_view<char16_t>(__str, __len);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<char32_t>
-operator""sv(const char32_t* __str, size_t __len) noexcept {
- return basic_string_view<char32_t>(__str, __len);
-}
-} // namespace string_view_literals
-} // namespace literals
-#endif
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/strstream b/libcxx/include/__cxx03/strstream
index be241a9484f60..22b223bc7710a 100644
--- a/libcxx/include/__cxx03/strstream
+++ b/libcxx/include/__cxx03/strstream
@@ -138,8 +138,6 @@ private:
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
-
_LIBCPP_PUSH_MACROS
# include <__cxx03/__undef_macros>
@@ -147,12 +145,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf {
public:
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI strstreambuf() : strstreambuf(0) {}
- explicit strstreambuf(streamsize __alsize);
-# else
explicit strstreambuf(streamsize __alsize = 0);
-# endif
strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*));
strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr);
strstreambuf(const char* __gnext, streamsize __n);
@@ -162,11 +155,6 @@ public:
strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr);
strstreambuf(const unsigned char* __gnext, streamsize __n);
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI strstreambuf(strstreambuf&& __rhs);
- _LIBCPP_HIDE_FROM_ABI strstreambuf& operator=(strstreambuf&& __rhs);
-# endif // _LIBCPP_CXX03_LANG
-
~strstreambuf() override;
void swap(strstreambuf& __rhs);
@@ -199,37 +187,6 @@ private:
void __init(char* __gnext, streamsize __n, char* __pbeg);
};
-# ifndef _LIBCPP_CXX03_LANG
-
-inline _LIBCPP_HIDE_FROM_ABI strstreambuf::strstreambuf(strstreambuf&& __rhs)
- : streambuf(__rhs),
- __strmode_(__rhs.__strmode_),
- __alsize_(__rhs.__alsize_),
- __palloc_(__rhs.__palloc_),
- __pfree_(__rhs.__pfree_) {
- __rhs.setg(nullptr, nullptr, nullptr);
- __rhs.setp(nullptr, nullptr);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI strstreambuf& strstreambuf::operator=(strstreambuf&& __rhs) {
- if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0) {
- if (__pfree_)
- __pfree_(eback());
- else
- delete[] eback();
- }
- streambuf::operator=(__rhs);
- __strmode_ = __rhs.__strmode_;
- __alsize_ = __rhs.__alsize_;
- __palloc_ = __rhs.__palloc_;
- __pfree_ = __rhs.__pfree_;
- __rhs.setg(nullptr, nullptr, nullptr);
- __rhs.setp(nullptr, nullptr);
- return *this;
-}
-
-# endif // _LIBCPP_CXX03_LANG
-
class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI istrstream : public istream {
public:
_LIBCPP_HIDE_FROM_ABI explicit istrstream(const char* __s) : istream(&__sb_), __sb_(__s, 0) {}
@@ -237,19 +194,6 @@ public:
_LIBCPP_HIDE_FROM_ABI istrstream(const char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {}
_LIBCPP_HIDE_FROM_ABI istrstream(char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {}
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI istrstream(istrstream&& __rhs) // extension
- : istream(std::move(static_cast<istream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
- istream::set_rdbuf(&__sb_);
- }
-
- _LIBCPP_HIDE_FROM_ABI istrstream& operator=(istrstream&& __rhs) {
- __sb_ = std::move(__rhs.__sb_);
- istream::operator=(std::move(__rhs));
- return *this;
- }
-# endif // _LIBCPP_CXX03_LANG
-
~istrstream() override;
_LIBCPP_HIDE_FROM_ABI void swap(istrstream& __rhs) {
@@ -270,19 +214,6 @@ public:
_LIBCPP_HIDE_FROM_ABI ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
: ostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {}
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI ostrstream(ostrstream&& __rhs) // extension
- : ostream(std::move(static_cast<ostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
- ostream::set_rdbuf(&__sb_);
- }
-
- _LIBCPP_HIDE_FROM_ABI ostrstream& operator=(ostrstream&& __rhs) {
- __sb_ = std::move(__rhs.__sb_);
- ostream::operator=(std::move(__rhs));
- return *this;
- }
-# endif // _LIBCPP_CXX03_LANG
-
~ostrstream() override;
_LIBCPP_HIDE_FROM_ABI void swap(ostrstream& __rhs) {
@@ -312,19 +243,6 @@ public:
_LIBCPP_HIDE_FROM_ABI strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
: iostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {}
-# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI strstream(strstream&& __rhs) // extension
- : iostream(std::move(static_cast<iostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
- iostream::set_rdbuf(&__sb_);
- }
-
- _LIBCPP_HIDE_FROM_ABI strstream& operator=(strstream&& __rhs) {
- __sb_ = std::move(__rhs.__sb_);
- iostream::operator=(std::move(__rhs));
- return *this;
- }
-# endif // _LIBCPP_CXX03_LANG
-
~strstream() override;
_LIBCPP_HIDE_FROM_ABI void swap(strstream& __rhs) {
@@ -346,6 +264,4 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
-
#endif // _LIBCPP___CXX03_STRSTREAM
diff --git a/libcxx/include/__cxx03/system_error b/libcxx/include/__cxx03/system_error
index 8d0d55c7e567b..ecd0f3a7bccdf 100644
--- a/libcxx/include/__cxx03/system_error
+++ b/libcxx/include/__cxx03/system_error
@@ -161,7 +161,7 @@ template <> struct hash<std::error_condition>;
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdint>
# include <__cxx03/cstring>
# include <__cxx03/limits>
diff --git a/libcxx/include/__cxx03/thread b/libcxx/include/__cxx03/thread
index 8034854a73829..1d334f2673689 100644
--- a/libcxx/include/__cxx03/thread
+++ b/libcxx/include/__cxx03/thread
@@ -115,11 +115,11 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
# include <__cxx03/ratio>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/chrono>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstring>
# include <__cxx03/functional>
# include <__cxx03/new>
diff --git a/libcxx/include/__cxx03/type_traits b/libcxx/include/__cxx03/type_traits
index 287f6f0d32b18..0f759f097227a 100644
--- a/libcxx/include/__cxx03/type_traits
+++ b/libcxx/include/__cxx03/type_traits
@@ -488,32 +488,6 @@ namespace std
#include <__cxx03/__type_traits/result_of.h>
#include <__cxx03/__type_traits/underlying_type.h>
-#if _LIBCPP_STD_VER >= 14
-# include <__cxx03/__type_traits/is_final.h>
-# include <__cxx03/__type_traits/is_null_pointer.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-# include <__cxx03/__type_traits/conjunction.h>
-# include <__cxx03/__type_traits/disjunction.h>
-# include <__cxx03/__type_traits/has_unique_object_representation.h>
-# include <__cxx03/__type_traits/invoke.h>
-# include <__cxx03/__type_traits/is_aggregate.h>
-# include <__cxx03/__type_traits/is_swappable.h>
-# include <__cxx03/__type_traits/negation.h>
-# include <__cxx03/__type_traits/void_t.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-# include <__cxx03/__type_traits/common_reference.h>
-# include <__cxx03/__type_traits/is_bounded_array.h>
-# include <__cxx03/__type_traits/is_constant_evaluated.h>
-# include <__cxx03/__type_traits/is_nothrow_convertible.h>
-# include <__cxx03/__type_traits/is_unbounded_array.h>
-# include <__cxx03/__type_traits/type_identity.h>
-# include <__cxx03/__type_traits/unwrap_ref.h>
-#endif
-
#include <__cxx03/version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__cxx03/typeindex b/libcxx/include/__cxx03/typeindex
index c7587e4e23057..7b33dd5006d8c 100644
--- a/libcxx/include/__cxx03/typeindex
+++ b/libcxx/include/__cxx03/typeindex
@@ -66,22 +66,11 @@ public:
_LIBCPP_HIDE_FROM_ABI type_index(const type_info& __y) _NOEXCEPT : __t_(&__y) {}
_LIBCPP_HIDE_FROM_ABI bool operator==(const type_index& __y) const _NOEXCEPT { return *__t_ == *__y.__t_; }
-#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const type_index& __y) const _NOEXCEPT { return *__t_ != *__y.__t_; }
-#endif
_LIBCPP_HIDE_FROM_ABI bool operator<(const type_index& __y) const _NOEXCEPT { return __t_->before(*__y.__t_); }
_LIBCPP_HIDE_FROM_ABI bool operator<=(const type_index& __y) const _NOEXCEPT { return !__y.__t_->before(*__t_); }
_LIBCPP_HIDE_FROM_ABI bool operator>(const type_index& __y) const _NOEXCEPT { return __y.__t_->before(*__t_); }
_LIBCPP_HIDE_FROM_ABI bool operator>=(const type_index& __y) const _NOEXCEPT { return !__t_->before(*__y.__t_); }
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const type_index& __y) const noexcept {
- if (*__t_ == *__y.__t_)
- return strong_ordering::equal;
- if (__t_->before(*__y.__t_))
- return strong_ordering::less;
- return strong_ordering::greater;
- }
-#endif
_LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __t_->hash_code(); }
_LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT { return __t_->name(); }
@@ -97,7 +86,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<type_index> : public __unary_function<type_inde
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/iosfwd>
# include <__cxx03/new>
# include <__cxx03/utility>
diff --git a/libcxx/include/__cxx03/typeinfo b/libcxx/include/__cxx03/typeinfo
index f01761bf485e3..ec291ccc5446e 100644
--- a/libcxx/include/__cxx03/typeinfo
+++ b/libcxx/include/__cxx03/typeinfo
@@ -105,9 +105,7 @@ public:
return __compare(__arg) == 0;
}
-# if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const type_info& __arg) const _NOEXCEPT { return !operator==(__arg); }
-# endif
};
# else // !defined(_LIBCPP_ABI_MICROSOFT)
@@ -319,9 +317,7 @@ public:
return __impl::__eq(__type_name, __arg.__type_name);
}
-# if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const type_info& __arg) const _NOEXCEPT { return !operator==(__arg); }
-# endif
};
# endif // defined(_LIBCPP_ABI_MICROSOFT)
@@ -381,7 +377,7 @@ _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_cast() {
}
_LIBCPP_END_NAMESPACE_STD
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/type_traits>
#endif
diff --git a/libcxx/include/__cxx03/uchar.h b/libcxx/include/__cxx03/uchar.h
index a19faea5814cf..446a03434b157 100644
--- a/libcxx/include/__cxx03/uchar.h
+++ b/libcxx/include/__cxx03/uchar.h
@@ -38,19 +38,4 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_CXX03_LANG)
-
-// Some platforms don't implement <uchar.h> and we don't want to give a hard
-// error on those platforms. When the platform doesn't provide <uchar.h>, at
-// least include <__cxx03/stddef.h> so we get the declaration for size_t, and try to
-// get the declaration of mbstate_t too.
-# if __has_include_next(<uchar.h>)
-# include_next <uchar.h>
-# else
-# include <__cxx03/__mbstate_t.h>
-# include <__cxx03/stddef.h>
-# endif
-
-#endif // _LIBCPP_CXX03_LANG
-
#endif // _LIBCPP___CXX03_UCHAR_H
diff --git a/libcxx/include/__cxx03/unordered_map b/libcxx/include/__cxx03/unordered_map
index 612ad02f77164..479bca2273a7e 100644
--- a/libcxx/include/__cxx03/unordered_map
+++ b/libcxx/include/__cxx03/unordered_map
@@ -644,12 +644,6 @@ public:
return static_cast<const _Hash&>(*this)(__x.__get_value().first);
}
_LIBCPP_HIDE_FROM_ABI size_t operator()(const _Key& __x) const { return static_cast<const _Hash&>(*this)(__x); }
-#if _LIBCPP_STD_VER >= 20
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI size_t operator()(const _K2& __x) const {
- return static_cast<const _Hash&>(*this)(__x);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Hash>) {
using std::swap;
swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y));
@@ -668,12 +662,6 @@ public:
_LIBCPP_HIDE_FROM_ABI const _Hash& hash_function() const _NOEXCEPT { return __hash_; }
_LIBCPP_HIDE_FROM_ABI size_t operator()(const _Cp& __x) const { return __hash_(__x.__get_value().first); }
_LIBCPP_HIDE_FROM_ABI size_t operator()(const _Key& __x) const { return __hash_(__x); }
-#if _LIBCPP_STD_VER >= 20
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI size_t operator()(const _K2& __x) const {
- return __hash_(__x);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Hash>) {
using std::swap;
swap(__hash_, __y.__hash_);
@@ -707,24 +695,6 @@ public:
_LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _Cp& __y) const {
return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);
}
-#if _LIBCPP_STD_VER >= 20
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _Cp& __x, const _K2& __y) const {
- return static_cast<const _Pred&>(*this)(__x.__get_value().first, __y);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Cp& __y) const {
- return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _K2& __y) const {
- return static_cast<const _Pred&>(*this)(__x, __y);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Key& __y) const {
- return static_cast<const _Pred&>(*this)(__x, __y);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Pred>) {
using std::swap;
swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y));
@@ -750,24 +720,6 @@ public:
_LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _Cp& __y) const {
return __pred_(__x, __y.__get_value().first);
}
-#if _LIBCPP_STD_VER >= 20
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _Cp& __x, const _K2& __y) const {
- return __pred_(__x.__get_value().first, __y);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Cp& __y) const {
- return __pred_(__x, __y.__get_value().first);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _K2& __y) const {
- return __pred_(__x, __y);
- }
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _Key& __y) const {
- return __pred_(__x, __y);
- }
-#endif
_LIBCPP_HIDE_FROM_ABI void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Pred>) {
using std::swap;
swap(__pred_, __y.__pred_);
@@ -803,19 +755,10 @@ public:
__first_constructed(false),
__second_constructed(false) {}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x) _NOEXCEPT
- : __na_(__x.__na_),
- __first_constructed(__x.__value_constructed),
- __second_constructed(__x.__value_constructed) {
- __x.__value_constructed = false;
- }
-#else // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
: __na_(__x.__na_), __first_constructed(__x.__value_constructed), __second_constructed(__x.__value_constructed) {
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {
if (__second_constructed)
@@ -827,71 +770,6 @@ public:
}
};
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp>
-struct _LIBCPP_STANDALONE_DEBUG __hash_value_type {
- typedef _Key key_type;
- typedef _Tp mapped_type;
- typedef pair<const key_type, mapped_type> value_type;
- typedef pair<key_type&, mapped_type&> __nc_ref_pair_type;
- typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type;
-
-private:
- value_type __cc_;
-
-public:
- _LIBCPP_HIDE_FROM_ABI value_type& __get_value() {
-# if _LIBCPP_STD_VER >= 17
- return *std::launder(std::addressof(__cc_));
-# else
- return __cc_;
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI const value_type& __get_value() const {
-# if _LIBCPP_STD_VER >= 17
- return *std::launder(std::addressof(__cc_));
-# else
- return __cc_;
-# endif
- }
-
- _LIBCPP_HIDE_FROM_ABI __nc_ref_pair_type __ref() {
- value_type& __v = __get_value();
- return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second);
- }
-
- _LIBCPP_HIDE_FROM_ABI __nc_rref_pair_type __move() {
- value_type& __v = __get_value();
- return __nc_rref_pair_type(std::move(const_cast<key_type&>(__v.first)), std::move(__v.second));
- }
-
- _LIBCPP_HIDE_FROM_ABI __hash_value_type& operator=(const __hash_value_type& __v) {
- __ref() = __v.__get_value();
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI __hash_value_type& operator=(__hash_value_type&& __v) {
- __ref() = __v.__move();
- return *this;
- }
-
- template <class _ValueTp, __enable_if_t<__is_same_uncvref<_ValueTp, value_type>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI __hash_value_type& operator=(_ValueTp&& __v) {
- __ref() = std::forward<_ValueTp>(__v);
- return *this;
- }
-
- __hash_value_type(const __hash_value_type& __v) = delete;
- __hash_value_type(__hash_value_type&& __v) = delete;
- template <class... _Args>
- explicit __hash_value_type(_Args&&... __args) = delete;
-
- ~__hash_value_type() = delete;
-};
-
-#else
-
template <class _Key, class _Tp>
struct __hash_value_type {
typedef _Key key_type;
@@ -908,8 +786,6 @@ public:
~__hash_value_type() = delete;
};
-#endif
-
template <class _HashIterator>
class _LIBCPP_TEMPLATE_VIS __hash_map_iterator {
_HashIterator __i_;
@@ -943,11 +819,9 @@ public:
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y) {
return __x.__i_ == __y.__i_;
}
-#if _LIBCPP_STD_VER <= 17
friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y) {
return __x.__i_ != __y.__i_;
}
-#endif
template <class, class, class, class, class>
friend class _LIBCPP_TEMPLATE_VIS unordered_map;
@@ -998,12 +872,10 @@ public:
operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y) {
return __x.__i_ == __y.__i_;
}
-#if _LIBCPP_STD_VER <= 17
friend _LIBCPP_HIDE_FROM_ABI bool
operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y) {
return __x.__i_ != __y.__i_;
}
-#endif
template <class, class, class, class, class>
friend class _LIBCPP_TEMPLATE_VIS unordered_map;
@@ -1073,11 +945,6 @@ public:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __map_node_handle<__node, allocator_type> node_type;
- typedef __insert_return_type<iterator, node_type> insert_return_type;
-#endif
-
template <class _Key2, class _Tp2, class _Hash2, class _Pred2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS unordered_map;
template <class _Key2, class _Tp2, class _Hash2, class _Pred2, class _Alloc2>
@@ -1106,81 +973,15 @@ public:
const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_map(
- from_range_t,
- _Range&& __range,
- size_type __n = /*implementation-defined*/ 0,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal(),
- const allocator_type& __a = allocator_type())
- : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
- if (__n > 0) {
- __table_.__rehash_unique(__n);
- }
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI explicit unordered_map(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u);
_LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u, const allocator_type& __a);
- _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI
- unordered_map(initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal());
- _LIBCPP_HIDE_FROM_ABI unordered_map(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const allocator_type& __a)
- : unordered_map(__n, hasher(), key_equal(), __a) {}
- _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_map(__n, __hf, key_equal(), __a) {}
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI
- unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
- : unordered_map(__first, __last, __n, hasher(), key_equal(), __a) {}
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI unordered_map(
- _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_map(__first, __last, __n, __hf, key_equal(), __a) {}
-
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_map(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
- : unordered_map(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- unordered_map(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_map(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
- : unordered_map(__il, __n, hasher(), key_equal(), __a) {}
- _LIBCPP_HIDE_FROM_ABI
- unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_map(__il, __n, __hf, key_equal(), __a) {}
-#endif
_LIBCPP_HIDE_FROM_ABI ~unordered_map() {
static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
}
_LIBCPP_HIDE_FROM_ABI unordered_map& operator=(const unordered_map& __u) {
-#ifndef _LIBCPP_CXX03_LANG
- __table_ = __u.__table_;
-#else
if (this != std::addressof(__u)) {
__table_.clear();
__table_.hash_function() = __u.__table_.hash_function();
@@ -1189,14 +990,8 @@ public:
__table_.__copy_assign_alloc(__u.__table_);
insert(__u.begin(), __u.end());
}
-#endif
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(unordered_map&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_map& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
return allocator_type(__table_.__node_alloc());
@@ -1220,103 +1015,6 @@ public:
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- for (auto&& __element : __range) {
- __table_.__insert_unique(std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) {
- return __table_.__insert_unique(std::move(__x));
- }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) {
- return __table_.__insert_unique(std::move(__x)).first;
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __x) {
- return __table_.__insert_unique(std::forward<_Pp>(__x));
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, _Pp&& __x) {
- return insert(std::forward<_Pp>(__x)).first;
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
- return __table_.__emplace_unique(std::forward<_Args>(__args)...);
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) {
- return __table_.__emplace_unique(std::forward<_Args>(__args)...).first;
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER >= 17
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {
- return __table_.__emplace_unique_key_args(
- __k, piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {
- return __table_.__emplace_unique_key_args(
- __k,
- piecewise_construct,
- std::forward_as_tuple(std::move(__k)),
- std::forward_as_tuple(std::forward<_Args>(__args)...));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator, const key_type& __k, _Args&&... __args) {
- return try_emplace(__k, std::forward<_Args>(__args)...).first;
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator, key_type&& __k, _Args&&... __args) {
- return try_emplace(std::move(__k), std::forward<_Args>(__args)...).first;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
- pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, __k, std::forward<_Vp>(__v));
- if (!__res.second) {
- __res.first->second = std::forward<_Vp>(__v);
- }
- return __res;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
- pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, std::move(__k), std::forward<_Vp>(__v));
- if (!__res.second) {
- __res.first->second = std::forward<_Vp>(__v);
- }
- return __res;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v) {
- return insert_or_assign(__k, std::forward<_Vp>(__v)).first;
- }
-
- template <class _Vp>
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v) {
- return insert_or_assign(std::move(__k), std::forward<_Vp>(__v)).first;
- }
-#endif // _LIBCPP_STD_VER >= 17
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __table_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_unique(__k); }
@@ -1325,50 +1023,6 @@ public:
}
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_map::insert()");
- return __table_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_map::insert()");
- return __table_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __table_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __table_.template __node_handle_extract<node_type>(__it.__i_);
- }
-
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_unique(__source.__table_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(unordered_map& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) {
__table_.swap(__u.__table_);
}
@@ -1378,33 +1032,8 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __table_.find(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __table_.find(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __table_.__count_unique(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
-
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __table_.__equal_range_unique(__k);
@@ -1412,21 +1041,8 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __table_.__equal_range_unique(__k);
}
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __table_.__equal_range_unique(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __table_.__equal_range_unique(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
-#endif
_LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
_LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
@@ -1451,150 +1067,9 @@ public:
_LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }
private:
-#ifdef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);
-#endif
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Hash = hash<__iter_key_type<_InputIterator>>,
- class _Pred = equal_to<__iter_key_type<_InputIterator>>,
- class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(_InputIterator,
- _InputIterator,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator())
- -> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Hash, _Pred, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Hash = hash<__range_key_type<_Range>>,
- class _Pred = equal_to<__range_key_type<_Range>>,
- class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(from_range_t,
- _Range&&,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator())
- -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash, _Pred, _Allocator>; // C++23
-# endif
-
-template <class _Key,
- class _Tp,
- class _Hash = hash<remove_const_t<_Key>>,
- class _Pred = equal_to<remove_const_t<_Key>>,
- class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(initializer_list<pair<_Key, _Tp>>,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_map<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- hash<__iter_key_type<_InputIterator>>,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(_InputIterator, _InputIterator, _Allocator)
- -> unordered_map<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- hash<__iter_key_type<_InputIterator>>,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Hash,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_map<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- _Hash,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_map<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- hash<__range_key_type<_Range>>,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(from_range_t, _Range&&, _Allocator)
- -> unordered_map<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- hash<__range_key_type<_Range>>,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_map<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- _Hash,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-# endif
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
- -> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
-
-template <class _Key,
- class _Tp,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
-#endif
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql) {
@@ -1654,66 +1129,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const unordered_ma
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(unordered_map&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
- : __table_(std::move(__u.__table_)) {}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(unordered_map&& __u, const allocator_type& __a)
- : __table_(std::move(__u.__table_), typename __table::allocator_type(__a)) {
- if (__a != __u.get_allocator()) {
- iterator __i = __u.begin();
- while (__u.size() != 0) {
- __table_.__emplace_unique(__u.__table_.remove((__i++).__i_)->__get_value().__move());
- }
- }
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(initializer_list<value_type> __il) {
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
- initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql)
- : __table_(__hf, __eql) {
- __table_.__rehash_unique(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a)
- : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
- __table_.__rehash_unique(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
- __table_ = std::move(__u.__table_);
- return *this;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
- __table_.__assign_unique(__il.begin(), __il.end());
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline void unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {
@@ -1721,26 +1136,6 @@ inline void unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterato
__table_.__insert_unique(*__first);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) {
- return __table_
- .__emplace_unique_key_args(__k, piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
- .first->__get_value()
- .second;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k) {
- return __table_
- .__emplace_unique_key_args(
- __k, piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
- .first->__get_value()
- .second;
-}
-#else // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k) {
@@ -1764,8 +1159,6 @@ _Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&
return __r.first->second;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_Tp& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::at(const key_type& __k) {
iterator __i = find(__k);
@@ -1789,14 +1182,6 @@ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, unordered_map<_Key, _T
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type
-erase_if(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) {
@@ -1811,16 +1196,12 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_map<_Key, _Tp, _Hash, _Pre
return true;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) {
return !(__x == __y);
}
-#endif
-
template <class _Key,
class _Tp,
class _Hash = hash<_Key>,
@@ -1872,10 +1253,6 @@ public:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __map_node_handle<__node, allocator_type> node_type;
-#endif
-
template <class _Key2, class _Tp2, class _Hash2, class _Pred2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS unordered_map;
template <class _Key2, class _Tp2, class _Hash2, class _Pred2, class _Alloc2>
@@ -1904,82 +1281,15 @@ public:
const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(
- from_range_t,
- _Range&& __range,
- size_type __n = /*implementation-defined*/ 0,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal(),
- const allocator_type& __a = allocator_type())
- : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
- if (__n > 0) {
- __table_.__rehash_multi(__n);
- }
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI explicit unordered_multimap(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u);
_LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal());
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const allocator_type& __a)
- : unordered_multimap(__n, hasher(), key_equal(), __a) {}
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multimap(__n, __hf, key_equal(), __a) {}
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI
- unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
- : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a) {}
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(
- _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) {}
-# if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
- : unordered_multimap(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
-
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- unordered_multimap(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multimap(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
-# endif
-
- _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
- : unordered_multimap(__il, __n, hasher(), key_equal(), __a) {}
- _LIBCPP_HIDE_FROM_ABI
- unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multimap(__il, __n, __hf, key_equal(), __a) {}
-#endif
_LIBCPP_HIDE_FROM_ABI ~unordered_multimap() {
static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
}
_LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(const unordered_multimap& __u) {
-#ifndef _LIBCPP_CXX03_LANG
- __table_ = __u.__table_;
-#else
if (this != std::addressof(__u)) {
__table_.clear();
__table_.hash_function() = __u.__table_.hash_function();
@@ -1988,14 +1298,8 @@ public:
__table_.__copy_assign_alloc(__u.__table_);
insert(__u.begin(), __u.end());
}
-#endif
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(unordered_multimap&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_multimap& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
return allocator_type(__table_.__node_alloc());
@@ -2021,44 +1325,6 @@ public:
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- for (auto&& __element : __range) {
- __table_.__insert_multi(std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
- _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) {
- return __table_.__insert_multi(__p.__i_, std::move(__x));
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __x) {
- return __table_.__insert_multi(std::forward<_Pp>(__x));
- }
-
- template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _Pp&& __x) {
- return __table_.__insert_multi(__p.__i_, std::forward<_Pp>(__x));
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
- return __table_.__emplace_multi(std::forward<_Args>(__args)...);
- }
-
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __table_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);
- }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __table_.erase(__p.__i_); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_multi(__k); }
@@ -2067,50 +1333,6 @@ public:
}
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_multimap::insert()");
- return __table_.template __node_handle_insert_multi<node_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_multimap::insert()");
- return __table_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __table_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __table_.template __node_handle_extract<node_type>(__it.__i_);
- }
-
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(unordered_multimap& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) {
__table_.swap(__u.__table_);
}
@@ -2120,33 +1342,8 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __table_.find(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __table_.find(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __table_.__count_multi(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
-
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __table_.__equal_range_multi(__k);
@@ -2154,16 +1351,6 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __table_.__equal_range_multi(__k);
}
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __table_.__equal_range_multi(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __table_.__equal_range_multi(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
_LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }
@@ -2185,159 +1372,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Hash = hash<__iter_key_type<_InputIterator>>,
- class _Pred = equal_to<__iter_key_type<_InputIterator>>,
- class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(_InputIterator,
- _InputIterator,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator())
- -> unordered_multimap<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- _Hash,
- _Pred,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Hash = hash<__range_key_type<_Range>>,
- class _Pred = equal_to<__range_key_type<_Range>>,
- class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(from_range_t,
- _Range&&,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator())
- -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash, _Pred, _Allocator>;
-# endif
-
-template <class _Key,
- class _Tp,
- class _Hash = hash<remove_const_t<_Key>>,
- class _Pred = equal_to<remove_const_t<_Key>>,
- class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(
- initializer_list<pair<_Key, _Tp>>,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multimap<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- hash<__iter_key_type<_InputIterator>>,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(_InputIterator, _InputIterator, _Allocator)
- -> unordered_multimap<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- hash<__iter_key_type<_InputIterator>>,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Hash,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multimap<__iter_key_type<_InputIterator>,
- __iter_mapped_type<_InputIterator>,
- _Hash,
- equal_to<__iter_key_type<_InputIterator>>,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multimap<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- hash<__range_key_type<_Range>>,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(from_range_t, _Range&&, _Allocator)
- -> unordered_multimap<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- hash<__range_key_type<_Range>>,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multimap<__range_key_type<_Range>,
- __range_mapped_type<_Range>,
- _Hash,
- equal_to<__range_key_type<_Range>>,
- _Allocator>;
-
-# endif
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multimap<remove_const_t<_Key>,
- _Tp,
- hash<remove_const_t<_Key>>,
- equal_to<remove_const_t<_Key>>,
- _Allocator>;
-
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
- -> unordered_multimap<remove_const_t<_Key>,
- _Tp,
- hash<remove_const_t<_Key>>,
- equal_to<remove_const_t<_Key>>,
- _Allocator>;
-
-template <class _Key,
- class _Tp,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(
- initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
-#endif
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
size_type __n, const hasher& __hf, const key_equal& __eql)
@@ -2400,67 +1434,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(unordered_multimap&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
- : __table_(std::move(__u.__table_)) {}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
- unordered_multimap&& __u, const allocator_type& __a)
- : __table_(std::move(__u.__table_), typename __table::allocator_type(__a)) {
- if (__a != __u.get_allocator()) {
- iterator __i = __u.begin();
- while (__u.size() != 0) {
- __table_.__insert_multi(__u.__table_.remove((__i++).__i_)->__get_value().__move());
- }
- }
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(initializer_list<value_type> __il) {
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
- initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql)
- : __table_(__hf, __eql) {
- __table_.__rehash_multi(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a)
- : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
- __table_.__rehash_multi(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
- __table_ = std::move(__u.__table_);
- return *this;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
- __table_.__assign_multi(__il.begin(), __il.end());
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline void unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {
@@ -2475,14 +1448,6 @@ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, unordered_multima
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type
-erase_if(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) {
@@ -2501,35 +1466,17 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multimap<_Key, _Tp, _Hash,
return true;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) {
return !(__x == __y);
}
-#endif
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_map _LIBCPP_AVAILABILITY_PMR =
- std::unordered_map<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
-
-template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multimap _LIBCPP_AVAILABILITY_PMR =
- std::unordered_multimap<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/bit>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/unordered_set b/libcxx/include/__cxx03/unordered_set
index 25e9e1f82ad32..79e53ea1c1e81 100644
--- a/libcxx/include/__cxx03/unordered_set
+++ b/libcxx/include/__cxx03/unordered_set
@@ -608,11 +608,6 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
- typedef __insert_return_type<iterator, node_type> insert_return_type;
-#endif
-
template <class _Value2, class _Hash2, class _Pred2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS unordered_set;
template <class _Value2, class _Hash2, class _Pred2, class _Alloc2>
@@ -621,12 +616,7 @@ public:
_LIBCPP_HIDE_FROM_ABI unordered_set() _NOEXCEPT_(is_nothrow_default_constructible<__table>::value) {}
explicit _LIBCPP_HIDE_FROM_ABI
unordered_set(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
-#if _LIBCPP_STD_VER >= 14
- inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const allocator_type& __a)
- : unordered_set(__n, hasher(), key_equal(), __a) {}
- inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_set(__n, __hf, key_equal(), __a) {}
-#endif
+
_LIBCPP_HIDE_FROM_ABI
unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);
template <class _InputIterator>
@@ -647,72 +637,10 @@ public:
const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_set(
- from_range_t,
- _Range&& __range,
- size_type __n = /*implementation-defined*/ 0,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal(),
- const allocator_type& __a = allocator_type())
- : __table_(__hf, __eql, __a) {
- if (__n > 0) {
- __table_.__rehash_unique(__n);
- }
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
- : unordered_set(__first, __last, __n, hasher(), key_equal(), __a) {}
- template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI unordered_set(
- _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_set(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
- : unordered_set(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
-
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- unordered_set(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_set(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI explicit unordered_set(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u);
_LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u, const allocator_type& __a);
- _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI
- unordered_set(initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal());
- _LIBCPP_HIDE_FROM_ABI unordered_set(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a);
-# if _LIBCPP_STD_VER >= 14
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_set(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
- : unordered_set(__il, __n, hasher(), key_equal(), __a) {}
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_set(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_set(__il, __n, __hf, key_equal(), __a) {}
-# endif
-#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_HIDE_FROM_ABI ~unordered_set() {
static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
}
@@ -721,11 +649,6 @@ public:
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(unordered_set&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_set& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
return allocator_type(__table_.__node_alloc());
@@ -742,38 +665,12 @@ public:
_LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
_LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
- return __table_.__emplace_unique(std::forward<_Args>(__args)...);
- }
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) {
- return __table_.__emplace_unique(std::forward<_Args>(__args)...).first;
- }
-
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) {
- return __table_.__insert_unique(std::move(__x));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) { return insert(std::move(__x)).first; }
-
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return __table_.__insert_unique(__x); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; }
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- for (auto&& __element : __range) {
- __table_.__insert_unique(std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_unique(__k); }
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
@@ -781,50 +678,6 @@ public:
}
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_set::insert()");
- return __table_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __h, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_set::insert()");
- return __table_.template __node_handle_insert_unique<node_type>(__h, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __table_.template __node_handle_extract<node_type>(__key);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {
- return __table_.template __node_handle_extract<node_type>(__it);
- }
-
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __table_.__node_handle_merge_unique(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- __table_.__node_handle_merge_unique(__source.__table_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI void swap(unordered_set& __u) _NOEXCEPT_(__is_nothrow_swappable_v<__table>) {
__table_.swap(__u.__table_);
}
@@ -834,33 +687,8 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __table_.find(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __table_.find(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __table_.__count_unique(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
-
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __table_.__equal_range_unique(__k);
@@ -868,16 +696,6 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __table_.__equal_range_unique(__k);
}
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __table_.__equal_range_unique(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __table_.__equal_range_unique(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
_LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }
@@ -899,116 +717,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_unique(__n); }
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Hash = hash<__iter_value_type<_InputIterator>>,
- class _Pred = equal_to<__iter_value_type<_InputIterator>>,
- class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(_InputIterator,
- _InputIterator,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_set<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Hash = hash<ranges::range_value_t<_Range>>,
- class _Pred = equal_to<ranges::range_value_t<_Range>>,
- class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(
- from_range_t,
- _Range&&,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
-# endif
-
-template <class _Tp,
- class _Hash = hash<_Tp>,
- class _Pred = equal_to<_Tp>,
- class _Allocator = allocator<_Tp>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(initializer_list<_Tp>,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_set<__iter_value_type<_InputIterator>,
- hash<__iter_value_type<_InputIterator>>,
- equal_to<__iter_value_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Hash,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_set<__iter_value_type<_InputIterator>, _Hash, equal_to<__iter_value_type<_InputIterator>>, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_set<ranges::range_value_t<_Range>,
- hash<ranges::range_value_t<_Range>>,
- equal_to<ranges::range_value_t<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(from_range_t, _Range&&, _Allocator)
- -> unordered_set<ranges::range_value_t<_Range>,
- hash<ranges::range_value_t<_Range>>,
- equal_to<ranges::range_value_t<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_set<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
-
-# endif
-
-template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
-
-template <class _Tp,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
-#endif
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql) {
@@ -1067,65 +775,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(const unordered_set&
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
- : __table_(std::move(__u.__table_)) {}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u, const allocator_type& __a)
- : __table_(std::move(__u.__table_), __a) {
- if (__a != __u.get_allocator()) {
- iterator __i = __u.begin();
- while (__u.size() != 0)
- __table_.__insert_unique(std::move(__u.__table_.remove(__i++)->__get_value()));
- }
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(initializer_list<value_type> __il) {
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
- initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql)
- : __table_(__hf, __eql) {
- __table_.__rehash_unique(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a)
- : __table_(__hf, __eql, __a) {
- __table_.__rehash_unique(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_set<_Value, _Hash, _Pred, _Alloc>&
-unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
- __table_ = std::move(__u.__table_);
- return *this;
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_set<_Value, _Hash, _Pred, _Alloc>&
-unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
- __table_.__assign_unique(__il.begin(), __il.end());
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline void unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {
@@ -1140,14 +789,6 @@ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, unordered_set<_Value, _Ha
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type
-erase_if(unordered_set<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) {
@@ -1162,16 +803,12 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_set<_Value, _Hash, _Pred,
return true;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) {
return !(__x == __y);
}
-#endif
-
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>, class _Alloc = allocator<_Value> >
class _LIBCPP_TEMPLATE_VIS unordered_multiset {
public:
@@ -1202,10 +839,6 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER >= 17
- typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
-#endif
-
template <class _Value2, class _Hash2, class _Pred2, class _Alloc2>
friend class _LIBCPP_TEMPLATE_VIS unordered_set;
template <class _Value2, class _Hash2, class _Pred2, class _Alloc2>
@@ -1216,12 +849,7 @@ public:
unordered_multiset(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
_LIBCPP_HIDE_FROM_ABI
unordered_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 14
- inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const allocator_type& __a)
- : unordered_multiset(__n, hasher(), key_equal(), __a) {}
- inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multiset(__n, __hf, key_equal(), __a) {}
-#endif
+
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
@@ -1240,73 +868,10 @@ public:
const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(
- from_range_t,
- _Range&& __range,
- size_type __n = /*implementation-defined*/ 0,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal(),
- const allocator_type& __a = allocator_type())
- : __table_(__hf, __eql, __a) {
- if (__n > 0) {
- __table_.__rehash_multi(__n);
- }
- insert_range(std::forward<_Range>(__range));
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 14
- template <class _InputIterator>
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
- : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a) {}
- template <class _InputIterator>
- inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(
- _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {}
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
- : unordered_multiset(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
-
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI
- unordered_multiset(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multiset(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
-#endif
-
_LIBCPP_HIDE_FROM_ABI explicit unordered_multiset(const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u);
_LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf = hasher(),
- const key_equal& __eql = key_equal());
- _LIBCPP_HIDE_FROM_ABI unordered_multiset(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a);
-# if _LIBCPP_STD_VER >= 14
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
- : unordered_multiset(__il, __n, hasher(), key_equal(), __a) {}
- inline _LIBCPP_HIDE_FROM_ABI
- unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
- : unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
-# endif
-#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_HIDE_FROM_ABI ~unordered_multiset() {
static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
}
@@ -1315,11 +880,6 @@ public:
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(unordered_multiset&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
- _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
return allocator_type(__table_.__node_alloc());
@@ -1336,23 +896,6 @@ public:
_LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
_LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
- return __table_.__emplace_multi(std::forward<_Args>(__args)...);
- }
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- return __table_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);
- }
-
- _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) {
- return __table_.__insert_multi(__p, std::move(__x));
- }
- _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); }
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) {
@@ -1362,59 +905,6 @@ public:
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
- for (auto&& __element : __range) {
- __table_.__insert_multi(std::forward<decltype(__element)>(__element));
- }
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_multiset::insert()");
- return __table_.template __node_handle_insert_multi<node_type>(std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
- "node_type with incompatible allocator passed to unordered_multiset::insert()");
- return __table_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __position) {
- return __table_.template __node_handle_extract<node_type>(__position);
- }
- _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {
- return __table_.template __node_handle_extract<node_type>(__key);
- }
-
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
- template <class _H2, class _P2>
- _LIBCPP_HIDE_FROM_ABI void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source) {
- _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
- __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
- return __table_.__node_handle_merge_multi(__source.__table_);
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p); }
_LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_multi(__k); }
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
@@ -1431,33 +921,8 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
- return __table_.find(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
- return __table_.find(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
- return __table_.__count_multi(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
-
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
- return find(__k) != end();
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
return __table_.__equal_range_multi(__k);
@@ -1465,16 +930,6 @@ public:
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
return __table_.__equal_range_multi(__k);
}
-#if _LIBCPP_STD_VER >= 20
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
- return __table_.__equal_range_multi(__k);
- }
- template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
- return __table_.__equal_range_multi(__k);
- }
-#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __table_.bucket_count(); }
_LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return __table_.max_bucket_count(); }
@@ -1496,120 +951,6 @@ public:
_LIBCPP_HIDE_FROM_ABI void reserve(size_type __n) { __table_.__reserve_multi(__n); }
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Hash = hash<__iter_value_type<_InputIterator>>,
- class _Pred = equal_to<__iter_value_type<_InputIterator>>,
- class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(
- _InputIterator,
- _InputIterator,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_multiset<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Hash = hash<ranges::range_value_t<_Range>>,
- class _Pred = equal_to<ranges::range_value_t<_Range>>,
- class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(
- from_range_t,
- _Range&&,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
-# endif
-
-template <class _Tp,
- class _Hash = hash<_Tp>,
- class _Pred = equal_to<_Tp>,
- class _Allocator = allocator<_Tp>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(initializer_list<_Tp>,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
-
-template <class _InputIterator,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multiset<__iter_value_type<_InputIterator>,
- hash<__iter_value_type<_InputIterator>>,
- equal_to<__iter_value_type<_InputIterator>>,
- _Allocator>;
-
-template <class _InputIterator,
- class _Hash,
- class _Allocator,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multiset<__iter_value_type<_InputIterator>,
- _Hash,
- equal_to<__iter_value_type<_InputIterator>>,
- _Allocator>;
-
-# if _LIBCPP_STD_VER >= 23
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multiset<ranges::range_value_t<_Range>,
- hash<ranges::range_value_t<_Range>>,
- equal_to<ranges::range_value_t<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(from_range_t, _Range&&, _Allocator)
- -> unordered_multiset<ranges::range_value_t<_Range>,
- hash<ranges::range_value_t<_Range>>,
- equal_to<ranges::range_value_t<_Range>>,
- _Allocator>;
-
-template <ranges::input_range _Range,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
-
-# endif
-
-template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
- -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
-
-template <class _Tp,
- class _Hash,
- class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
- class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
- -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
-#endif
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
size_type __n, const hasher& __hf, const key_equal& __eql)
@@ -1672,66 +1013,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(unordered_multiset&& __u)
- _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
- : __table_(std::move(__u.__table_)) {}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
- unordered_multiset&& __u, const allocator_type& __a)
- : __table_(std::move(__u.__table_), __a) {
- if (__a != __u.get_allocator()) {
- iterator __i = __u.begin();
- while (__u.size() != 0)
- __table_.__insert_multi(std::move(__u.__table_.remove(__i++)->__get_value()));
- }
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(initializer_list<value_type> __il) {
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
- initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql)
- : __table_(__hf, __eql) {
- __table_.__rehash_multi(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
- initializer_list<value_type> __il,
- size_type __n,
- const hasher& __hf,
- const key_equal& __eql,
- const allocator_type& __a)
- : __table_(__hf, __eql, __a) {
- __table_.__rehash_multi(__n);
- insert(__il.begin(), __il.end());
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_multiset&& __u)
- _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) {
- __table_ = std::move(__u.__table_);
- return *this;
-}
-
-template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
-unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(initializer_list<value_type> __il) {
- __table_.__assign_multi(__il.begin(), __il.end());
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline void unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {
@@ -1746,14 +1027,6 @@ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, unordered_multiset<_
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename unordered_multiset<_Value, _Hash, _Pred, _Alloc>::size_type
-erase_if(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) {
- return std::__libcpp_erase_if_container(__c, __pred);
-}
-#endif
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) {
@@ -1772,35 +1045,17 @@ _LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multiset<_Value, _Hash, _P
return true;
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) {
return !(__x == __y);
}
-#endif
-
-_LIBCPP_END_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_set _LIBCPP_AVAILABILITY_PMR = std::unordered_set<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
-
-template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multiset _LIBCPP_AVAILABILITY_PMR =
- std::unordered_multiset<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
-} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
-#endif
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <__cxx03/concepts>
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/functional>
# include <__cxx03/iterator>
diff --git a/libcxx/include/__cxx03/utility b/libcxx/include/__cxx03/utility
index ac0637f6b41ee..9b3e96a1bd06b 100644
--- a/libcxx/include/__cxx03/utility
+++ b/libcxx/include/__cxx03/utility
@@ -256,26 +256,6 @@ template <class T>
#include <__cxx03/__utility/rel_ops.h>
#include <__cxx03/__utility/swap.h>
-#if _LIBCPP_STD_VER >= 14
-# include <__cxx03/__utility/exchange.h>
-# include <__cxx03/__utility/integer_sequence.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 17
-# include <__cxx03/__utility/as_const.h>
-# include <__cxx03/__utility/in_place.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 20
-# include <__cxx03/__utility/cmp.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-# include <__cxx03/__utility/forward_like.h>
-# include <__cxx03/__utility/to_underlying.h>
-# include <__cxx03/__utility/unreachable.h>
-#endif
-
#include <__cxx03/version>
// standard-mandated includes
@@ -296,11 +276,11 @@ template <class T>
# pragma GCC system_header
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/limits>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/cstdlib>
# include <__cxx03/iosfwd>
# include <__cxx03/type_traits>
diff --git a/libcxx/include/__cxx03/valarray b/libcxx/include/__cxx03/valarray
index 1070add36abc4..2f4d18d9b1d47 100644
--- a/libcxx/include/__cxx03/valarray
+++ b/libcxx/include/__cxx03/valarray
@@ -396,14 +396,6 @@ public:
_LIBCPP_HIDE_FROM_ABI size_t start() const { return __start_; }
_LIBCPP_HIDE_FROM_ABI size_t size() const { return __size_; }
_LIBCPP_HIDE_FROM_ABI size_t stride() const { return __stride_; }
-
-#if _LIBCPP_STD_VER >= 20
-
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const slice& __x, const slice& __y) {
- return __x.start() == __y.start() && __x.size() == __y.size() && __x.stride() == __y.stride();
- }
-
-#endif
};
template <class _Tp>
@@ -794,10 +786,6 @@ public:
_LIBCPP_HIDE_FROM_ABI valarray(const value_type& __x, size_t __n);
valarray(const value_type* __p, size_t __n);
valarray(const valarray& __v);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI valarray(valarray&& __v) _NOEXCEPT;
- valarray(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
valarray(const slice_array<value_type>& __sa);
valarray(const gslice_array<value_type>& __ga);
valarray(const mask_array<value_type>& __ma);
@@ -806,10 +794,6 @@ public:
// assignment:
valarray& operator=(const valarray& __v);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI valarray& operator=(valarray&& __v) _NOEXCEPT;
- _LIBCPP_HIDE_FROM_ABI valarray& operator=(initializer_list<value_type>);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI valarray& operator=(const value_type& __x);
_LIBCPP_HIDE_FROM_ABI valarray& operator=(const slice_array<value_type>& __sa);
_LIBCPP_HIDE_FROM_ABI valarray& operator=(const gslice_array<value_type>& __ga);
@@ -828,22 +812,10 @@ public:
_LIBCPP_HIDE_FROM_ABI slice_array<value_type> operator[](slice __s);
_LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;
_LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](const gslice& __gs);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
- _LIBCPP_HIDE_FROM_ABI gslice_array<value_type> operator[](gslice&& __gs);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
_LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](const valarray<bool>& __vb);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
- _LIBCPP_HIDE_FROM_ABI mask_array<value_type> operator[](valarray<bool>&& __vb);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
_LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](const valarray<size_t>& __vs);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
- _LIBCPP_HIDE_FROM_ABI indirect_array<value_type> operator[](valarray<size_t>&& __vs);
-#endif // _LIBCPP_CXX03_LANG
// unary operators:
_LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__unary_plus<_Tp>, const valarray&> > operator+() const;
@@ -942,11 +914,6 @@ private:
valarray& __assign_range(const value_type* __f, const value_type* __l);
};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp, size_t _Size>
-valarray(const _Tp (&)[_Size], size_t) -> valarray<_Tp>;
-#endif
-
template <class _Expr,
__enable_if_t<__is_val_expr<_Expr>::value && __val_expr_use_member_functions<_Expr>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI typename _Expr::value_type __get(const _Expr& __v, size_t __i) {
@@ -1221,25 +1188,6 @@ public:
__init(__start);
}
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI gslice(size_t __start, const valarray<size_t>& __size, valarray<size_t>&& __stride)
- : __size_(__size), __stride_(std::move(__stride)) {
- __init(__start);
- }
-
- _LIBCPP_HIDE_FROM_ABI gslice(size_t __start, valarray<size_t>&& __size, const valarray<size_t>& __stride)
- : __size_(std::move(__size)), __stride_(__stride) {
- __init(__start);
- }
-
- _LIBCPP_HIDE_FROM_ABI gslice(size_t __start, valarray<size_t>&& __size, valarray<size_t>&& __stride)
- : __size_(std::move(__size)), __stride_(std::move(__stride)) {
- __init(__start);
- }
-
-#endif // _LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI size_t start() const { return __1d_.size() ? __1d_[0] : 0; }
_LIBCPP_HIDE_FROM_ABI valarray<size_t> size() const { return __size_; }
@@ -1318,11 +1266,6 @@ private:
gslice_array(const gslice& __gs, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)), __1d_(__gs.__1d_) {}
-#ifndef _LIBCPP_CXX03_LANG
- gslice_array(gslice&& __gs, const valarray<value_type>& __v)
- : __vp_(const_cast<value_type*>(__v.__begin_)), __1d_(std::move(__gs.__1d_)) {}
-#endif // _LIBCPP_CXX03_LANG
-
template <class>
friend class valarray;
};
@@ -1708,13 +1651,6 @@ private:
_LIBCPP_HIDE_FROM_ABI indirect_array(const valarray<size_t>& __ia, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)), __1d_(__ia) {}
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v)
- : __vp_(const_cast<value_type*>(__v.__begin_)), __1d_(std::move(__ia)) {}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class>
friend class valarray;
};
@@ -1837,13 +1773,6 @@ private:
_LIBCPP_HIDE_FROM_ABI __indirect_expr(const valarray<size_t>& __ia, const _RmExpr& __e) : __expr_(__e), __1d_(__ia) {}
-#ifndef _LIBCPP_CXX03_LANG
-
- _LIBCPP_HIDE_FROM_ABI __indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e)
- : __expr_(__e), __1d_(std::move(__ia)) {}
-
-#endif // _LIBCPP_CXX03_LANG
-
public:
_LIBCPP_HIDE_FROM_ABI __result_type operator[](size_t __i) const { return __expr_[__1d_[__i]]; }
@@ -2039,35 +1968,6 @@ valarray<_Tp>::valarray(const valarray& __v) : __begin_(nullptr), __end_(nullptr
}
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-inline valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT : __begin_(__v.__begin_), __end_(__v.__end_) {
- __v.__begin_ = __v.__end_ = nullptr;
-}
-
-template <class _Tp>
-valarray<_Tp>::valarray(initializer_list<value_type> __il) : __begin_(nullptr), __end_(nullptr) {
- const size_t __n = __il.size();
- if (__n) {
- __begin_ = __end_ = allocator<value_type>().allocate(__n);
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- try {
-# endif // _LIBCPP_HAS_NO_EXCEPTIONS
- size_t __n_left = __n;
- for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
- ::new ((void*)__end_) value_type(*__p);
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
- } catch (...) {
- __clear(__n);
- throw;
- }
-# endif // _LIBCPP_HAS_NO_EXCEPTIONS
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
valarray<_Tp>::valarray(const slice_array<value_type>& __sa) : __begin_(nullptr), __end_(nullptr) {
const size_t __n = __sa.__size_;
@@ -2177,25 +2077,6 @@ valarray<_Tp>& valarray<_Tp>::operator=(const valarray& __v) {
return *this;
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-inline valarray<_Tp>& valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT {
- __clear(size());
- __begin_ = __v.__begin_;
- __end_ = __v.__end_;
- __v.__begin_ = nullptr;
- __v.__end_ = nullptr;
- return *this;
-}
-
-template <class _Tp>
-inline valarray<_Tp>& valarray<_Tp>::operator=(initializer_list<value_type> __il) {
- return __assign_range(__il.begin(), __il.end());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
inline valarray<_Tp>& valarray<_Tp>::operator=(const value_type& __x) {
std::fill(__begin_, __end_, __x);
@@ -2273,20 +2154,6 @@ inline gslice_array<_Tp> valarray<_Tp>::operator[](const gslice& __gs) {
return gslice_array<value_type>(__gs, *this);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-inline __val_expr<__indirect_expr<const valarray<_Tp>&> > valarray<_Tp>::operator[](gslice&& __gs) const {
- return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(std::move(__gs.__1d_), *this));
-}
-
-template <class _Tp>
-inline gslice_array<_Tp> valarray<_Tp>::operator[](gslice&& __gs) {
- return gslice_array<value_type>(std::move(__gs), *this);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
inline __val_expr<__mask_expr<const valarray<_Tp>&> > valarray<_Tp>::operator[](const valarray<bool>& __vb) const {
return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(__vb, *this));
@@ -2297,20 +2164,6 @@ inline mask_array<_Tp> valarray<_Tp>::operator[](const valarray<bool>& __vb) {
return mask_array<value_type>(__vb, *this);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-inline __val_expr<__mask_expr<const valarray<_Tp>&> > valarray<_Tp>::operator[](valarray<bool>&& __vb) const {
- return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(std::move(__vb), *this));
-}
-
-template <class _Tp>
-inline mask_array<_Tp> valarray<_Tp>::operator[](valarray<bool>&& __vb) {
- return mask_array<value_type>(std::move(__vb), *this);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
inline __val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](const valarray<size_t>& __vs) const {
@@ -2322,20 +2175,6 @@ inline indirect_array<_Tp> valarray<_Tp>::operator[](const valarray<size_t>& __v
return indirect_array<value_type>(__vs, *this);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp>
-inline __val_expr<__indirect_expr<const valarray<_Tp>&> > valarray<_Tp>::operator[](valarray<size_t>&& __vs) const {
- return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(std::move(__vs), *this));
-}
-
-template <class _Tp>
-inline indirect_array<_Tp> valarray<_Tp>::operator[](valarray<size_t>&& __vs) {
- return indirect_array<value_type>(std::move(__vs), *this);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp>
inline __val_expr<_UnaryOp<__unary_plus<_Tp>, const valarray<_Tp>&> > valarray<_Tp>::operator+() const {
using _Op = _UnaryOp<__unary_plus<_Tp>, const valarray<_Tp>&>;
@@ -3351,7 +3190,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/concepts>
# include <__cxx03/cstdlib>
diff --git a/libcxx/include/__cxx03/vector b/libcxx/include/__cxx03/vector
index 6ee35b4e36258..598efb1534197 100644
--- a/libcxx/include/__cxx03/vector
+++ b/libcxx/include/__cxx03/vector
@@ -430,11 +430,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value) {}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
-#else
- _NOEXCEPT
-#endif
: __end_cap_(nullptr, __a) {
}
@@ -447,18 +443,6 @@ public:
__guard.__complete();
}
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a)
- : __end_cap_(nullptr, __a) {
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- if (__n > 0) {
- __vallocate(__n);
- __construct_at_end(__n);
- }
- __guard.__complete();
- }
-#endif
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x) {
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
if (__n > 0) {
@@ -505,21 +489,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr vector(
- from_range_t, _Range&& __range, const allocator_type& __alloc = allocator_type())
- : __end_cap_(nullptr, __alloc) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __init_with_size(ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
private:
class __destroy_vector {
public:
@@ -545,24 +514,8 @@ public:
vector(const vector& __x, const __type_identity_t<allocator_type>& __a);
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(const vector& __x);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- vector(initializer_list<value_type> __il, const allocator_type& __a);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- return *this;
- }
-#endif // !_LIBCPP_CXX03_LANG
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(vector&& __x)
-#if _LIBCPP_STD_VER >= 17
- noexcept;
-#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
-#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(vector&& __x, const __type_identity_t<allocator_type>& __a);
@@ -581,27 +534,8 @@ public:
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(_ForwardIterator __first, _ForwardIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __assign_with_size(ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const_reference __u);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- }
-#endif
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
return this->__alloc();
}
@@ -680,20 +614,8 @@ public:
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
-#if _LIBCPP_STD_VER >= 17
- reference
- emplace_back(_Args&&... __args);
-#else
void
emplace_back(_Args&&... __args);
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {
- insert_range(end(), std::forward<_Range>(__range));
- }
-#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back();
@@ -713,19 +635,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
template <
class _ForwardIterator,
__enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
@@ -734,13 +643,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
- insert(const_iterator __position, initializer_list<value_type> __il) {
- return insert(__position, __il.begin(), __il.end());
- }
-#endif
-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position);
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last);
@@ -754,11 +656,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void resize(size_type __sz, const_reference __x);
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(vector&)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
-#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
@@ -1020,27 +918,6 @@ private:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector&, false_type) _NOEXCEPT {}
};
-#if _LIBCPP_STD_VER >= 17
-template <class _InputIterator,
- class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-vector(_InputIterator, _InputIterator) -> vector<__iter_value_type<_InputIterator>, _Alloc>;
-
-template <class _InputIterator,
- class _Alloc,
- class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-vector(_InputIterator, _InputIterator, _Alloc) -> vector<__iter_value_type<_InputIterator>, _Alloc>;
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range,
- class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
-vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;
-#endif
-
// __swap_out_circular_buffer relocates the objects in [__begin_, __end_) into the front of __v and swaps the buffers of
// *this and __v. It is assumed that __v provides space for exactly (__end_ - __begin_) objects in the front. This
// function has a strong exception guarantee.
@@ -1247,11 +1124,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const __type_identity_t<alloc
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocator>::vector(vector&& __x)
-#if _LIBCPP_STD_VER >= 17
- noexcept
-#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-#endif
: __end_cap_(nullptr, std::move(__x.__alloc())) {
this->__begin_ = __x.__begin_;
this->__end_ = __x.__end_;
@@ -1276,33 +1149,6 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_
}
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI
-vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il) {
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- if (__il.size() > 0) {
- __vallocate(__il.size());
- __construct_at_end(__il.begin(), __il.end(), __il.size());
- }
- __guard.__complete();
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI
-vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
- : __end_cap_(nullptr, __a) {
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- if (__il.size() > 0) {
- __vallocate(__il.size());
- __construct_at_end(__il.begin(), __il.end(), __il.size());
- }
- __guard.__complete();
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocator>&
vector<_Tp, _Allocator>::operator=(vector&& __x)
@@ -1544,11 +1390,7 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {
template <class _Tp, class _Allocator>
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline
-#if _LIBCPP_STD_VER >= 17
- typename vector<_Tp, _Allocator>::reference
-#else
void
-#endif
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
pointer __end = this->__end_;
if (__end < this->__end_cap()) {
@@ -1558,9 +1400,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline
__end = __emplace_back_slow_path(std::forward<_Args>(__args)...);
}
this->__end_ = __end;
-#if _LIBCPP_STD_VER >= 17
- return *(__end - 1);
-#endif
}
template <class _Tp, class _Allocator>
@@ -1809,11 +1648,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __s
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::swap(vector& __x)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>)
-#endif
{
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__alloc_traits::propagate_on_container_swap::value || this->__alloc() == __x.__alloc(),
@@ -1918,11 +1753,7 @@ public:
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value);
-#else
- _NOEXCEPT;
-#endif
private:
class __destroy_vector {
@@ -1942,9 +1773,6 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~vector() { __destroy_vector (*this)(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n);
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n, const allocator_type& __a);
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
vector(size_type __n, const value_type& __v, const allocator_type& __a);
@@ -1959,42 +1787,12 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<bool> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr vector(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
- : __begin_(nullptr), __size_(0), __cap_alloc_(0, static_cast<__storage_allocator>(__a)) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __init_with_size(ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(const vector& __v);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(const vector& __v, const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector& operator=(const vector& __v);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- vector(initializer_list<value_type> __il, const allocator_type& __a);
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector& operator=(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- return *this;
- }
-
-#endif // !_LIBCPP_CXX03_LANG
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(vector&& __v)
-#if _LIBCPP_STD_VER >= 17
- noexcept;
-#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
vector(vector&& __v, const __type_identity_t<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector& operator=(vector&& __v)
@@ -2005,27 +1803,8 @@ public:
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
void _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_ForwardIterator __first, _ForwardIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<bool> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- __assign_with_size(ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void assign(size_type __n, const value_type& __x);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void assign(initializer_list<value_type> __il) {
- assign(__il.begin(), __il.end());
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {
return allocator_type(this->__alloc());
}
@@ -2083,37 +1862,8 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const { return __make_ref(__size_ - 1); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(const value_type& __x);
-#if _LIBCPP_STD_VER >= 14
- template <class... _Args>
-# if _LIBCPP_STD_VER >= 17
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference emplace_back(_Args&&... __args)
-# else
- _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args)
-# endif
- {
- push_back(value_type(std::forward<_Args>(__args)...));
-# if _LIBCPP_STD_VER >= 17
- return this->back();
-# endif
- }
-#endif
-
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<bool> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {
- insert_range(end(), std::forward<_Range>(__range));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back() { --__size_; }
-#if _LIBCPP_STD_VER >= 14
- template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args) {
- return insert(__position, value_type(std::forward<_Args>(__args)...));
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
insert(const_iterator __position, size_type __n, const value_type& __x);
@@ -2124,37 +1874,13 @@ public:
iterator _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-#if _LIBCPP_STD_VER >= 23
- template <_ContainerCompatibleRange<bool> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
- if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
- auto __n = static_cast<size_type>(ranges::distance(__range));
- return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
-
- } else {
- return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
- }
- }
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
- insert(const_iterator __position, initializer_list<value_type> __il) {
- return insert(__position, __il.begin(), __il.end());
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __position);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT { __size_ = 0; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void swap(reference __x, reference __y) _NOEXCEPT {
std::swap(__x, __y);
}
@@ -2371,11 +2097,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocat
template <class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
-#else
- _NOEXCEPT
-#endif
: __begin_(nullptr), __size_(0), __cap_alloc_(0, static_cast<__storage_allocator>(__a)) {
}
@@ -2388,17 +2110,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n)
}
}
-#if _LIBCPP_STD_VER >= 14
-template <class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
- : __begin_(nullptr), __size_(0), __cap_alloc_(0, static_cast<__storage_allocator>(__a)) {
- if (__n > 0) {
- __vallocate(__n);
- __construct_at_end(__n, false);
- }
-}
-#endif
-
template <class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)
: __begin_(nullptr), __size_(0), __cap_alloc_(0, __default_init_tag()) {
@@ -2450,31 +2161,6 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la
__init_with_size(__first, __last, __n);
}
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(initializer_list<value_type> __il)
- : __begin_(nullptr), __size_(0), __cap_alloc_(0, __default_init_tag()) {
- size_type __n = static_cast<size_type>(__il.size());
- if (__n > 0) {
- __vallocate(__n);
- __construct_at_end(__il.begin(), __il.end(), __n);
- }
-}
-
-template <class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-vector<bool, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
- : __begin_(nullptr), __size_(0), __cap_alloc_(0, static_cast<__storage_allocator>(__a)) {
- size_type __n = static_cast<size_type>(__il.size());
- if (__n > 0) {
- __vallocate(__n);
- __construct_at_end(__il.begin(), __il.end(), __n);
- }
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(const vector& __v)
: __begin_(nullptr),
@@ -2513,11 +2199,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>& vector<bool, _Allocator>
template <class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(vector&& __v)
-#if _LIBCPP_STD_VER >= 17
- _NOEXCEPT
-#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-#endif
: __begin_(__v.__begin_),
__size_(__v.__size_),
__cap_alloc_(std::move(__v.__cap_alloc_)) {
@@ -2812,11 +2494,7 @@ vector<bool, _Allocator>::erase(const_iterator __first, const_iterator __last) {
template <class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::swap(vector& __x)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>)
-#endif
{
std::swap(this->__begin_, __x.__begin_);
std::swap(this->__size_, __x.__size_);
@@ -2909,8 +2587,6 @@ operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
-#if _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) {
return !(__x == __y);
@@ -2936,83 +2612,17 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const vector<_Tp, _Allocator>& __x,
return !(__y < __x);
}
-#else // _LIBCPP_STD_VER <= 17
-
-template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp>
-operator<=>(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) {
- return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
-#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class _Allocator, class _Up>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::size_type
-erase(vector<_Tp, _Allocator>& __c, const _Up& __v) {
- auto __old_size = __c.size();
- __c.erase(std::remove(__c.begin(), __c.end(), __v), __c.end());
- return __old_size - __c.size();
-}
-
-template <class _Tp, class _Allocator, class _Predicate>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::size_type
-erase_if(vector<_Tp, _Allocator>& __c, _Predicate __pred) {
- auto __old_size = __c.size();
- __c.erase(std::remove_if(__c.begin(), __c.end(), __pred), __c.end());
- return __old_size - __c.size();
-}
-
-template <>
-inline constexpr bool __format::__enable_insertable<vector<char>> = true;
-# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <>
-inline constexpr bool __format::__enable_insertable<vector<wchar_t>> = true;
-# endif
-
-#endif // _LIBCPP_STD_VER >= 20
-
-#if _LIBCPP_STD_VER >= 23
-template <class _Tp, class _CharT>
-// Since is-vector-bool-reference is only used once it's inlined here.
- requires same_as<typename _Tp::__container, vector<bool, typename _Tp::__container::allocator_type>>
-struct _LIBCPP_TEMPLATE_VIS formatter<_Tp, _CharT> {
-private:
- formatter<bool, _CharT> __underlying_;
-
-public:
- template <class _ParseContext>
- _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
- return __underlying_.parse(__ctx);
- }
-
- template <class _FormatContext>
- _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(const _Tp& __ref, _FormatContext& __ctx) const {
- return __underlying_.format(__ref, __ctx);
- }
-};
-#endif // _LIBCPP_STD_VER >= 23
-
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 17
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _ValueT>
-using vector _LIBCPP_AVAILABILITY_PMR = std::vector<_ValueT, polymorphic_allocator<_ValueT>>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
_LIBCPP_POP_MACROS
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# include <__cxx03/algorithm>
# include <__cxx03/atomic>
# include <__cxx03/concepts>
diff --git a/libcxx/include/__cxx03/version b/libcxx/include/__cxx03/version
index ed1857db05b31..9cf9306810db4 100644
--- a/libcxx/include/__cxx03/version
+++ b/libcxx/include/__cxx03/version
@@ -270,297 +270,4 @@ __cpp_lib_void_t 201411L <type_traits>
# pragma GCC system_header
#endif
-// clang-format off
-
-#if _LIBCPP_STD_VER >= 14
-# 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
-# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-# define __cpp_lib_quoted_string_io 201304L
-# endif
-# define __cpp_lib_result_of_sfinae 201210L
-# define __cpp_lib_robust_nonmodifying_seq_ops 201304L
-# if !defined(_LIBCPP_HAS_NO_THREADS)
-# 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 >= 17
-# 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
-# define __cpp_lib_array_constexpr 201603L
-# define __cpp_lib_as_const 201510L
-# define __cpp_lib_atomic_is_always_lock_free 201603L
-# 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_HAS_NO_FILESYSTEM) && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY
-# define __cpp_lib_filesystem 201703L
-# endif
-# define __cpp_lib_gcd_lcm 201606L
-# if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
-# define __cpp_lib_hardware_interference_size 201703L
-# endif
-# 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
-# if _LIBCPP_AVAILABILITY_HAS_PMR
-# define __cpp_lib_memory_resource 201603L
-# endif
-# 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
-# if !defined(_LIBCPP_HAS_NO_THREADS)
-# define __cpp_lib_scoped_lock 201703L
-# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS)
-# define __cpp_lib_shared_mutex 201505L
-# endif
-# define __cpp_lib_shared_ptr_arrays 201611L
-# define __cpp_lib_shared_ptr_weak_type 201606L
-# define __cpp_lib_string_view 201606L
-// # 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 >= 20
-# undef __cpp_lib_array_constexpr
-# define __cpp_lib_array_constexpr 201811L
-# define __cpp_lib_assume_aligned 201811L
-# define __cpp_lib_atomic_flag_test 201907L
-// # define __cpp_lib_atomic_float 201711L
-# define __cpp_lib_atomic_lock_free_type_aliases 201907L
-# define __cpp_lib_atomic_ref 201806L
-// # define __cpp_lib_atomic_shared_ptr 201711L
-# define __cpp_lib_atomic_value_initialization 201911L
-# if _LIBCPP_AVAILABILITY_HAS_SYNC
-# define __cpp_lib_atomic_wait 201907L
-# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
-# 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 201907L
-# 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 >= 20 && 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
-# define __cpp_lib_format 202110L
-# define __cpp_lib_format_uchar 202311L
-# define __cpp_lib_generic_unordered_lookup 201811L
-# define __cpp_lib_int_pow2 202002L
-# define __cpp_lib_integer_comparison_functions 202002L
-# 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) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && _LIBCPP_AVAILABILITY_HAS_SYNC
-# define __cpp_lib_jthread 201911L
-# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
-# define __cpp_lib_latch 201907L
-# endif
-# define __cpp_lib_list_remove_return_type 201806L
-# define __cpp_lib_math_constants 201907L
-# define __cpp_lib_move_iterator_concept 202207L
-# if _LIBCPP_AVAILABILITY_HAS_PMR
-# define __cpp_lib_polymorphic_allocator 201902L
-# endif
-# define __cpp_lib_ranges 202207L
-# define __cpp_lib_remove_cvref 201711L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
-# define __cpp_lib_semaphore 201907L
-# endif
-# undef __cpp_lib_shared_ptr_arrays
-# define __cpp_lib_shared_ptr_arrays 201707L
-# 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
-# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
-# define __cpp_lib_syncbuf 201803L
-# endif
-# define __cpp_lib_three_way_comparison 201907L
-# define __cpp_lib_to_address 201711L
-# define __cpp_lib_to_array 201907L
-# define __cpp_lib_type_identity 201806L
-# define __cpp_lib_unwrap_ref 201811L
-#endif
-
-#if _LIBCPP_STD_VER >= 23
-# define __cpp_lib_adaptor_iterator_pair_constructor 202106L
-# define __cpp_lib_allocate_at_least 202302L
-// # define __cpp_lib_associative_heterogeneous_erasure 202110L
-# define __cpp_lib_bind_back 202202L
-# define __cpp_lib_byteswap 202110L
-# define __cpp_lib_constexpr_bitset 202207L
-# define __cpp_lib_constexpr_charconv 202207L
-// # define __cpp_lib_constexpr_cmath 202202L
-# undef __cpp_lib_constexpr_memory
-# define __cpp_lib_constexpr_memory 202202L
-# define __cpp_lib_constexpr_typeinfo 202106L
-# define __cpp_lib_containers_ranges 202202L
-# define __cpp_lib_expected 202211L
-# define __cpp_lib_format_ranges 202207L
-// # define __cpp_lib_formatters 202302L
-# define __cpp_lib_forward_like 202207L
-# define __cpp_lib_invoke_r 202106L
-# define __cpp_lib_ios_noreplace 202207L
-# define __cpp_lib_is_scoped_enum 202011L
-# define __cpp_lib_mdspan 202207L
-# define __cpp_lib_modules 202207L
-// # define __cpp_lib_move_only_function 202110L
-# undef __cpp_lib_optional
-# define __cpp_lib_optional 202110L
-# define __cpp_lib_out_ptr 202106L
-# define __cpp_lib_print 202207L
-// # define __cpp_lib_ranges_as_const 202207L
-# define __cpp_lib_ranges_as_rvalue 202207L
-// # define __cpp_lib_ranges_chunk 202202L
-# define __cpp_lib_ranges_chunk_by 202202L
-# define __cpp_lib_ranges_contains 202207L
-# define __cpp_lib_ranges_find_last 202207L
-// # define __cpp_lib_ranges_iota 202202L
-// # define __cpp_lib_ranges_join_with 202202L
-# define __cpp_lib_ranges_repeat 202207L
-// # define __cpp_lib_ranges_slide 202202L
-# define __cpp_lib_ranges_starts_ends_with 202106L
-# define __cpp_lib_ranges_to_container 202202L
-// # define __cpp_lib_ranges_zip 202110L
-// # define __cpp_lib_reference_from_temporary 202202L
-// # define __cpp_lib_spanstream 202106L
-// # define __cpp_lib_stacktrace 202011L
-# define __cpp_lib_stdatomic_h 202011L
-# define __cpp_lib_string_contains 202011L
-# define __cpp_lib_string_resize_and_overwrite 202110L
-# define __cpp_lib_to_underlying 202102L
-// # define __cpp_lib_tuple_like 202207L
-# define __cpp_lib_unreachable 202202L
-#endif
-
-#if _LIBCPP_STD_VER >= 26
-// # define __cpp_lib_associative_heterogeneous_insertion 202306L
-// # define __cpp_lib_atomic_min_max 202403L
-# undef __cpp_lib_bind_front
-# define __cpp_lib_bind_front 202306L
-# define __cpp_lib_bitset 202306L
-// # define __cpp_lib_constexpr_new 202406L
-// # define __cpp_lib_constrained_equality 202403L
-// # define __cpp_lib_copyable_function 202306L
-// # define __cpp_lib_debugging 202311L
-// # define __cpp_lib_default_template_type_for_algorithm_values 202403L
-// # define __cpp_lib_format_path 202403L
-// # define __cpp_lib_freestanding_algorithm 202311L
-// # define __cpp_lib_freestanding_array 202311L
-// # define __cpp_lib_freestanding_cstring 202306L
-// # define __cpp_lib_freestanding_expected 202311L
-// # define __cpp_lib_freestanding_mdspan 202311L
-// # define __cpp_lib_freestanding_optional 202311L
-// # define __cpp_lib_freestanding_string_view 202311L
-// # define __cpp_lib_freestanding_variant 202311L
-# if !defined(_LIBCPP_HAS_NO_FILESYSTEM) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-# define __cpp_lib_fstream_native_handle 202306L
-# endif
-// # define __cpp_lib_function_ref 202306L
-// # define __cpp_lib_generate_random 202403L
-// # define __cpp_lib_hazard_pointer 202306L
-// # define __cpp_lib_inplace_vector 202406L
-// # define __cpp_lib_is_virtual_base_of 202406L
-// # define __cpp_lib_is_within_lifetime 202306L
-// # define __cpp_lib_linalg 202311L
-# undef __cpp_lib_mdspan
-# define __cpp_lib_mdspan 202406L
-// # define __cpp_lib_optional_range_support 202406L
-# undef __cpp_lib_out_ptr
-# define __cpp_lib_out_ptr 202311L
-// # define __cpp_lib_philox_engine 202406L
-// # define __cpp_lib_ranges_concat 202403L
-# define __cpp_lib_ratio 202306L
-// # define __cpp_lib_rcu 202306L
-# define __cpp_lib_reference_wrapper 202403L
-# define __cpp_lib_saturation_arithmetic 202311L
-// # define __cpp_lib_senders 202406L
-// # define __cpp_lib_smart_ptr_owner_equality 202306L
-# define __cpp_lib_span_at 202311L
-# define __cpp_lib_span_initializer_list 202311L
-# define __cpp_lib_sstream_from_string_view 202306L
-# undef __cpp_lib_string_view
-# define __cpp_lib_string_view 202403L
-// # define __cpp_lib_submdspan 202306L
-// # define __cpp_lib_text_encoding 202306L
-# undef __cpp_lib_to_chars
-// # define __cpp_lib_to_chars 202306L
-// # define __cpp_lib_to_string 202306L
-# undef __cpp_lib_tuple_like
-// # define __cpp_lib_tuple_like 202311L
-#endif
-
-// clang-format on
-
#endif // _LIBCPP___CXX03_VERSIONH
More information about the libcxx-commits
mailing list