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