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*
53 {
return __builtin_addressof(__r); }
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 template<
typename _Tp,
typename _Up>
95 template<
typename _Tp,
typename _Up>
96 struct __like_impl<_Tp&, _Up&>
97 {
using type = _Up&; };
99 template<
typename _Tp,
typename _Up>
100 struct __like_impl<const _Tp&, _Up&>
101 {
using type =
const _Up&; };
103 template<
typename _Tp,
typename _Up>
104 struct __like_impl<_Tp&&, _Up&>
105 {
using type = _Up&&; };
107 template<
typename _Tp,
typename _Up>
108 struct __like_impl<const _Tp&&, _Up&>
109 {
using type =
const _Up&&; };
111 template<
typename _Tp,
typename _Up>
112 using __like_t =
typename __like_impl<_Tp&&, _Up&>::type;
114#if __glibcxx_forward_like
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*
177 {
return __builtin_addressof(__r); }
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>
218#if __glibcxx_concepts
219 requires (! __is_tuple_like<_Tp>::value)
220 && is_move_constructible_v<_Tp>
221 && is_move_assignable_v<_Tp>
223#elif __cplusplus >= 201103L
224 _GLIBCXX20_CONSTEXPR
inline
225 __enable_if_t<__and_<__not_<__is_tuple_like<_Tp>>,
231 swap(_Tp& __a, _Tp& __b)
235#if __cplusplus < 201103L
237 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
239 _Tp __tmp = _GLIBCXX_MOVE(__a);
240 __a = _GLIBCXX_MOVE(__b);
241 __b = _GLIBCXX_MOVE(__tmp);
247 template<
typename _Tp,
size_t _Nm>
248#if __glibcxx_concepts
249 requires is_swappable_v<_Tp>
251#elif __cplusplus >= 201103L
252 _GLIBCXX20_CONSTEXPR
inline
253 __enable_if_t<__is_swappable<_Tp>::value>
257 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
258 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Tp>::value)
260 for (
size_t __n = 0; __n < _Nm; ++__n)
261 swap(__a[__n], __b[__n]);
265_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