inline scoped_thread make_scoped_thread(_Fn f, _Args... args) { return std::move(scoped_thread(std::thread{ f, args... })); }
scoped_thread& operator=(std::thread&& thread) { scoped_thread(std::move(thread)).swap(*this); return *this; }
inline scoped_thread make_scoped_thread(_Fn f, _Args... args) { return std::move(scoped_thread(std::thread{ f, args... })); }
scoped_thread& operator=(std::thread&& thread) { scoped_thread(std::move(thread)).swap(*this); return *this; }