Boost logo

Boost :

Subject: Re: [boost] [thread] Dividing into Boost.Thread and Boost.Sync
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-08-20 02:42:52

Le 19/08/13 13:53, Bjorn Reese a écrit :
> On 08/18/2013 11:31 PM, Vicente J. Botet Escriba wrote:
>> I think we can provide a minimal future abstraction that can be used
>> with other execution contexts, but it would need to have as parameter
>> the associated mutex and condition_variable abstraction, otherwise I
>> don't see how we can do it. Maybe you have found how. If yes, I will be
>> interested in knowing how?
> It the most extreme case where no synchronization is needed, we have
> Boost.Expected (once it is finalized.)
Your are almost right. There are some differences between
boost::expected and a future not synchronized. In particular:
* future is default constructible, while expected would ensure the
non-empty guaranty as boost::variant does, that is expected provides an
immediate value, while future provides, well, a future value.
* futures pairwise with promises, while expected is a stand alone class,
* futures are movables-only, while expected can be copy_constructible,
* ...


Boost list run by bdawes at, gregod at, cpdaniel at, john at