最終更新日時(UTC): 2022年11月17日 04時44分06秒 Akira Takahashi が更新
履歴 編集
bool joinable() const noexcept;
jthreadオブジェクトがスレッドと関連付けられているか否か取得する。
jthread
return get_id() != id();
送出しない。
#include <cassert> #include <thread> int main() { std::jthread t([]{ /*...*/ }); assert(t.joinable()); t.join(); assert(!t.joinable()); }