36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Tp>
49 return reinterpret_cast<_Tp*
>
50 (&
const_cast<char&
>(
reinterpret_cast<const volatile char&
>(__r)));
53 _GLIBCXX_END_NAMESPACE_VERSION
56 #ifdef __GXX_EXPERIMENTAL_CXX0X__
57 #include <type_traits>
59 namespace std _GLIBCXX_VISIBILITY(default)
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
75 template<
typename _Tp>
77 forward(
typename std::remove_reference<_Tp>::type& __t) noexcept
78 {
return static_cast<_Tp&&
>(__t); }
86 template<
typename _Tp>
88 forward(
typename std::remove_reference<_Tp>::type&& __t) noexcept
90 static_assert(!std::is_lvalue_reference<_Tp>::value,
"template argument"
91 " substituting _Tp is an lvalue reference type");
92 return static_cast<_Tp&&
>(__t);
100 template<
typename _Tp>
101 constexpr
typename std::remove_reference<_Tp>::type&&
103 {
return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t); }
106 template<
typename _Tp>
107 struct __move_if_noexcept_cond
108 :
public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
109 is_copy_constructible<_Tp>>::type { };
119 template<
typename _Tp>
121 conditional<__move_if_noexcept_cond<_Tp>::value,
const _Tp&, _Tp&&>::type
134 template<
typename _Tp>
140 _GLIBCXX_END_NAMESPACE_VERSION
143 #define _GLIBCXX_MOVE(__val) std::move(__val)
144 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
146 #define _GLIBCXX_MOVE(__val) (__val)
147 #define _GLIBCXX_FORWARD(_Tp, __val) (__val)
150 namespace std _GLIBCXX_VISIBILITY(default)
152 _GLIBCXX_BEGIN_NAMESPACE_VERSION
165 template<
typename _Tp>
168 #ifdef __GXX_EXPERIMENTAL_CXX0X__
169 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
170 is_nothrow_move_assignable<_Tp>>::value)
174 __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
176 _Tp __tmp = _GLIBCXX_MOVE(__a);
177 __a = _GLIBCXX_MOVE(__b);
178 __b = _GLIBCXX_MOVE(__tmp);
184 template<
typename _Tp,
size_t _Nm>
186 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
187 #ifdef __GXX_EXPERIMENTAL_CXX0X__
188 noexcept(noexcept(
swap(*__a, *__b)))
191 for (
size_t __n = 0; __n < _Nm; ++__n)
192 swap(__a[__n], __b[__n]);
196 _GLIBCXX_END_NAMESPACE_VERSION
_Tp * __addressof(_Tp &__r) _GLIBCXX_NOEXCEPT
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
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 && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_Tp * addressof(_Tp &__r) noexcept
Returns the actual address of the object or function referenced by r, even in the presence of an over...
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.