Le 28/05/15 13:38, Peter Dimov a écrit :
Vicente J. Botet Escriba wrote:
I see that you want to be able to store error_code or exception_ptr. Wouldn't the interface of expected
> be enough? future<T> already adds the ability to store exception_ptr. There is no need to store another exception_ptr in the value. Niall's type is exactly equivalent to future
>, as I already said (twice). I was talking of the to be named type, from which Nial want to derive its future ;-) I proposed to the C++ standard a function future<T>::next (bind) that takes a continuation having T as parameter (future<R>(T)), and and future<T>::catch_error that takes a as parameter a continuation that takes an errror as parameter. The proposal was not accepted.
future<T>::next( [](T){...} ) is actually pretty useful, catch_error() much less so. You should have proposed just the former. (Sean Parent's future implementation's ::then has ::next's semantics IIRC.) We never know what we should do. Without catch_error(), you need yet .then() as you want to be able to recover from errors in the same way.
Vicente