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.