138 using native_handle_type = thread::native_handle_type;
141 : _M_stop_source{nostopstate}
144 template<
typename _Callable,
typename... _Args,
148 jthread(_Callable&& __f, _Args&&... __args)
153 jthread(
const jthread&) =
delete;
154 jthread(jthread&&)
noexcept =
default;
166 operator=(
const jthread&) =
delete;
169 operator=(jthread&& __other)
noexcept
176 swap(jthread& __other)
noexcept
178 std::swap(_M_stop_source, __other._M_stop_source);
183 joinable()
const noexcept
185 return _M_thread.joinable();
201 get_id()
const noexcept
203 return _M_thread.get_id();
206 [[nodiscard]] native_handle_type
209 return _M_thread.native_handle();
212 [[nodiscard]]
static unsigned
213 hardware_concurrency()
noexcept
215 return thread::hardware_concurrency();
219 get_stop_source()
noexcept
221 return _M_stop_source;
225 get_stop_token()
const noexcept
227 return _M_stop_source.get_token();
230 bool request_stop()
noexcept
232 return _M_stop_source.request_stop();
235 friend void swap(jthread& __lhs, jthread& __rhs)
noexcept
241 template<
typename _Callable,
typename... _Args>
243 _S_create(
stop_source& __ssrc, _Callable&& __f, _Args&&... __args)
245#ifndef __STRICT_ANSI__
246 if constexpr (__pmf_expects_stop_token<_Callable, _Args...>)
250 if constexpr(is_invocable_v<decay_t<_Callable>,
stop_token,
256 static_assert(is_invocable_v<decay_t<_Callable>,
258 "std::jthread arguments must be invocable after"
259 " conversion to rvalues");
265#ifndef __STRICT_ANSI__
266 template<
typename _Callable,
typename _Obj,
typename... _Args>
268 _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.