« Return to Thread: [future] Early draft of wait for multiple futures interface

Re: [future] Early draft of wait for multiple futures interface

by Bugzilla from anthony.ajw@gmail.com :: Rate this Message:

Reply to Author | View in Thread

Johan Torp <johan.torp@...> 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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: [future] Early draft of wait for multiple futures interface