Boost logo

Boost :

Subject: Re: [boost] [Reviews] Futures - packaged_task and shared_future
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-01-05 12:06:14


----- Original Message -----
From: "Anthony Williams" <anthony.ajw_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, January 05, 2009 12:55 PM
Subject: Re: [boost] [Reviews] Futures - packaged_task and shared_future

>
> "vicente.botet" <vicente.botet_at_[hidden]> writes:
>
>> can you consider the ability of a shared_packaged_task to return a
>> shared_future?
>>
> You can move a unique_future<T> into a shared_future<T>, which can
> then be stored in a container.
>
> boost::packaged_task<int> pt(some_func);
> boost::shared_future<int> f=pt.get_future(); // move-assign

Excelent. I like this integration.

Vicente


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