diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h --- a/libcxx/include/__algorithm/comp_ref_type.h +++ b/libcxx/include/__algorithm/comp_ref_type.h @@ -10,6 +10,7 @@ #define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H #include <__config> +#include <__utility/declval.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/equal_range.h b/libcxx/include/__algorithm/equal_range.h --- a/libcxx/include/__algorithm/equal_range.h +++ b/libcxx/include/__algorithm/equal_range.h @@ -15,6 +15,7 @@ #include <__algorithm/half_positive.h> #include <__algorithm/lower_bound.h> #include <__algorithm/upper_bound.h> +#include <__utility/pair.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h --- a/libcxx/include/__algorithm/inplace_merge.h +++ b/libcxx/include/__algorithm/inplace_merge.h @@ -17,6 +17,8 @@ #include <__algorithm/min.h> #include <__algorithm/upper_bound.h> #include <__iterator/iterator_traits.h> +#include <__utility/move.h> +#include <__utility/pair.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/minmax.h b/libcxx/include/__algorithm/minmax.h --- a/libcxx/include/__algorithm/minmax.h +++ b/libcxx/include/__algorithm/minmax.h @@ -11,8 +11,8 @@ #include <__config> #include <__algorithm/comp.h> +#include <__utility/pair.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h --- a/libcxx/include/__algorithm/minmax_element.h +++ b/libcxx/include/__algorithm/minmax_element.h @@ -12,7 +12,7 @@ #include <__config> #include <__algorithm/comp.h> #include <__iterator/iterator_traits.h> -#include +#include <__utility/pair.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/mismatch.h b/libcxx/include/__algorithm/mismatch.h --- a/libcxx/include/__algorithm/mismatch.h +++ b/libcxx/include/__algorithm/mismatch.h @@ -13,7 +13,7 @@ #include <__config> #include <__algorithm/comp.h> #include <__iterator/iterator_traits.h> -#include +#include <__utility/pair.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/move.h b/libcxx/include/__algorithm/move.h --- a/libcxx/include/__algorithm/move.h +++ b/libcxx/include/__algorithm/move.h @@ -13,7 +13,6 @@ #include <__algorithm/unwrap_iter.h> #include <__utility/move.h> #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/move_backward.h b/libcxx/include/__algorithm/move_backward.h --- a/libcxx/include/__algorithm/move_backward.h +++ b/libcxx/include/__algorithm/move_backward.h @@ -11,8 +11,8 @@ #include <__config> #include <__algorithm/unwrap_iter.h> +#include <__utility/move.h> #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h --- a/libcxx/include/__algorithm/partition.h +++ b/libcxx/include/__algorithm/partition.h @@ -12,7 +12,6 @@ #include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> -#include // pair #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/partition_copy.h b/libcxx/include/__algorithm/partition_copy.h --- a/libcxx/include/__algorithm/partition_copy.h +++ b/libcxx/include/__algorithm/partition_copy.h @@ -11,7 +11,7 @@ #include <__config> #include <__iterator/iterator_traits.h> -#include // pair +#include <__utility/pair.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/remove_if.h b/libcxx/include/__algorithm/remove_if.h --- a/libcxx/include/__algorithm/remove_if.h +++ b/libcxx/include/__algorithm/remove_if.h @@ -11,7 +11,7 @@ #include <__config> #include <__algorithm/find_if.h> -#include +#include <__utility/move.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h --- a/libcxx/include/__algorithm/rotate.h +++ b/libcxx/include/__algorithm/rotate.h @@ -16,6 +16,8 @@ #include <__iterator/iterator_traits.h> #include <__iterator/next.h> #include <__iterator/prev.h> +#include <__utility/forward.h> +#include <__utility/move.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/shift_left.h b/libcxx/include/__algorithm/shift_left.h --- a/libcxx/include/__algorithm/shift_left.h +++ b/libcxx/include/__algorithm/shift_left.h @@ -12,7 +12,7 @@ #include <__config> #include <__algorithm/move.h> #include <__iterator/iterator_traits.h> -#include // swap +#include <__utility/move.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/shift_right.h b/libcxx/include/__algorithm/shift_right.h --- a/libcxx/include/__algorithm/shift_right.h +++ b/libcxx/include/__algorithm/shift_right.h @@ -14,7 +14,7 @@ #include <__algorithm/move_backward.h> #include <__algorithm/swap_ranges.h> #include <__iterator/iterator_traits.h> -#include // swap +#include <__utility/move.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -15,9 +15,9 @@ #include <__algorithm/min_element.h> #include <__algorithm/partial_sort.h> #include <__algorithm/unwrap_iter.h> +#include <__utility/move.h> #include <__utility/swap.h> #include -#include // swap #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h --- a/libcxx/include/__algorithm/stable_partition.h +++ b/libcxx/include/__algorithm/stable_partition.h @@ -12,6 +12,8 @@ #include <__config> #include <__algorithm/rotate.h> #include <__iterator/iterator_traits.h> +#include <__utility/move.h> +#include <__utility/pair.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h --- a/libcxx/include/__algorithm/stable_sort.h +++ b/libcxx/include/__algorithm/stable_sort.h @@ -15,9 +15,10 @@ #include <__algorithm/inplace_merge.h> #include <__algorithm/sort.h> #include <__iterator/iterator_traits.h> +#include <__utility/move.h> +#include <__utility/pair.h> #include <__utility/swap.h> #include -#include // swap #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/unique_copy.h b/libcxx/include/__algorithm/unique_copy.h --- a/libcxx/include/__algorithm/unique_copy.h +++ b/libcxx/include/__algorithm/unique_copy.h @@ -12,7 +12,6 @@ #include <__config> #include <__algorithm/comp.h> #include <__iterator/iterator_traits.h> -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/unwrap_iter.h b/libcxx/include/__algorithm/unwrap_iter.h --- a/libcxx/include/__algorithm/unwrap_iter.h +++ b/libcxx/include/__algorithm/unwrap_iter.h @@ -12,6 +12,7 @@ #include <__config> #include #include <__memory/pointer_traits.h> +#include <__utility/declval.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__functional/__perfect_forward.h b/libcxx/include/__functional/__perfect_forward.h --- a/libcxx/include/__functional/__perfect_forward.h +++ b/libcxx/include/__functional/__perfect_forward.h @@ -11,9 +11,10 @@ #define _LIBCPP___FUNCTIONAL___PERFECT_FORWARD_H #include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> #include #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/__weak_result_type.h b/libcxx/include/__functional/__weak_result_type.h --- a/libcxx/include/__functional/__weak_result_type.h +++ b/libcxx/include/__functional/__weak_result_type.h @@ -13,6 +13,7 @@ #include <__config> #include <__functional/binary_function.h> #include <__functional/unary_function.h> +#include <__utility/declval.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h --- a/libcxx/include/__functional/bind.h +++ b/libcxx/include/__functional/bind.h @@ -13,6 +13,7 @@ #include <__config> #include <__functional/__weak_result_type.h> #include <__functional/invoke.h> +#include <__utility/forward.h> #include #include #include diff --git a/libcxx/include/__functional/bind_front.h b/libcxx/include/__functional/bind_front.h --- a/libcxx/include/__functional/bind_front.h +++ b/libcxx/include/__functional/bind_front.h @@ -13,8 +13,8 @@ #include <__config> #include <__functional/__perfect_forward.h> #include <__functional/invoke.h> +#include <__utility/forward.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/bit_and.h b/libcxx/include/__functional/bit_and.h --- a/libcxx/include/__functional/bit_and.h +++ b/libcxx/include/__functional/bit_and.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/bit_not.h b/libcxx/include/__functional/bit_not.h --- a/libcxx/include/__functional/bit_not.h +++ b/libcxx/include/__functional/bit_not.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/unary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/bit_or.h b/libcxx/include/__functional/bit_or.h --- a/libcxx/include/__functional/bit_or.h +++ b/libcxx/include/__functional/bit_or.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/bit_xor.h b/libcxx/include/__functional/bit_xor.h --- a/libcxx/include/__functional/bit_xor.h +++ b/libcxx/include/__functional/bit_xor.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/default_searcher.h b/libcxx/include/__functional/default_searcher.h --- a/libcxx/include/__functional/default_searcher.h +++ b/libcxx/include/__functional/default_searcher.h @@ -14,7 +14,7 @@ #include <__iterator/iterator_traits.h> #include <__functional/equal_to.h> #include <__functional/search.h> -#include +#include <__utility/pair.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/divides.h b/libcxx/include/__functional/divides.h --- a/libcxx/include/__functional/divides.h +++ b/libcxx/include/__functional/divides.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/equal_to.h b/libcxx/include/__functional/equal_to.h --- a/libcxx/include/__functional/equal_to.h +++ b/libcxx/include/__functional/equal_to.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -18,10 +18,12 @@ #include <__memory/allocator_traits.h> #include <__memory/compressed_pair.h> #include <__memory/shared_ptr.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/piecewise_construct.h> #include #include // TODO: replace with <__memory/__builtin_new_allocator.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/greater.h b/libcxx/include/__functional/greater.h --- a/libcxx/include/__functional/greater.h +++ b/libcxx/include/__functional/greater.h @@ -12,7 +12,6 @@ #include <__config> #include <__functional/binary_function.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -50,9 +49,9 @@ template _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY auto operator()(_T1&& __t, _T2&& __u) const - _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u))) - -> decltype (_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u)) - { return _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u); } + _NOEXCEPT_(noexcept(static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u))) + -> decltype (static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u)) + { return static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u); } typedef void is_transparent; }; #endif diff --git a/libcxx/include/__functional/greater_equal.h b/libcxx/include/__functional/greater_equal.h --- a/libcxx/include/__functional/greater_equal.h +++ b/libcxx/include/__functional/greater_equal.h @@ -12,7 +12,6 @@ #include <__config> #include <__functional/binary_function.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -50,9 +49,9 @@ template _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY auto operator()(_T1&& __t, _T2&& __u) const - _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u))) - -> decltype (_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u)) - { return _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u); } + _NOEXCEPT_(noexcept(static_cast<_T1&&>(__t) >= static_cast<_T2&&>(__u))) + -> decltype (static_cast<_T1&&>(__t) >= static_cast<_T2&&>(__u)) + { return static_cast<_T1&&>(__t) >= static_cast<_T2&&>(__u); } typedef void is_transparent; }; #endif diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h --- a/libcxx/include/__functional/hash.h +++ b/libcxx/include/__functional/hash.h @@ -14,6 +14,7 @@ #include <__tuple> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/pair.h> #include <__utility/swap.h> #include #include diff --git a/libcxx/include/__functional/identity.h b/libcxx/include/__functional/identity.h --- a/libcxx/include/__functional/identity.h +++ b/libcxx/include/__functional/identity.h @@ -11,7 +11,6 @@ #define _LIBCPP___FUNCTIONAL_IDENTITY_H #include <__config> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -25,7 +24,7 @@ template _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept { - return _VSTD::forward<_Tp>(__t); + return static_cast<_Tp&&>(__t); } using is_transparent = void; diff --git a/libcxx/include/__functional/less.h b/libcxx/include/__functional/less.h --- a/libcxx/include/__functional/less.h +++ b/libcxx/include/__functional/less.h @@ -12,7 +12,6 @@ #include <__config> #include <__functional/binary_function.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -50,9 +49,9 @@ template _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY auto operator()(_T1&& __t, _T2&& __u) const - _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))) - -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)) - { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } + _NOEXCEPT_(noexcept(static_cast<_T1&&>(__t) < static_cast<_T2&&>(__u))) + -> decltype (static_cast<_T1&&>(__t) < static_cast<_T2&&>(__u)) + { return static_cast<_T1&&>(__t) < static_cast<_T2&&>(__u); } typedef void is_transparent; }; #endif diff --git a/libcxx/include/__functional/less_equal.h b/libcxx/include/__functional/less_equal.h --- a/libcxx/include/__functional/less_equal.h +++ b/libcxx/include/__functional/less_equal.h @@ -12,7 +12,6 @@ #include <__config> #include <__functional/binary_function.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -50,9 +49,9 @@ template _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY auto operator()(_T1&& __t, _T2&& __u) const - _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u))) - -> decltype (_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u)) - { return _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u); } + _NOEXCEPT_(noexcept(static_cast<_T1&&>(__t) <= static_cast<_T2&&>(__u))) + -> decltype (static_cast<_T1&&>(__t) <= static_cast<_T2&&>(__u)) + { return static_cast<_T1&&>(__t) <= static_cast<_T2&&>(__u); } typedef void is_transparent; }; #endif diff --git a/libcxx/include/__functional/logical_and.h b/libcxx/include/__functional/logical_and.h --- a/libcxx/include/__functional/logical_and.h +++ b/libcxx/include/__functional/logical_and.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/logical_not.h b/libcxx/include/__functional/logical_not.h --- a/libcxx/include/__functional/logical_not.h +++ b/libcxx/include/__functional/logical_not.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/unary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/logical_or.h b/libcxx/include/__functional/logical_or.h --- a/libcxx/include/__functional/logical_or.h +++ b/libcxx/include/__functional/logical_or.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/mem_fn.h b/libcxx/include/__functional/mem_fn.h --- a/libcxx/include/__functional/mem_fn.h +++ b/libcxx/include/__functional/mem_fn.h @@ -14,7 +14,8 @@ #include <__functional/__weak_result_type.h> #include <__functional/binary_function.h> #include <__functional/invoke.h> -#include +#include <__utility/forward.h> +#include // __invoke #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/minus.h b/libcxx/include/__functional/minus.h --- a/libcxx/include/__functional/minus.h +++ b/libcxx/include/__functional/minus.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/modulus.h b/libcxx/include/__functional/modulus.h --- a/libcxx/include/__functional/modulus.h +++ b/libcxx/include/__functional/modulus.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/multiplies.h b/libcxx/include/__functional/multiplies.h --- a/libcxx/include/__functional/multiplies.h +++ b/libcxx/include/__functional/multiplies.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/negate.h b/libcxx/include/__functional/negate.h --- a/libcxx/include/__functional/negate.h +++ b/libcxx/include/__functional/negate.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/unary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/not_equal_to.h b/libcxx/include/__functional/not_equal_to.h --- a/libcxx/include/__functional/not_equal_to.h +++ b/libcxx/include/__functional/not_equal_to.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/not_fn.h b/libcxx/include/__functional/not_fn.h --- a/libcxx/include/__functional/not_fn.h +++ b/libcxx/include/__functional/not_fn.h @@ -13,7 +13,8 @@ #include <__config> #include <__functional/__perfect_forward.h> #include <__functional/invoke.h> -#include +#include <__utility/forward.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/plus.h b/libcxx/include/__functional/plus.h --- a/libcxx/include/__functional/plus.h +++ b/libcxx/include/__functional/plus.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/binary_function.h> -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/equal_to.h b/libcxx/include/__functional/ranges/equal_to.h --- a/libcxx/include/__functional/ranges/equal_to.h +++ b/libcxx/include/__functional/ranges/equal_to.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/greater.h b/libcxx/include/__functional/ranges/greater.h --- a/libcxx/include/__functional/ranges/greater.h +++ b/libcxx/include/__functional/ranges/greater.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/greater_equal.h b/libcxx/include/__functional/ranges/greater_equal.h --- a/libcxx/include/__functional/ranges/greater_equal.h +++ b/libcxx/include/__functional/ranges/greater_equal.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/less.h b/libcxx/include/__functional/ranges/less.h --- a/libcxx/include/__functional/ranges/less.h +++ b/libcxx/include/__functional/ranges/less.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/less_equal.h b/libcxx/include/__functional/ranges/less_equal.h --- a/libcxx/include/__functional/ranges/less_equal.h +++ b/libcxx/include/__functional/ranges/less_equal.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/ranges/not_equal_to.h b/libcxx/include/__functional/ranges/not_equal_to.h --- a/libcxx/include/__functional/ranges/not_equal_to.h +++ b/libcxx/include/__functional/ranges/not_equal_to.h @@ -12,7 +12,7 @@ #include <__config> #include -#include +#include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/reference_wrapper.h b/libcxx/include/__functional/reference_wrapper.h --- a/libcxx/include/__functional/reference_wrapper.h +++ b/libcxx/include/__functional/reference_wrapper.h @@ -13,6 +13,7 @@ #include <__config> #include <__functional/__weak_result_type.h> #include <__memory/addressof.h> +#include <__utility/declval.h> #include <__utility/forward.h> #include diff --git a/libcxx/include/__functional/search.h b/libcxx/include/__functional/search.h --- a/libcxx/include/__functional/search.h +++ b/libcxx/include/__functional/search.h @@ -12,7 +12,7 @@ #include <__config> #include <__iterator/iterator_traits.h> -#include +#include <__utility/pair.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -13,13 +13,16 @@ #include <__bits> // __libcpp_clz #include <__config> #include <__debug> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/swap.h> #include #include #include #include #include #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h --- a/libcxx/include/__iterator/advance.h +++ b/libcxx/include/__iterator/advance.h @@ -16,11 +16,12 @@ #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> +#include <__utility/declval.h> +#include <__utility/move.h> #include #include #include #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__iterator/incrementable_traits.h b/libcxx/include/__iterator/incrementable_traits.h --- a/libcxx/include/__iterator/incrementable_traits.h +++ b/libcxx/include/__iterator/incrementable_traits.h @@ -11,6 +11,7 @@ #define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H #include <__config> +#include <__utility/declval.h> #include #include diff --git a/libcxx/include/__iterator/iter_move.h b/libcxx/include/__iterator/iter_move.h --- a/libcxx/include/__iterator/iter_move.h +++ b/libcxx/include/__iterator/iter_move.h @@ -12,10 +12,11 @@ #include <__config> #include <__iterator/iterator_traits.h> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> #include // __class_or_enum #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__iterator/iter_swap.h b/libcxx/include/__iterator/iter_swap.h --- a/libcxx/include/__iterator/iter_swap.h +++ b/libcxx/include/__iterator/iter_swap.h @@ -15,6 +15,9 @@ #include <__iterator/iterator_traits.h> #include <__iterator/readable_traits.h> #include <__ranges/access.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/__iterator/iterator_traits.h b/libcxx/include/__iterator/iterator_traits.h --- a/libcxx/include/__iterator/iterator_traits.h +++ b/libcxx/include/__iterator/iterator_traits.h @@ -13,6 +13,8 @@ #include <__config> #include <__iterator/incrementable_traits.h> #include <__iterator/readable_traits.h> +#include <__utility/declval.h> +#include <__utility/pair.h> #include #include diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -14,7 +14,6 @@ #include <__config> #include #include -#include #include #include #include diff --git a/libcxx/include/__memory/allocation_guard.h b/libcxx/include/__memory/allocation_guard.h --- a/libcxx/include/__memory/allocation_guard.h +++ b/libcxx/include/__memory/allocation_guard.h @@ -12,8 +12,8 @@ #include <__config> #include <__memory/allocator_traits.h> +#include <__utility/move.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h --- a/libcxx/include/__memory/allocator_traits.h +++ b/libcxx/include/__memory/allocator_traits.h @@ -13,6 +13,7 @@ #include <__config> #include <__memory/construct_at.h> #include <__memory/pointer_traits.h> +#include <__utility/declval.h> #include <__utility/forward.h> #include #include diff --git a/libcxx/include/__memory/compressed_pair.h b/libcxx/include/__memory/compressed_pair.h --- a/libcxx/include/__memory/compressed_pair.h +++ b/libcxx/include/__memory/compressed_pair.h @@ -12,9 +12,11 @@ #include <__config> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> #include // needed in c++03 for some constructors #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/construct_at.h b/libcxx/include/__memory/construct_at.h --- a/libcxx/include/__memory/construct_at.h +++ b/libcxx/include/__memory/construct_at.h @@ -12,8 +12,8 @@ #include <__config> #include <__debug> +#include <__utility/declval.h> #include <__utility/forward.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h --- a/libcxx/include/__memory/pointer_traits.h +++ b/libcxx/include/__memory/pointer_traits.h @@ -12,6 +12,7 @@ #include <__config> #include <__memory/addressof.h> +#include <__utility/declval.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__memory/raw_storage_iterator.h b/libcxx/include/__memory/raw_storage_iterator.h --- a/libcxx/include/__memory/raw_storage_iterator.h +++ b/libcxx/include/__memory/raw_storage_iterator.h @@ -12,9 +12,9 @@ #include <__config> #include <__memory/addressof.h> +#include <__utility/move.h> #include #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -22,14 +22,17 @@ #include <__memory/compressed_pair.h> #include <__memory/pointer_traits.h> #include <__memory/unique_ptr.h> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/swap.h> #include #include // abort #include #include #include #include -#include #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) # include #endif diff --git a/libcxx/include/__memory/temporary_buffer.h b/libcxx/include/__memory/temporary_buffer.h --- a/libcxx/include/__memory/temporary_buffer.h +++ b/libcxx/include/__memory/temporary_buffer.h @@ -11,9 +11,9 @@ #define _LIBCPP___MEMORY_TEMPORARY_BUFFER_H #include <__config> +#include <__utility/pair.h> #include #include -#include // pair #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h --- a/libcxx/include/__memory/uninitialized_algorithms.h +++ b/libcxx/include/__memory/uninitialized_algorithms.h @@ -13,8 +13,10 @@ #include <__config> #include <__memory/addressof.h> #include <__memory/construct_at.h> +#include <__utility/move.h> +#include <__utility/pair.h> #include -#include + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h --- a/libcxx/include/__memory/unique_ptr.h +++ b/libcxx/include/__memory/unique_ptr.h @@ -16,9 +16,9 @@ #include <__memory/allocator_traits.h> // __pointer #include <__memory/compressed_pair.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #include -#include #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) # include <__memory/auto_ptr.h> diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base --- a/libcxx/include/__mutex_base +++ b/libcxx/include/__mutex_base @@ -12,6 +12,8 @@ #include <__config> #include <__threading_support> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -12,6 +12,8 @@ #include <__config> #include <__debug> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include diff --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h --- a/libcxx/include/__ranges/access.h +++ b/libcxx/include/__ranges/access.h @@ -14,7 +14,10 @@ #include <__iterator/readable_traits.h> #include <__ranges/enable_borrowed_range.h> #include <__utility/__decay_copy.h> +#include <__utility/as_const.h> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h --- a/libcxx/include/__ranges/concepts.h +++ b/libcxx/include/__ranges/concepts.h @@ -20,6 +20,7 @@ #include <__ranges/data.h> #include <__ranges/enable_view.h> #include <__ranges/size.h> +#include <__utility/declval.h> #include #include diff --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h --- a/libcxx/include/__ranges/drop_view.h +++ b/libcxx/include/__ranges/drop_view.h @@ -15,6 +15,8 @@ #include <__ranges/access.h> #include <__ranges/view_interface.h> #include <__ranges/all.h> +#include <__utility/declval.h> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/__ranges/ref_view.h b/libcxx/include/__ranges/ref_view.h --- a/libcxx/include/__ranges/ref_view.h +++ b/libcxx/include/__ranges/ref_view.h @@ -20,6 +20,8 @@ #include <__ranges/empty.h> #include <__ranges/size.h> #include <__ranges/view_interface.h> +#include <__utility/declval.h> +#include <__utility/forward.h> #include #include diff --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h --- a/libcxx/include/__ranges/size.h +++ b/libcxx/include/__ranges/size.h @@ -14,6 +14,7 @@ #include <__iterator/iterator_traits.h> #include <__ranges/access.h> #include <__utility/__decay_copy.h> +#include <__utility/declval.h> #include <__utility/forward.h> #include #include diff --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -20,6 +20,8 @@ #include <__ranges/size.h> #include <__ranges/subrange.h> #include <__ranges/view_interface.h> +#include <__tuple> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/__ranges/view_interface.h b/libcxx/include/__ranges/view_interface.h --- a/libcxx/include/__ranges/view_interface.h +++ b/libcxx/include/__ranges/view_interface.h @@ -10,6 +10,7 @@ #define _LIBCPP___RANGES_VIEW_INTERFACE_H #include <__config> +#include <__debug> #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__iterator/prev.h> @@ -18,6 +19,7 @@ #include <__ranges/concepts.h> #include <__ranges/empty.h> #include <__ranges/enable_view.h> +#include <__utility/declval.h> #include #include diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -3,7 +3,9 @@ #define _LIBCPP_SPLIT_BUFFER #include <__config> +#include <__utility/move.h> #include <__utility/forward.h> +#include <__utility/swap.h> #include #include diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -12,6 +12,9 @@ #include <__config> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/__tuple b/libcxx/include/__tuple --- a/libcxx/include/__tuple +++ b/libcxx/include/__tuple @@ -190,6 +190,8 @@ // pair specializations +template struct _LIBCPP_TEMPLATE_VIS pair; + template struct __tuple_like > : true_type {}; template diff --git a/libcxx/include/__utility/integer_sequence.h b/libcxx/include/__utility/integer_sequence.h --- a/libcxx/include/__utility/integer_sequence.h +++ b/libcxx/include/__utility/integer_sequence.h @@ -10,6 +10,7 @@ #define _LIBCPP___UTILITY_INTEGER_SEQUENCE_H #include <__config> +#include <__tuple> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -652,12 +652,10 @@ #include #include #include -#include // needed to provide swap_ranges. #include #include #include #include -#include // swap_ranges #include #include <__algorithm/adjacent_find.h> diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -83,6 +83,8 @@ #include <__availability> #include <__config> #include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> #include #include #include diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -111,12 +111,13 @@ #include <__config> #include <__debug> #include <__tuple> +#include <__utility/integer_sequence.h> +#include <__utility/move.h> #include #include // for _LIBCPP_UNREACHABLE #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -47,6 +47,7 @@ #include <__availability> #include <__config> +#include <__utility/move.h> #include #ifndef _LIBCPP_HAS_NO_TREE_BARRIER # include diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -76,6 +76,7 @@ #include <__availability> #include <__config> #include <__errc> +#include <__utility/declval.h> #include <__utility/to_underlying.h> #include // for log2f #include diff --git a/libcxx/include/concepts b/libcxx/include/concepts --- a/libcxx/include/concepts +++ b/libcxx/include/concepts @@ -131,8 +131,9 @@ #include <__config> #include <__functional/invoke.h> +#include <__utility/declval.h> +#include <__utility/exchange.h> #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -211,7 +212,7 @@ is_lvalue_reference_v<_Lhs> && common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> && requires (_Lhs __lhs, _Rhs&& __rhs) { - { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>; + { __lhs = static_cast<_Rhs&&>(__rhs) } -> same_as<_Lhs>; }; // [concept.destructible] @@ -262,7 +263,7 @@ concept __unqualified_swappable_with = (__class_or_enum> || __class_or_enum>) && requires(_Tp&& __t, _Up&& __u) { - swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); + swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); }; struct __fn; @@ -287,9 +288,9 @@ template requires __unqualified_swappable_with<_Tp, _Up> constexpr void operator()(_Tp&& __t, _Up&& __u) const - noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + noexcept(noexcept(swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)))) { - swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); + swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); } // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and... @@ -309,7 +310,7 @@ constexpr void operator()(_Tp& __x, _Tp& __y) const noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>) { - __y = _VSTD::exchange(__x, _VSTD::move(__y)); + __y = _VSTD::exchange(__x, static_cast<_Tp&&>(__y)); } }; } // namespace ranges::__swap @@ -325,10 +326,10 @@ concept swappable_with = common_reference_with<_Tp, _Up> && requires(_Tp&& __t, _Up&& __u) { - ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t)); - ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u)); - ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); - ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t)); + ranges::swap(static_cast<_Tp&&>(__t), static_cast<_Tp&&>(__t)); + ranges::swap(static_cast<_Up&&>(__u), static_cast<_Up&&>(__u)); + ranges::swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); + ranges::swap(static_cast<_Up&&>(__u), static_cast<_Tp&&>(__t)); }; // [concept.booleantestable] @@ -337,7 +338,7 @@ template concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) { - { !std::forward<_Tp>(__t) } -> __boolean_testable_impl; + { !static_cast<_Tp&&>(__t) } -> __boolean_testable_impl; }; // [concept.equalitycomparable] @@ -416,7 +417,7 @@ // [concept.invocable] template concept invocable = requires(_Fn&& __fn, _Args&&... __args) { - _VSTD::invoke(_VSTD::forward<_Fn>(__fn), _VSTD::forward<_Args>(__args)...); // not required to be equality preserving + _VSTD::invoke(static_cast<_Fn&&>(__fn), static_cast<_Args&&>(__args)...); // not required to be equality preserving }; // [concept.regular.invocable] diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -108,6 +108,7 @@ #include <__config> #include <__mutex_base> +#include <__utility/move.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -164,6 +164,8 @@ #include <__debug> #include <__split_buffer> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource --- a/libcxx/include/experimental/memory_resource +++ b/libcxx/include/experimental/memory_resource @@ -72,7 +72,6 @@ #include #include <__tuple> #include -#include #include #include #include <__debug> diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const --- a/libcxx/include/experimental/propagate_const +++ b/libcxx/include/experimental/propagate_const @@ -114,7 +114,6 @@ #if _LIBCPP_STD_VER > 11 #include -#include #include _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -203,6 +203,7 @@ #include <__config> #include <__hash_table> +#include <__utility/pair.h> #include #include #include diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -194,6 +194,7 @@ #include <__config> #include <__hash_table> +#include <__utility/pair.h> #include #include diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem --- a/libcxx/include/filesystem +++ b/libcxx/include/filesystem @@ -233,6 +233,7 @@ #include <__config> #include <__debug> #include <__utility/forward.h> +#include <__utility/move.h> #include #include #include @@ -244,7 +245,6 @@ #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -181,6 +181,8 @@ #include <__config> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -183,6 +183,8 @@ #include <__config> #include <__debug> #include <__locale> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -538,7 +538,6 @@ #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -368,12 +368,15 @@ #include <__memory/uses_allocator.h> #include <__utility/__decay_copy.h> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include #include #include #include +#include // __invoke #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -212,6 +212,7 @@ #include <__config> #include <__locale> +#include <__utility/swap.h> #include #include diff --git a/libcxx/include/istream b/libcxx/include/istream --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -159,7 +159,10 @@ */ #include <__config> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -569,7 +569,9 @@ #include <__iterator/readable_traits.h> #include <__memory/addressof.h> #include <__memory/pointer_traits.h> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #include // Mandated by the Standard. #include diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -183,6 +183,8 @@ #include <__config> #include <__debug> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -190,6 +190,7 @@ #include <__config> #include <__debug> #include <__locale> +#include <__utility/move.h> #include #ifndef __APPLE__ # include diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -495,13 +495,16 @@ #include <__node_handle> #include <__tree> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> +#include <__utility/swap.h> #include #include #include #include // __libcpp_erase_if_container #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -683,6 +683,9 @@ #include <__memory/uninitialized_algorithms.h> #include <__memory/unique_ptr.h> #include <__memory/uses_allocator.h> +#include <__utility/declval.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include @@ -694,7 +697,6 @@ #include #include #include -#include #include #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -190,14 +190,17 @@ #include <__mutex_base> #include <__threading_support> #include <__utility/forward.h> +#include <__utility/move.h> #include #include #include #ifndef _LIBCPP_CXX03_LANG # include #endif +#include // __invoke #include + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/numeric b/libcxx/include/numeric --- a/libcxx/include/numeric +++ b/libcxx/include/numeric @@ -146,6 +146,7 @@ #include <__config> #include <__debug> +#include <__utility/move.h> #include // for isnormal #include #include diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -149,13 +149,17 @@ #include <__availability> #include <__config> #include <__debug> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -134,6 +134,8 @@ */ #include <__config> +#include <__utility/declval.h> +#include <__utility/move.h> #include #include #include diff --git a/libcxx/include/queue b/libcxx/include/queue --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -181,6 +181,8 @@ #include <__config> #include <__memory/uses_allocator.h> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/random b/libcxx/include/random --- a/libcxx/include/random +++ b/libcxx/include/random @@ -1679,6 +1679,8 @@ #include <__config> #include <__random/uniform_int_distribution.h> +#include <__utility/move.h> +#include <__utility/swap.h> #include #include #include diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -766,6 +766,9 @@ #include <__debug> #include <__functional/search.h> #include <__locale> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/swap.h> #include #include #include @@ -773,7 +776,6 @@ #include #include #include -#include #include #include diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -106,7 +106,11 @@ */ #include <__config> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> #include #include diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -439,6 +439,8 @@ #include <__node_handle> #include <__tree> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> #include #include #include diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -131,6 +131,7 @@ #include <__debug> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> +#include <__utility/declval.h> #include // for array #include // for byte #include // for iterators diff --git a/libcxx/include/sstream b/libcxx/include/sstream --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -181,6 +181,7 @@ */ #include <__config> +#include <__utility/move.h> #include #include #include diff --git a/libcxx/include/stack b/libcxx/include/stack --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -90,6 +90,7 @@ #include <__config> #include <__memory/uses_allocator.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -515,6 +515,7 @@ #include <__config> #include <__debug> +#include <__utility/move.h> #include #include #include // EOF @@ -527,7 +528,6 @@ #include #include #include -#include #include #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS diff --git a/libcxx/include/strstream b/libcxx/include/strstream --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -130,6 +130,7 @@ */ #include <__config> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -88,6 +88,7 @@ #include <__threading_support> #include <__utility/__decay_copy.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #include #include diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -154,12 +154,14 @@ #include <__memory/allocator_arg_t.h> #include <__memory/uses_allocator.h> #include <__tuple> +#include <__utility/declval.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -417,6 +417,7 @@ */ #include <__config> +#include <__utility/declval.h> #include #include @@ -1363,17 +1364,6 @@ template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; #endif -// Suppress deprecation notice for volatile-qualified return type resulting -// from volatile-qualified types _Tp. -_LIBCPP_SUPPRESS_DEPRECATED_PUSH -template _Tp&& __declval(int); -template _Tp __declval(long); -_LIBCPP_SUPPRESS_DEPRECATED_POP - -template -decltype(__declval<_Tp>(0)) -declval() _NOEXCEPT; - // __uncvref template diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -437,6 +437,9 @@ #include <__hash_table> #include <__node_handle> #include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> #include #include #include // __libcpp_erase_if_container diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -391,7 +391,10 @@ #include <__functional/__is_transparent.h> #include <__hash_table> #include <__node_handle> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/pair.h> +#include <__utility/move.h> #include #include #include // __libcpp_erase_if_container diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -201,7 +201,11 @@ #include <__availability> #include <__config> +#include <__utility/declval.h> #include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/integer_sequence.h> +#include <__utility/move.h> #include <__tuple> #include #include @@ -212,7 +216,6 @@ #include #include #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -276,6 +276,7 @@ #include <__debug> #include <__split_buffer> #include <__utility/forward.h> +#include <__utility/move.h> #include #include #include diff --git a/libcxx/test/std/ranges/range.access/range.prim/empty.pass.cpp b/libcxx/test/std/ranges/range.access/range.prim/empty.pass.cpp --- a/libcxx/test/std/ranges/range.access/range.prim/empty.pass.cpp +++ b/libcxx/test/std/ranges/range.access/range.prim/empty.pass.cpp @@ -15,6 +15,8 @@ #include #include +#include + #include "test_macros.h" #include "test_iterators.h"