aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__utility/exchange.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__utility/exchange.h')
-rw-r--r--libcxx/include/__utility/exchange.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/include/__utility/exchange.h b/libcxx/include/__utility/exchange.h
index d9b3c151755f..8df71a17b1c0 100644
--- a/libcxx/include/__utility/exchange.h
+++ b/libcxx/include/__utility/exchange.h
@@ -10,9 +10,10 @@
#define _LIBCPP___UTILITY_EXCHANGE_H
#include <__config>
+#include <__type_traits/is_nothrow_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER > 11
template<class _T1, class _T2 = _T1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
_T1 exchange(_T1& __obj, _T2&& __new_value)
noexcept(is_nothrow_move_constructible<_T1>::value && is_nothrow_assignable<_T1&, _T2>::value)
{