30#ifndef _GLIBCXX_MOF_CV
31# define _GLIBCXX_MOF_CV
34#ifdef _GLIBCXX_MOF_REF
35# define _GLIBCXX_MOF_INV_QUALS _GLIBCXX_MOF_CV _GLIBCXX_MOF_REF
37# define _GLIBCXX_MOF_REF
38# define _GLIBCXX_MOF_INV_QUALS _GLIBCXX_MOF_CV &
41#define _GLIBCXX_MOF_CV_REF _GLIBCXX_MOF_CV _GLIBCXX_MOF_REF
43namespace std _GLIBCXX_VISIBILITY(default)
45_GLIBCXX_BEGIN_NAMESPACE_VERSION
62 template<
typename _Res,
typename... _ArgTypes,
bool _Noex>
64 _GLIBCXX_MOF_REF noexcept(_Noex)>
67 template<
typename _Tp>
69 = __conditional_t<_Noex,
74 template<
typename _Vt>
75 static constexpr bool __is_callable_from
83 move_only_function() noexcept { }
86 move_only_function(
nullptr_t)
noexcept { }
89 move_only_function(move_only_function&& __x) noexcept
90 : _Mofunc_base(
static_cast<_Mofunc_base&&
>(__x)),
91 _M_invoke(std::__exchange(__x._M_invoke,
nullptr))
95 template<
typename _Fn,
typename _Vt = decay_t<_Fn>>
112 template<
typename _Tp,
typename...
_Args>
113 requires is_constructible_v<_Tp,
_Args...>
117 noexcept(_S_nothrow_init<_Tp,
_Args...>())
125 template<
typename _Tp,
typename _Up,
typename...
_Args>
140 operator=(move_only_function&& __x)
noexcept
142 _Mofunc_base::operator=(
static_cast<_Mofunc_base&&
>(__x));
143 _M_invoke = std::__exchange(__x._M_invoke,
nullptr);
151 _Mofunc_base::operator=(
nullptr);
157 template<
typename _Fn>
167 ~move_only_function() =
default;
170 explicit operator bool() const noexcept {
return _M_invoke !=
nullptr; }
183 __glibcxx_assert(*
this !=
nullptr);
189 swap(move_only_function& __x)
noexcept
191 _Mofunc_base::swap(__x);
192 std::swap(_M_invoke, __x._M_invoke);
197 swap(move_only_function& __x, move_only_function&
__y)
noexcept
202 operator==(
const move_only_function& __x,
nullptr_t)
noexcept
203 {
return __x._M_invoke ==
nullptr; }
206 template<
typename _Tp>
212 template<
typename _Tp>
218 using _TpInv = _Tp _GLIBCXX_MOF_INV_QUALS;
224 _Invoker _M_invoke =
nullptr;
227#undef _GLIBCXX_MOF_CV_REF
228#undef _GLIBCXX_MOF_CV
229#undef _GLIBCXX_MOF_REF
230#undef _GLIBCXX_MOF_INV_QUALS
232_GLIBCXX_END_NAMESPACE_VERSION
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
std::is_nothrow_invocable_r