136 using native_handle_type = thread::native_handle_type;
139 : _M_stop_source{nostopstate}
142 template<
typename _Callable,
typename... _Args,
146 jthread(_Callable&& __f, _Args&&... __args)
151 jthread(
const jthread&) =
delete;
152 jthread(jthread&&)
noexcept =
default;
164 operator=(
const jthread&) =
delete;
167 operator=(jthread&& __other)
noexcept
174 swap(jthread& __other)
noexcept
176 std::swap(_M_stop_source, __other._M_stop_source);
181 joinable()
const noexcept
183 return _M_thread.joinable();
199 get_id()
const noexcept
201 return _M_thread.get_id();
204 [[nodiscard]] native_handle_type
207 return _M_thread.native_handle();
210 [[nodiscard]]
static unsigned
211 hardware_concurrency()
noexcept
213 return thread::hardware_concurrency();
217 get_stop_source()
noexcept
219 return _M_stop_source;
223 get_stop_token()
const noexcept
225 return _M_stop_source.get_token();
228 bool request_stop()
noexcept
230 return _M_stop_source.request_stop();
233 friend void swap(jthread& __lhs, jthread& __rhs)
noexcept
239 template<
typename _Callable,
typename... _Args>
241 _S_create(
stop_source& __ssrc, _Callable&& __f, _Args&&... __args)
243#ifndef __STRICT_ANSI__
244 if constexpr (__pmf_expects_stop_token<_Callable, _Args...>)
248 if constexpr(is_invocable_v<decay_t<_Callable>,
stop_token,
254 static_assert(is_invocable_v<decay_t<_Callable>,
256 "std::jthread arguments must be invocable after"
257 " conversion to rvalues");
263#ifndef __STRICT_ANSI__
264 template<
typename _Callable,
typename _Obj,
typename... _Args>
266 _S_create_pmf(
stop_source& __ssrc, _Callable __f, _Obj&& __obj,
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.