
18 Aug
2005
18 Aug
'05
11:52 p.m.
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