楼教主能写出来吗
【 在 buildtolast 的大作中提到: 】
: template <class F, class... Args>
: auto ThreadPool::Enqueue(F &&f, Args &&...args) -> std::future<typename std::result_of<F(Args...)>::type> {
: using return_type = typename std::result_of<F(Args...)>::type;
: auto task =
: std::make_shared<std::packaged_task<return_type()>>(std::bind(std::forward<F>(f), std::forward<Args>(args)...));
:
:
: 模板+变长参数+异步+右值引用+转发+智能推导。。。
发自「快看水母 于 iPhone 12 Pro Max」
--
FROM 120.195.155.*