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 _GLIBCXX_END_NAMESPACE_VERSION
53 #if __cplusplus >= 201103L 56 namespace std _GLIBCXX_VISIBILITY(default)
58 _GLIBCXX_BEGIN_NAMESPACE_VERSION
71 template<
typename _Tp>
73 forward(
typename std::remove_reference<_Tp>::type& __t) noexcept
74 {
return static_cast<_Tp&&
>(__t); }
82 template<
typename _Tp>
84 forward(
typename std::remove_reference<_Tp>::type&& __t) noexcept
87 " substituting _Tp is an lvalue reference type");
88 return static_cast<_Tp&&
>(__t);
96 template<
typename _Tp>
97 constexpr
typename std::remove_reference<_Tp>::type&&
98 move(_Tp&& __t) noexcept
99 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
102 template<
typename _Tp>
103 struct __move_if_noexcept_cond
104 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
105 is_copy_constructible<_Tp>>::type { };
115 template<
typename _Tp>
117 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
119 {
return std::move(__x); }
123 #if __cplusplus > 201402L 126 # define __cpp_lib_addressof_constexpr 201603 135 template<
typename _Tp>
136 inline _GLIBCXX17_CONSTEXPR _Tp*
142 template<
typename _Tp>
143 const _Tp*
addressof(
const _Tp&&) =
delete;
146 template <
typename _Tp,
typename _Up = _Tp>
148 __exchange(_Tp& __obj, _Up&& __new_val)
150 _Tp __old_val = std::move(__obj);
151 __obj = std::forward<_Up>(__new_val);
156 _GLIBCXX_END_NAMESPACE_VERSION
159 #define _GLIBCXX_MOVE(__val) std::move(__val) 160 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val) 162 #define _GLIBCXX_MOVE(__val) (__val) 163 #define _GLIBCXX_FORWARD(_Tp, __val) (__val) 166 namespace std _GLIBCXX_VISIBILITY(default)
168 _GLIBCXX_BEGIN_NAMESPACE_VERSION
181 template<
typename _Tp>
183 #if __cplusplus >= 201103L 184 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
185 is_move_constructible<_Tp>,
186 is_move_assignable<_Tp>>::value>::type
187 swap(_Tp& __a, _Tp& __b)
188 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
189 is_nothrow_move_assignable<_Tp>>::value)
192 swap(_Tp& __a, _Tp& __b)
196 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
198 _Tp __tmp = _GLIBCXX_MOVE(__a);
199 __a = _GLIBCXX_MOVE(__b);
200 __b = _GLIBCXX_MOVE(__tmp);
206 template<
typename _Tp,
size_t _Nm>
208 #if __cplusplus >= 201103L 209 typename enable_if<__is_swappable<_Tp>::value>::type
210 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
211 noexcept(__is_nothrow_swappable<_Tp>::value)
214 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
217 for (
size_t __n = 0; __n < _Nm; ++__n)
218 swap(__a[__n], __b[__n]);
222 _GLIBCXX_END_NAMESPACE_VERSION
_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...
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
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.