Skip to content

Commit c3f90d4

Browse files
authored
Merge pull request NVIDIA#1449 from NVIDIA/drive-by-simplification
use `__tuple::for_each` to simplify some senders
2 parents c15f2e0 + 6c52420 commit c3f90d4

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

include/exec/start_now.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ namespace exec {
180180
__scope.nest(static_cast<stdexec::__cvref_t<_SenderIds>&&>(__sndr)),
181181
__receiver_t{this})}...} {
182182
// Start all of the child operations
183-
__op_state_.apply(
184-
[](auto&... __op_state) noexcept { (stdexec::start(__op_state), ...); }, __op_state_);
183+
__op_state_.for_each(stdexec::start, __op_state_);
185184
}
186185

187186
bool request_stop() noexcept {

include/exec/when_any.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ namespace exec {
219219
if (this->__stop_source_.stop_requested()) {
220220
stdexec::set_stopped(static_cast<_Receiver&&>(this->__rcvr_));
221221
} else {
222-
__ops_.apply([](auto&... __ops) { (stdexec::start(__ops), ...); }, __ops_);
222+
__ops_.for_each(stdexec::start, __ops_);
223223
}
224224
}
225225

include/nvexec/stream/when_all.cuh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ namespace nvexec::STDEXEC_STREAM_DETAIL_NS {
378378
if constexpr (sizeof...(SenderIds) == 0) {
379379
complete();
380380
} else {
381-
child_states_.apply(
382-
[](auto&... __child_ops) noexcept -> void { (stdexec::start(__child_ops), ...); },
383-
child_states_);
381+
child_states_.for_each(stdexec::start, child_states_);
384382
}
385383
}
386384
}

0 commit comments

Comments
 (0)