Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/exec/asio/completion_token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ namespace ASIOEXEC_ASIO_NAMESPACE

static type
get(::exec::asio::detail::completion_token::completion_handler<Signatures, Receiver> const & h,
Allocator const &) noexcept
::STDEXEC::__ignore = {}) noexcept
{
return ::STDEXEC::get_allocator(::STDEXEC::get_env(h.state().r_));
}
Expand Down
17 changes: 17 additions & 0 deletions test/exec/asio/test_use_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,21 @@ namespace
CHECK(ctx.stopped());
}

#if !STDEXEC_NO_STDCPP_COROUTINES()
template <typename Timer>
::STDEXEC::task<void> test_awaitable_in_stdexec_task(Timer& timer)
{
co_await timer.async_wait(::asio_impl::as_tuple(exec::asio::use_sender));
}

TEST_CASE("Can await an Asio-based asynchronous operation which uses use_sender as its "
"completion token from a stdexec task",
"[asioexec][use_sender]")
{
::asio_impl::io_context ctx;
::asio_impl::steady_timer timer(ctx);
CHECK_NOTHROW(test_awaitable_in_stdexec_task(timer));
}
#endif // !STDEXEC_NO_STDCPP_COROUTINES()

} // namespace
Loading