34#if __cplusplus < 201103L
40namespace std _GLIBCXX_VISIBILITY(default)
42_GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<
typename _Tp>
50 __attribute__((__always_inline__))
51 inline _GLIBCXX_CONSTEXPR _Tp*
55#if __cplusplus >= 201103L
69 template<
typename _Tp>
70 [[__nodiscard__,__gnu__::__always_inline__]]
72 forward(
typename std::remove_reference<_Tp>::type& __t)
noexcept
73 {
return static_cast<_Tp&&
>(__t); }
82 template<
typename _Tp>
83 [[__nodiscard__,__gnu__::__always_inline__]]
85 forward(
typename std::remove_reference<_Tp>::type&& __t)
noexcept
88 "std::forward must not be used to convert an rvalue to an lvalue");
89 return static_cast<_Tp&&
>(__t);
92#if __glibcxx_forward_like
93 template<
typename _Tp,
typename _Up>
96 template<
typename _Tp,
typename _Up>
97 struct __like_impl<_Tp&, _Up&>
98 {
using type = _Up&; };
100 template<
typename _Tp,
typename _Up>
101 struct __like_impl<const _Tp&, _Up&>
102 {
using type =
const _Up&; };
104 template<
typename _Tp,
typename _Up>
105 struct __like_impl<_Tp&&, _Up&>
106 {
using type = _Up&&; };
108 template<
typename _Tp,
typename _Up>
109 struct __like_impl<const _Tp&&, _Up&>
110 {
using type =
const _Up&&; };
112 template<
typename _Tp,
typename _Up>
113 using __like_t =
typename __like_impl<_Tp&&, _Up&>::type;
122 template<
typename _Tp,
typename _Up>
123 [[nodiscard,__gnu__::__always_inline__]]
124 constexpr __like_t<_Tp, _Up>
125 forward_like(_Up&& __x)
noexcept
126 {
return static_cast<__like_t<_Tp, _Up>
>(__x); }
135 template<
typename _Tp>
136 [[__nodiscard__,__gnu__::__always_inline__]]
137 constexpr typename std::remove_reference<_Tp>::type&&
139 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
142 template<
typename _Tp>
143 struct __move_if_noexcept_cond
144 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
145 is_copy_constructible<_Tp>>::type { };
156 template<
typename _Tp>
157 [[__nodiscard__,__gnu__::__always_inline__]]
159 __conditional_t<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>
173 template<
typename _Tp>
174 [[__nodiscard__,__gnu__::__always_inline__]]
175 inline _GLIBCXX17_CONSTEXPR _Tp*
181 template<
typename _Tp>
182 const _Tp*
addressof(
const _Tp&&) =
delete;
185 template <
typename _Tp,
typename _Up = _Tp>
188 __exchange(_Tp& __obj, _Up&& __new_val)
197#define _GLIBCXX_FWDREF(_Tp) _Tp&&
198#define _GLIBCXX_MOVE(__val) std::move(__val)
199#define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
201#define _GLIBCXX_FWDREF(_Tp) const _Tp&
202#define _GLIBCXX_MOVE(__val) (__val)
203#define _GLIBCXX_FORWARD(_Tp, __val) (__val)
217 template<
typename _Tp>
220#if __cplusplus >= 201103L
221 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
222 is_move_constructible<_Tp>,
223 is_move_assignable<_Tp>>::value>::type
227 swap(_Tp& __a, _Tp& __b)
231#if __cplusplus < 201103L
235 _Tp
__tmp = _GLIBCXX_MOVE(__a);
236 __a = _GLIBCXX_MOVE(__b);
237 __b = _GLIBCXX_MOVE(
__tmp);
243 template<
typename _Tp,
size_t _Nm>
246#if __cplusplus >= 201103L
247 typename enable_if<__is_swappable<_Tp>::value>::type
254 for (
size_t __n = 0; __n <
_Nm; ++__n)
255 swap(__a[__n], __b[__n]);
259_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.