
k-oli@gmx.de writes:
Am Donnerstag, 20. November 2008 18:19:12 schrieb Anthony Williams:
k-oli@gmx.de writes: The latest C++0x working draft (which includes those papers, and which is the "feature complete" committee draft out for voting at the moment) is at:
How has the jss::packaged_task to be used with boost::thread?
X x; jss::packaged_task< std::string > tsk( boost::bind( & X::execute, x) ); jss::shared_future< std::string > f( tsk.get_future() ); boost::thread t( boost::bind( & jss::packaged_task< std::string >::operator(), tsk) ); t.join(); std::cout << f.get() << std::endl;
Does not compile because packaged_task is noncopyable. In the C++0x working draft std::move( tsk) was used - but how to do it with the current boost release?
boost::thread t(boost::move(tsk)); Anthony -- Anthony Williams Author of C++ Concurrency in Action | http://www.manning.com/williams Custom Software Development | http://www.justsoftwaresolutions.co.uk Just Software Solutions Ltd, Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK