| 65 | |
| 66 | template <class _Receiver> |
| 67 | struct __receiver |
| 68 | { |
| 69 | using receiver_concept = STDEXEC::receiver_tag; |
| 70 | |
| 71 | constexpr void set_value() noexcept |
| 72 | { |
| 73 | __state_->__repeat(); |
| 74 | } |
| 75 | |
| 76 | template <class _Error> |
| 77 | constexpr void set_error(_Error &&__err) noexcept |
| 78 | { |
| 79 | STDEXEC_TRY |
| 80 | { |
| 81 | auto __err_copy = static_cast<_Error &&>(__err); // make a copy of the error... |
| 82 | __state_->__cleanup(); // ... because this could potentially invalidate it. |
| 83 | STDEXEC::set_error(std::move(__state_->__rcvr_), std::move(__err_copy)); |
| 84 | } |
| 85 | STDEXEC_CATCH_ALL |
| 86 | { |
| 87 | if constexpr (!__nothrow_decay_copyable<_Error>) |
| 88 | { |
| 89 | STDEXEC::set_error(std::move(__state_->__rcvr_), std::current_exception()); |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | constexpr void set_stopped() noexcept |
| 95 | { |
| 96 | __state_->__cleanup(); |
| 97 | STDEXEC::set_stopped(std::move(__state_->__rcvr_)); |
| 98 | } |
| 99 | |
| 100 | [[nodiscard]] |
| 101 | constexpr auto get_env() const noexcept -> env_of_t<_Receiver> |
no test coverage detected