Boost logo

Boost :

Subject: Re: [boost] [next gen future-promise] What to callthemonadicreturntype?
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2015-06-01 13:14:42


>> I can imagine catch_error() returning something _convertible_
>>
>>> future<X> f1 = async( ... );
>>> future<Y> f2 = f1.catch_error( []( exception_ptr e ) { return Y(); }
>>> );
>>
>> Y needs to be convertible from X.
>
> The opposite is also possible. The continuation can return a type Y
> convertible to X
>
> future<X> f1 = async( ... );
> future<X> f2 = f1.catch_error( []( exception_ptr e ) { return Y(); } );
>
>
>> Not sure there is much value in that, however.
>
> I have not needed it.
>>
>>
>> P.S. can I specialize std::future<MyType> ? And does that just cause
>> headaches for the STL?
>>
> No and I don't know. Do you have a use case that would need specialization?
>

No. I fear specialization here. I think we should ban it now before
anyone starts doing it, unless someone can come up with a really
compelling reason.


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