|
11 | 11 | #include <beman/execution26/detail/impls_for.hpp>
|
12 | 12 | #include <beman/execution26/detail/connect_all_result.hpp>
|
13 | 13 | #include <beman/execution26/detail/valid_specialization.hpp>
|
| 14 | +#include <functional> |
14 | 15 | #include <utility>
|
15 | 16 |
|
16 | 17 | // ----------------------------------------------------------------------------
|
@@ -44,34 +45,16 @@ namespace beman::execution26::detail
|
44 | 45 |
|
45 | 46 | auto start() & noexcept -> void
|
46 | 47 | {
|
47 |
| - if constexpr (requires(){ |
48 |
| - []{ auto&&[op0, op1, op2, op3] = *static_cast<inner_ops_t*>(nullptr); }; |
49 |
| - }) |
50 |
| - { |
51 |
| - auto&[op0, op1, op2, op3] = this->inner_ops; |
52 |
| - ::beman::execution26::detail::impls_for<tag_t>::start(this->state, this->receiver, op0, op1, op2, op3); |
53 |
| - } |
54 |
| - else if constexpr (requires(){ |
55 |
| - []{ auto&&[op0, op1, op2] = *static_cast<inner_ops_t*>(nullptr); }; |
56 |
| - }) |
57 |
| - { |
58 |
| - auto&[op0, op1, op2] = this->inner_ops; |
59 |
| - ::beman::execution26::detail::impls_for<tag_t>::start(this->state, this->receiver, op0, op1, op2); |
60 |
| - } |
61 |
| - else if constexpr (requires(){ |
62 |
| - []{ auto&&[op0, op1] = *static_cast<inner_ops_t*>(nullptr); }; |
63 |
| - }) |
64 |
| - { |
65 |
| - auto&[op0, op1] = this->inner_ops; |
66 |
| - ::beman::execution26::detail::impls_for<tag_t>::start(this->state, this->receiver, op0, op1); |
67 |
| - } |
68 |
| - else if constexpr (requires(){ |
69 |
| - []{ auto&&[op0] = *static_cast<inner_ops_t*>(nullptr); }; |
70 |
| - }) |
71 |
| - { |
72 |
| - auto&[op0] = this->inner_ops; |
73 |
| - ::beman::execution26::detail::impls_for<tag_t>::start(this->state, this->receiver, op0); |
74 |
| - } |
| 48 | + ::std::invoke([this]<::std::size_t... I>(::std::index_sequence<I...>) |
| 49 | + { |
| 50 | + ::beman::execution26::detail::impls_for<tag_t>::start( |
| 51 | + this->state, |
| 52 | + this->receiver, |
| 53 | + this->inner_ops.template get<I>()... |
| 54 | + ); |
| 55 | + }, |
| 56 | + ::std::make_index_sequence<inner_ops_t::size()>{} |
| 57 | + ); |
75 | 58 | }
|
76 | 59 | };
|
77 | 60 | }
|
|
0 commit comments