示例:
1 template<class F, class... Args> 2 auto ThreadPool::enqueue(F&& f, Args&&... args) 3 -> std::future<typename std::result_of<F(Args...)>::type>
result_of可以推断函数F(Args...)的返回值类型,
auto ->表明函数返回类型为std::future<typename std::result_of<F(Args...)>::type>
原文地址:https://www.cnblogs.com/zl1991/p/9078300.html
时间: 2024-07-28 15:30:57