Closed firma2021 closed 1 year ago
类似于
class scoped_thread { private: thread thread_; public: template <typename... Arg> scoped_thread(Arg&&... arg) : thread_(std::forward<Arg>(arg)...) {} scoped_thread(scoped_thread&& other) : thread_(std::move(other.thread_)) {} scoped_thread(const scoped_thread&) = delete; ~scoped_thread() { if (thread_.joinable()) { thread_.join(); } } };
我觉得不错,你可以推一个分支进来哦,一起参与进来。
好的!
类似于