diff options
Diffstat (limited to 'libcxx/include/utility')
| -rw-r--r-- | libcxx/include/utility | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/libcxx/include/utility b/libcxx/include/utility index 7a1a45e334a3..a4d8cf853d20 100644 --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -42,6 +42,10 @@ swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b))); template <class T> T&& forward(typename remove_reference<T>::type& t) noexcept; // constexpr in C++14 template <class T> T&& forward(typename remove_reference<T>::type&& t) noexcept; // constexpr in C++14 +template <typename T> +[[nodiscard]] constexpr +auto forward_like(auto&& x) noexcept -> see below; // since C++23 + template <class T> typename remove_reference<T>::type&& move(T&&) noexcept; // constexpr in C++14 template <class T> @@ -80,19 +84,29 @@ struct pair explicit(see-below) constexpr pair(); explicit(see-below) pair(const T1& x, const T2& y); // constexpr in C++14 template <class U = T1, class V = T2> explicit(see-below) pair(U&&, V&&); // constexpr in C++14 + template <class U, class V> constexpr explicit(see below) pair(pair<U, V>&); // since C++23 template <class U, class V> explicit(see-below) pair(const pair<U, V>& p); // constexpr in C++14 template <class U, class V> explicit(see-below) pair(pair<U, V>&& p); // constexpr in C++14 + template <class U, class V> + constexpr explicit(see below) pair(const pair<U, V>&&); // since C++23 template <class... Args1, class... Args2> pair(piecewise_construct_t, tuple<Args1...> first_args, tuple<Args2...> second_args); // constexpr in C++20 + constexpr const pair& operator=(const pair& p) const; // since C++23 template <class U, class V> pair& operator=(const pair<U, V>& p); // constexpr in C++20 + template <class U, class V> + constexpr const pair& operator=(const pair<U, V>& p) const; // since C++23 pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable<T1>::value && is_nothrow_move_assignable<T2>::value); // constexpr in C++20 + constexpr const pair& operator=(pair&& p) const; // since C++23 template <class U, class V> pair& operator=(pair<U, V>&& p); // constexpr in C++20 + template <class U, class V> + constexpr const pair& operator=(pair<U, V>&& p) const; // since C++23 void swap(pair& p) noexcept(is_nothrow_swappable_v<T1> && is_nothrow_swappable_v<T2>); // constexpr in C++20 + constexpr void swap(const pair& p) const noexcept(see below); // since C++23 }; template<class T1, class T2, class U1, class U2, template<class> class TQual, template<class> class UQual> @@ -119,6 +133,9 @@ template <class T1, class T2> void swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 +template<class T1, class T2> +constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // since C++23 + struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); @@ -222,13 +239,14 @@ template <class T> #include <__assert> // all public C++ headers provide the assertion handler #include <__config> -#include <__tuple> #include <__utility/as_const.h> #include <__utility/auto_cast.h> #include <__utility/cmp.h> #include <__utility/declval.h> +#include <__utility/exception_guard.h> #include <__utility/exchange.h> #include <__utility/forward.h> +#include <__utility/forward_like.h> #include <__utility/in_place.h> #include <__utility/integer_sequence.h> #include <__utility/move.h> @@ -238,21 +256,27 @@ template <class T> #include <__utility/rel_ops.h> #include <__utility/swap.h> #include <__utility/to_underlying.h> -#include <__utility/transaction.h> #include <__utility/unreachable.h> -#include <type_traits> #include <version> -#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES -# include <iosfwd> -#endif - // standard-mandated includes + +// [utility.syn] #include <compare> #include <initializer_list> +// [tuple.helper] +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_size.h> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include <cstdlib> +# include <iosfwd> +# include <type_traits> +#endif + #endif // _LIBCPP_UTILITY |
