lzpong / threadpool

based on C++11 , a mini threadpool , accept variable number of parameters 基于C++11的线程池,简洁且可以带任意多的参数

Home Page:http://www.cnblogs.com/lzpong/p/6397997.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于 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 为什么会报错呢

commented

什么错, 你的对象销毁了? makeshare 是制造引用