36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Tp>
46 inline _GLIBCXX_CONSTEXPR _Tp*
48 {
return __builtin_addressof(__r); }
50 #if __cplusplus >= 201103L 52 _GLIBCXX_END_NAMESPACE_VERSION
57 namespace std _GLIBCXX_VISIBILITY(default)
59 _GLIBCXX_BEGIN_NAMESPACE_VERSION
72 template<
typename _Tp>
74 forward(
typename std::remove_reference<_Tp>::type& __t) noexcept
75 {
return static_cast<_Tp&&
>(__t); }
83 template<
typename _Tp>
85 forward(
typename std::remove_reference<_Tp>::type&& __t) noexcept
88 " substituting _Tp is an lvalue reference type");
89 return static_cast<_Tp&&
>(__t);
97 template<
typename _Tp>
98 constexpr
typename std::remove_reference<_Tp>::type&&
99 move(_Tp&& __t) noexcept
100 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
103 template<
typename _Tp>
104 struct __move_if_noexcept_cond
105 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
106 is_copy_constructible<_Tp>>::type { };
116 template<
typename _Tp>
118 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
120 {
return std::move(__x); }
124 #if __cplusplus > 201402L 127 # define __cpp_lib_addressof_constexpr 201603 136 template<
typename _Tp>
137 inline _GLIBCXX17_CONSTEXPR _Tp*
143 template<
typename _Tp>
144 const _Tp*
addressof(
const _Tp&&) =
delete;
147 template <
typename _Tp,
typename _Up = _Tp>
149 __exchange(_Tp& __obj, _Up&& __new_val)
151 _Tp __old_val = std::move(__obj);
152 __obj = std::forward<_Up>(__new_val);
158 #define _GLIBCXX_MOVE(__val) std::move(__val) 159 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val) 161 #define _GLIBCXX_MOVE(__val) (__val) 162 #define _GLIBCXX_FORWARD(_Tp, __val) (__val) 176 template<
typename _Tp>
178 #if __cplusplus >= 201103L 179 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
180 is_move_constructible<_Tp>,
181 is_move_assignable<_Tp>>::value>::type
182 swap(_Tp& __a, _Tp& __b)
187 swap(_Tp& __a, _Tp& __b)
191 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
193 _Tp __tmp = _GLIBCXX_MOVE(__a);
194 __a = _GLIBCXX_MOVE(__b);
195 __b = _GLIBCXX_MOVE(__tmp);
201 template<
typename _Tp,
size_t _Nm>
203 #if __cplusplus >= 201103L 204 typename enable_if<__is_swappable<_Tp>::value>::type
205 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
206 noexcept(__is_nothrow_swappable<_Tp>::value)
209 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
212 for (
size_t __n = 0; __n < _Nm; ++__n)
213 swap(__a[__n], __b[__n]);
217 _GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
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.
is_nothrow_move_constructible
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
is_nothrow_move_assignable
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
_GLIBCXX17_CONSTEXPR _Tp * addressof(_Tp &__r) noexcept
Returns the actual address of the object or function referenced by r, even in the presence of an over...