如何从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个参数的函数。
这就是我尝试的方式,它可能是完全错误的......
如何获取绑定函数的返回值?认为必须在线程中调度它。 提前谢谢!!