无法使用CTPL线程池库调用类方法

时间:2018-12-09 12:45:27

标签: threadpool

我尝试使用C++ Thread Pool Library (CTPL)来调用方法,但未编译。

class A {
   void doSomething(int& i) { i++; }
}

A a; 
int i;
ctpl::thread_pool p(2);
p.push(&A::doSomething, &a, i);

顺便说一句,最后一行是使用std :: async调用方法的方式。 也许缺少函数重载...

0 个答案:

没有答案