boost :: thread pool和boost :: bind或boost :: function

时间:2010-11-21 13:14:05

标签: boost binding bind threadpool

如何从boost线程池中获取返回值?

我试图将一个绑定函数附加到boost :: function:

boost::function f0; //void cause the parameter passed is always the same.

func = bind( static_cast(&MyClass::operator+),  this, arg );

MyClass obj;
threadpool.schedule( obj = &func() ) 

但是它会抛出错误:term不会计算为带有0个参数的函数。

这就是我尝试的方式,它可能是完全错误的......

如何获取绑定函数的返回值?认为必须在线程中调度它。 提前谢谢!!

0 个答案:

没有答案