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 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
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>
120 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
122 {
return std::move(__x); }
133 template<
typename _Tp>
139 template <
typename _Tp,
typename _Up = _Tp>
141 __exchange(_Tp& __obj, _Up&& __new_val)
143 _Tp __old_val = std::move(__obj);
144 __obj = std::forward<_Up>(__new_val);
149 _GLIBCXX_END_NAMESPACE_VERSION
152 #define _GLIBCXX_MOVE(__val) std::move(__val) 153 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val) 155 #define _GLIBCXX_MOVE(__val) (__val) 156 #define _GLIBCXX_FORWARD(_Tp, __val) (__val) 159 namespace std _GLIBCXX_VISIBILITY(default)
161 _GLIBCXX_BEGIN_NAMESPACE_VERSION
174 template<
typename _Tp>
176 swap(_Tp& __a, _Tp& __b)
177 #if __cplusplus >= 201103L 178 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
179 is_nothrow_move_assignable<_Tp>>::value)
183 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
185 _Tp __tmp = _GLIBCXX_MOVE(__a);
186 __a = _GLIBCXX_MOVE(__b);
187 __b = _GLIBCXX_MOVE(__tmp);
193 template<
typename _Tp,
size_t _Nm>
195 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
196 #if __cplusplus >= 201103L 197 noexcept(noexcept(swap(*__a, *__b)))
200 for (
size_t __n = 0; __n < _Nm; ++__n)
201 swap(__a[__n], __b[__n]);
205 _GLIBCXX_END_NAMESPACE_VERSION
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
_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 conditional< __move_if_noexcept_cond< _Tp >::value, const _Tp &, _Tp && >::type move_if_noexcept(_Tp &__x) noexcept
Conditionally convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.