36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Tp>
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>
59 namespace std _GLIBCXX_VISIBILITY(default)
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&&
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
133 template<
typename _Tp>
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)
149 namespace std _GLIBCXX_VISIBILITY(default)
151 _GLIBCXX_BEGIN_NAMESPACE_VERSION
164 template<
typename _Tp>
167 #if __cplusplus >= 201103L
168 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
169 is_nothrow_move_assignable<_Tp>>::value)
173 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
175 _Tp __tmp = _GLIBCXX_MOVE(__a);
176 __a = _GLIBCXX_MOVE(__b);
177 __b = _GLIBCXX_MOVE(__tmp);
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
constexpr conditional< __move_if_noexcept_cond< _Tp >::value, const _Tp &, _Tp && >::type move_if_noexcept(_Tp &__x) noexcept
Conditionally convert a value to an rvalue.
_Tp * addressof(_Tp &__r) noexcept
Returns the actual address of the object or function referenced by r, even in the presence of an over...
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.