1

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 always 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!!

Sam
  • 11
  • 1
  • copy and past fail! first 2 lines are: boost::function funct< MyClass()>; //void cause the parameter passed is always the same. func = bind( static_cast(&MyClass::operator+), this, arg ); – Sam Nov 21 '10 at 13:50
  • you should edit your question instead of adding a comment. – Sam Miller Nov 21 '10 at 14:52
  • You can take a look at [here](http://stackoverflow.com/a/17941699/1578338). it has a solution – Marx Yu Jul 30 '13 at 08:21

0 Answers0