threadpool
threadpool copied to clipboard
关于 auto task = std::make_shared<std::packaged_task<ResType()>>(std::bind(std::forward<F>(f), std::forward<Args>(args)...) );
有两个问题想请教:1.有没有别的写法 2.我使用的方法为:std::packaged_task<ResType()>task(forward<F>(f), std::forward<Args>(args)...) ); 就是没给makeshared 为什么会报错呢
什么错, 你的对象销毁了? makeshare 是制造引用