34 #if __cplusplus < 201103L
38 namespace std _GLIBCXX_VISIBILITY(default)
40 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _Tp>
48 inline _GLIBCXX_CONSTEXPR _Tp*
50 {
return __builtin_addressof(__r); }
52 #if __cplusplus >= 201103L
54 _GLIBCXX_END_NAMESPACE_VERSION
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 "std::forward must not be used to convert an rvalue to an lvalue");
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>
120 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
126 #if __cplusplus > 201402L
129 # define __cpp_lib_addressof_constexpr 201603
138 template<
typename _Tp>
139 inline _GLIBCXX17_CONSTEXPR _Tp*
145 template<
typename _Tp>
146 const _Tp*
addressof(
const _Tp&&) =
delete;
149 template <
typename _Tp,
typename _Up = _Tp>
152 __exchange(_Tp& __obj, _Up&& __new_val)
155 __obj = std::forward<_Up>(__new_val);
161 #define _GLIBCXX_MOVE(__val) std::move(__val)
162 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
164 #define _GLIBCXX_MOVE(__val) (__val)
165 #define _GLIBCXX_FORWARD(_Tp, __val) (__val)
179 template<
typename _Tp>
182 #if __cplusplus >= 201103L
183 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
184 is_move_constructible<_Tp>,
185 is_move_assignable<_Tp>>::value>::type
189 swap(_Tp& __a, _Tp& __b)
193 #if __cplusplus < 201103L
195 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
197 _Tp __tmp = _GLIBCXX_MOVE(__a);
198 __a = _GLIBCXX_MOVE(__b);
199 __b = _GLIBCXX_MOVE(__tmp);
205 template<
typename _Tp,
size_t _Nm>
208 #if __cplusplus >= 201103L
209 typename enable_if<__is_swappable<_Tp>::value>::type
213 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
214 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Tp>::value)
216 for (
size_t __n = 0; __n < _Nm; ++__n)
217 swap(__a[__n], __b[__n]);
221 _GLIBCXX_END_NAMESPACE_VERSION
constexpr _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.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
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.
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...
ISO C++ entities toplevel namespace is std.
is_nothrow_move_constructible
is_nothrow_move_assignable