boost::thread pool and boost::bind or boost::function
How can i get return value from a boost thread pool?
i tried to attach a bound function to a boost::function:
boost::function f0; //void cause the parameter passed is al开发者_开发百科ways the same. func = bind( static_cast(&MyClass::operator+), this, arg ); MyClass obj; threadpool.schedule( obj = &func() )
but it throws error: term does not evaluate to a function taking 0 arguments.
This is just the way i tried, it could be completely wrong...
How can i get the return value of a bound function? consider it has to be scheduled in a thread. Thank you in advance!!
精彩评论