Skip to content

Commit 704bf46

Browse files
committed
used the generic facilities for basic_operation
1 parent 75b59ae commit 704bf46

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

include/beman/execution26/detail/basic_operation.hpp

+11-28
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <beman/execution26/detail/impls_for.hpp>
1212
#include <beman/execution26/detail/connect_all_result.hpp>
1313
#include <beman/execution26/detail/valid_specialization.hpp>
14+
#include <functional>
1415
#include <utility>
1516

1617
// ----------------------------------------------------------------------------
@@ -44,34 +45,16 @@ namespace beman::execution26::detail
4445

4546
auto start() & noexcept -> void
4647
{
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+
);
7558
}
7659
};
7760
}

0 commit comments

Comments
 (0)