You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

设计继承自std::thread的killable_thread类(v2版本)技术问询

可终止线程类:killable_thread (版本2)

嘿,这是我正在设计的第二代可终止线程类killable_thread,它继承自C++标准库的std::thread,是之前相关主题帖子的迭代版本。下面是这个类的源代码:

#include <thread>    /// thread
#include <exception> /// exception_ptr
#include <iostream>  /// cout, endl

template<typename Tsk, typename... Args>
class killable_thread : public std::thread {
private:
    std::exception_ptr& pex;
public:
    /// 继承thread类的构造函数等内容
};

内容的提问来源于stack exchange,提问作者SSteven

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:16:21