Boost logo

Boost :

Subject: Re: [boost] Boost.Future & review of C++0x accepted libraries implementations
From: k-oli_at_[hidden]
Date: 2008-11-20 14:00:51


Am Donnerstag, 20. November 2008 18:19:12 schrieb Anthony Williams:
> k-oli_at_[hidden] 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?

Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk