|
Boost : |
From: Matt Vogt (mattvogt_at_[hidden])
Date: 2005-08-18 18:52:15
Hartmut Kaiser wrote:
>Interesting idea! Could we signal that by requesting the function to throw a
>special exception?
>
>
I like the optional<T> return better; I think signals-style combiners
might be better for more complicated results.
Perhaps the signature for a worker function could be:
optional<T> worker_function(bool (*continue_processing)(void));
where T is the result type of the simple_future object.
Returning a non-empty optional indicates success, and the
'continue_processing' callback should allow the worker function to query
back into the future object to test for whether its result is still
awaited. This would allow the future object to do any concurrency
management of the continuation flag.
Matt
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk