|
3026 | 3026 | Let \tcode{Sigs} be |
3027 | 3027 | a pack of the arguments to the \tcode{completion_signatures} specialization |
3028 | 3028 | named by \tcode{completion_signatures_of_t<\exposid{child-type}<Sndr>, env_of_t<Rcvr>>}. |
3029 | | -Let \exposid{as-tuple} be an alias template |
3030 | | -that transforms a completion signature \tcode{Tag(Args...)} into |
3031 | | -the tuple specialization \tcode{\exposid{decayed-tuple}<Tag, Args...>}. |
| 3029 | +Let \exposid{as-tuple} be an alias template such that |
| 3030 | +\tcode{\exposid{as-tuple}<Tag(Args...)>} denotes |
| 3031 | +the type \tcode{\exposid{decayed-tuple}<Tag, Args...>}, and |
| 3032 | +let \exposid{is-no\-throw-decay-copy-sig} be a variable template such that |
| 3033 | +\tcode{auto(\exposid{is-nothrow-decay-copy-sig}<Tag(Args...\linebreak{})>)} is |
| 3034 | +a constant expression of type \tcode{bool} and |
| 3035 | +equal to \tcode{(is_nothrow_constructible_v<decay_t<Args>, Args> \&\& ...)}. |
| 3036 | +Let \exposid{error-completion} be a pack consisting of |
| 3037 | +the type \tcode{set_error_t(exception_ptr)} |
| 3038 | +if \tcode{(\exposid{is-nothrow-decay-copy-sig}<Sigs> \&\&...)} is \tcode{false}, |
| 3039 | +and an empty pack otherwise. |
3032 | 3040 | Then \tcode{variant_t} denotes |
3033 | | -the type \tcode{variant<monostate, \exposid{as-tuple}<Sigs>...>}, |
| 3041 | +the type \tcode{variant<monostate, \exposid{as-tuple}<Sigs>..., \exposid{error-completion}...>}, |
3034 | 3042 | except with duplicate types removed. |
3035 | 3043 |
|
3036 | 3044 | \pnum |
|
3081 | 3089 | []<class Tag, class... Args>(auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept |
3082 | 3090 | -> void { |
3083 | 3091 | using result_t = @\exposid{decayed-tuple}@<Tag, Args...>; |
3084 | | - constexpr bool nothrow = is_nothrow_constructible_v<result_t, Tag, Args...>; |
| 3092 | + constexpr bool nothrow = (is_nothrow_constructible_v<decay_t<Args>, Args> && ...); |
3085 | 3093 |
|
3086 | 3094 | try { |
3087 | 3095 | state.@\exposid{async-result}@.template emplace<result_t>(Tag(), std::forward<Args>(args)...); |
3088 | 3096 | } catch (...) { |
3089 | | - if constexpr (!nothrow) { |
3090 | | - set_error(std::move(rcvr), current_exception()); |
3091 | | - return; |
3092 | | - } |
| 3097 | + if constexpr (!nothrow) |
| 3098 | + state.@\exposid{async-result}@.template emplace<tuple<set_error_t, |
| 3099 | + exception_ptr>>(set_error, current_exception()); |
3093 | 3100 | } |
3094 | 3101 | start(state.@\exposid{op-state}@); |
3095 | 3102 | }; |
|
0 commit comments