| 69 | |
| 70 | template <class... _Booleans> |
| 71 | constexpr void set_value(_Booleans &&...__bools) noexcept |
| 72 | { |
| 73 | if constexpr ((__is_bool_constant<_Booleans, true> && ...)) |
| 74 | { |
| 75 | // Always done: |
| 76 | __state_->__cleanup(); |
| 77 | STDEXEC::set_value(std::move(__state_->__rcvr_)); |
| 78 | } |
| 79 | else if constexpr ((__is_bool_constant<_Booleans, false> && ...)) |
| 80 | { |
| 81 | // Never done: |
| 82 | __state_->__repeat(); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | // Mixed results: |
| 87 | constexpr bool __is_nothrow = (std::is_nothrow_convertible_v<_Booleans, bool> && ...); |
| 88 | STDEXEC_TRY |
| 89 | { |
| 90 | // If the child sender completed with true, we're done |
| 91 | bool const __done = (static_cast<bool>(static_cast<_Booleans &&>(__bools)) && ...); |
| 92 | if (__done) |
| 93 | { |
| 94 | __state_->__cleanup(); |
| 95 | STDEXEC::set_value(std::move(__state_->__rcvr_)); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | __state_->__repeat(); |
| 100 | } |
| 101 | } |
| 102 | STDEXEC_CATCH_ALL |
| 103 | { |
| 104 | if constexpr (!__is_nothrow) |
| 105 | { |
| 106 | __state_->__cleanup(); |
| 107 | STDEXEC::set_error(std::move(__state_->__rcvr_), std::current_exception()); |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | template <class _Error> |