File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
include/beman/execution26/detail Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ struct sync_wait_env {
3232 auto query (::beman::execution26::get_delegation_scheduler_t ) const noexcept { return this ->loop ->get_scheduler (); }
3333};
3434
35- template <::beman::execution26::sender_in Sender>
35+ template <::beman::execution26::sender_in<::beman::execution26::detail::sync_wait_env> Sender>
3636using sync_wait_result_type =
3737 ::std::optional<::beman::execution26::value_types_of_t <Sender,
3838 ::beman::execution26::detail::sync_wait_env,
@@ -68,6 +68,9 @@ struct sync_wait_receiver {
6868 }
6969 this ->state ->loop .finish ();
7070 }
71+ auto get_env () const noexcept -> ::beman::execution26::detail::sync_wait_env {
72+ return ::beman::execution26::detail::sync_wait_env{&this ->state ->loop };
73+ }
7174};
7275
7376struct sync_wait_t {
Original file line number Diff line number Diff line change 1313#include < beman/execution26/detail/sender.hpp>
1414#include < beman/execution26/detail/sender_in.hpp>
1515#include < beman/execution26/detail/just.hpp>
16+ #include < beman/execution26/detail/read_env.hpp>
17+ #include < beman/execution26/detail/get_delegation_scheduler.hpp>
18+ #include < beman/execution26/detail/then.hpp>
1619#include < test/execution.hpp>
1720
1821#include < exception>
@@ -223,6 +226,15 @@ auto test_sync_wait() -> void {
223226 // NOLINTEND(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
224227 }
225228}
229+
230+ auto test_provides_scheduler () -> void {
231+ ASSERT (test_std::sync_wait (test_std::then (test_std::read_env (test_std::get_scheduler), [](auto &&) noexcept {})));
232+ }
233+
234+ auto test_provides_delegation_scheduler () -> void {
235+ ASSERT (test_std::sync_wait (
236+ test_std::then (test_std::read_env (test_std::get_delegation_scheduler), [](auto &&) noexcept {})));
237+ }
226238} // namespace
227239
228240TEST (exec_sync_wait) {
@@ -236,4 +248,6 @@ TEST(exec_sync_wait) {
236248 test_sync_wait_state ();
237249 test_sync_wait_receiver ();
238250 test_sync_wait ();
251+ test_provides_scheduler ();
252+ test_provides_delegation_scheduler ();
239253}
You can’t perform that action at this time.
0 commit comments