34#if __cplusplus < 201103L
40namespace std _GLIBCXX_VISIBILITY(default)
42_GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<
typename _Tp>
50 inline _GLIBCXX_CONSTEXPR _Tp*
52 {
return __builtin_addressof(__r); }
54#if __cplusplus >= 201103L
67 template<
typename _Tp>
70 forward(
typename std::remove_reference<_Tp>::type& __t)
noexcept
71 {
return static_cast<_Tp&&
>(__t); }
79 template<
typename _Tp>
82 forward(
typename std::remove_reference<_Tp>::type&& __t)
noexcept
85 "std::forward must not be used to convert an rvalue to an lvalue");
86 return static_cast<_Tp&&
>(__t);
89#if __glibcxx_forward_like
90 template<
typename _Tp,
typename _Up>
93 template<
typename _Tp,
typename _Up>
94 struct __like_impl<_Tp&, _Up&>
95 {
using type = _Up&; };
97 template<
typename _Tp,
typename _Up>
98 struct __like_impl<const _Tp&, _Up&>
99 {
using type =
const _Up&; };
101 template<
typename _Tp,
typename _Up>
102 struct __like_impl<_Tp&&, _Up&>
103 {
using type = _Up&&; };
105 template<
typename _Tp,
typename _Up>
106 struct __like_impl<const _Tp&&, _Up&>
107 {
using type =
const _Up&&; };
109 template<
typename _Tp,
typename _Up>
110 using __like_t =
typename __like_impl<_Tp&&, _Up&>::type;
112 template<
typename _Tp,
typename _Up>
114 constexpr __like_t<_Tp, _Up>
115 forward_like(_Up&& __x)
noexcept
116 {
return static_cast<__like_t<_Tp, _Up>
>(__x); }
124 template<
typename _Tp>
126 constexpr typename std::remove_reference<_Tp>::type&&
128 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
131 template<
typename _Tp>
132 struct __move_if_noexcept_cond
133 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
134 is_copy_constructible<_Tp>>::type { };
144 template<
typename _Tp>
147 __conditional_t<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>
160 template<
typename _Tp>
162 inline _GLIBCXX17_CONSTEXPR _Tp*
168 template<
typename _Tp>
169 const _Tp*
addressof(
const _Tp&&) =
delete;
172 template <
typename _Tp,
typename _Up = _Tp>
175 __exchange(_Tp& __obj, _Up&& __new_val)
178 __obj = std::forward<_Up>(__new_val);
184#define _GLIBCXX_FWDREF(_Tp) _Tp&&
185#define _GLIBCXX_MOVE(__val) std::move(__val)
186#define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
188#define _GLIBCXX_FWDREF(_Tp) const _Tp&
189#define _GLIBCXX_MOVE(__val) (__val)
190#define _GLIBCXX_FORWARD(_Tp, __val) (__val)
204 template<
typename _Tp>
207#if __cplusplus >= 201103L
208 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
209 is_move_constructible<_Tp>,
210 is_move_assignable<_Tp>>::value>::type
214 swap(_Tp& __a, _Tp& __b)
218#if __cplusplus < 201103L
220 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
222 _Tp __tmp = _GLIBCXX_MOVE(__a);
223 __a = _GLIBCXX_MOVE(__b);
224 __b = _GLIBCXX_MOVE(__tmp);
230 template<
typename _Tp,
size_t _Nm>
233#if __cplusplus >= 201103L
234 typename enable_if<__is_swappable<_Tp>::value>::type
238 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
239 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Tp>::value)
241 for (
size_t __n = 0; __n < _Nm; ++__n)
242 swap(__a[__n], __b[__n]);
246_GLIBCXX_END_NAMESPACE_VERSION
constexpr __conditional_t< __move_if_noexcept_cond< _Tp >::value, const _Tp &, _Tp && > 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...
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _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.
ISO C++ entities toplevel namespace is std.
is_nothrow_move_constructible
is_nothrow_move_assignable