33 #include <bits/c++config.h>
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Tp>
47 __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
49 return reinterpret_cast<_Tp*
>
50 (&
const_cast<char&
>(
reinterpret_cast<const volatile char&
>(__r)));
53 _GLIBCXX_END_NAMESPACE_VERSION
56 #if __cplusplus >= 201103L
57 #include <type_traits>
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
74 template<
typename _Tp>
76 forward(
typename std::remove_reference<_Tp>::type& __t) noexcept
77 {
return static_cast<_Tp&&
>(__t); }
85 template<
typename _Tp>
87 forward(
typename std::remove_reference<_Tp>::type&& __t) noexcept
89 static_assert(!std::is_lvalue_reference<_Tp>::value,
"template argument"
90 " substituting _Tp is an lvalue reference type");
91 return static_cast<_Tp&&
>(__t);
99 template<
typename _Tp>
100 constexpr
typename std::remove_reference<_Tp>::type&&
101 move(_Tp&& __t) noexcept
102 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
105 template<
typename _Tp>
106 struct __move_if_noexcept_cond
107 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
108 is_copy_constructible<_Tp>>::type { };
118 template<
typename _Tp>
119 inline constexpr
typename
120 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
121 move_if_noexcept(_Tp& __x) noexcept
122 {
return std::move(__x); }
133 template<
typename _Tp>
135 addressof(_Tp& __r) noexcept
136 {
return std::__addressof(__r); }
139 _GLIBCXX_END_NAMESPACE_VERSION
142 #define _GLIBCXX_MOVE(__val) std::move(__val)
143 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
145 #define _GLIBCXX_MOVE(__val) (__val)
146 #define _GLIBCXX_FORWARD(_Tp, __val) (__val)
151 _GLIBCXX_BEGIN_NAMESPACE_VERSION
164 template<
typename _Tp>
166 swap(_Tp& __a, _Tp& __b)
167 #if __cplusplus >= 201103L
168 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
169 is_nothrow_move_assignable<_Tp>>::value)
183 template<
typename _Tp,
size_t _Nm>
185 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
186 #if __cplusplus >= 201103L
187 noexcept(noexcept(
swap(*__a, *__b)))
190 for (
size_t __n = 0; __n < _Nm; ++__n)
191 swap(__a[__n], __b[__n]);
195 _GLIBCXX_END_NAMESPACE_VERSION
#define __glibcxx_function_requires(...)
Definition: concept_check.h:47
#define _GLIBCXX_MOVE(__val)
Definition: move.h:145
namespace std _GLIBCXX_VISIBILITY(default)
Definition: move.h:36
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160