Skip to content

Commit

Permalink
fix on() to support current_scheduler (facebookexperimental#162)
Browse files Browse the repository at this point in the history
fix on() to support current_scheduler
  • Loading branch information
kirkshoop authored Aug 12, 2020
1 parent cf1ac7d commit c266ef5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/unifex/on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ namespace _on {
(requires sender<Sender> AND scheduler<Scheduler> AND //
(!tag_invocable<_fn, Sender, Scheduler>))
auto operator()(Sender&& sender, Scheduler&& scheduler) const {
return with_query_value(
sequence(schedule(), (Sender&&)sender),
auto sndr = schedule(scheduler);
return sequence(
std::move(sndr),
with_query_value(
(Sender&&)sender,
get_scheduler,
(Scheduler&&)scheduler);
(Scheduler&&)scheduler));
}
} on{};
} // namespace _on
Expand Down

0 comments on commit c266ef5

Please sign in to comment.