Closed JCYang closed 7 years ago
set_exception was renamed to unhandled_exception in November of 2016. VS 2017.3 supports both modes to ease the transition.
If you used to write:
void set_exception(exception_ptr e} { foo(e); }
Now you need to write:
void unhandled_exception() { foo(std::current_exception()); }
Also, it is no longer an optional member of coroutine promise. You must provide unhandled_exception in your coroutine promise.
promise.unhandled_exception() is only shown in pseudo code, but no further detail description in 8.4.4. And in the previous introduction blogs and videos(e.g the one by James McNellis), there can be a set_exception() in promise_type, but also not mentioned in the TS, why? There semantic are not very clear, especially the promise_type::unhandled_exception(), what's the point without clear exception ABI/API specification?