Boost logo

Boost :

From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-05-30 10:36:34


Johan Torp <johan.torp_at_[hidden]> writes:

> Anthony Williams-4 wrote:
>>
>>> I don't think your proposed interface is powerful enough to implement
>>> composed futures, but I might be wrong. For instance, how would you
>>> implement future operators with it?
>>>
>>> future<bool> operator||(future<bool> lhs, future<bool> rhs);
>>
>> Using wait callbacks:
>>
>
> is_ready doesn't trigger the callback, so this won't work.

That depends on what you mean by "work".

It isn't ready, so is_ready() returns false. It just happens to always
return false until you do something to make it ready.

If you wait on it, it becomes ready. If you don't wait, it
doesn't. This is the essential problem with lazy futures.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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