Boost logo

Boost :

Subject: Re: [boost] [next gen future-promise] What to call themonadicreturntype?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-05-30 15:46:31


Le 30/05/15 00:26, Peter Dimov a écrit :
> Niall Douglas wrote:
>
>>> > It's not that I don't like it, I don't see sufficient motivation
>>> for > it.
>
> Actually I've changed my mind and now I don't like it. It's a
> catch(...) without a rethrow, and while those are occasionally
> necessary, they are not likable.
>
> To be clear, I'm talking about the N4048's .catch_error that takes an
> exception_ptr, not an error_code.
>
>> > I'm also not quite sure how it's to be used. Vicente's wording in
>> N4048 > is a bit unclear.
>> >
>> > future<X> f1 = async( ... );
>> > future<Y> f2 = f1.catch_error( []( exception_ptr e ) { return >
>> Y(); } );
>> >
>> > What happens when f1 has a value?
>>
>> Surely for catch_error() one must always return the same type of
>> future as the input? Otherwise it couldn't work when f1 has a value.
>
> Vicente in N4048 says that it's not required to return the same type.
>
If I said that it was an error. Could you point me where?

Vicente


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