Question about futures library that was written by Anthony Williams

There is an example in the documentation under Creating Asynchronous Values that shows how to call a function. Is it possible to call a member function that has arguments? Jon

"Jon Shuler" <JShuler@tsystem.com> writes:
There is an example in the documentation under Creating Asynchronous Values that shows how to call a function. Is it possible to call a member function that has arguments?
Not directly. You have to use boost::bind to wrap the member function call: packaged_task t(boost::bind(&X::foo,&some_x,arg1,arg2)); Anthony -- Author of C++ Concurrency in Action | http://www.manning.com/williams just::thread C++0x thread library | http://www.stdthread.co.uk Just Software Solutions Ltd | http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
participants (2)
-
Anthony Williams
-
Jon Shuler