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/asioexec/completion_token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ namespace asioexec {
}

template <typename... Args>
void operator()(Args&&... args) && noexcept {
void operator()(Args&&... args) noexcept {
STDEXEC_ASSERT(self_);
{
const std::lock_guard l(self_->m_);
Expand Down
11 changes: 11 additions & 0 deletions test/asioexec/test_completion_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,4 +718,15 @@ namespace {
CHECK(lvalue_kind == value_category_receiver::kind::const_lvalue);
}

TEST_CASE(
"Lvalue invocation of the completion handler is supported (for compatibility with Boost.Beast "
"perhaps among others)",
"[asioexec][completion_token]") {
const auto initiating_function = [](auto&& token) {
return asio_impl::async_initiate<decltype(token), void()>([](auto&& h) { h(); }, token);
};
auto op = ::stdexec::connect(initiating_function(completion_token), expect_value_receiver{});
::stdexec::start(op);
}

} // namespace
Loading