Skip to content

Commit

Permalink
Prevent async_resume from being called on coro temporaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Nov 18, 2021
1 parent 51d74ca commit fa4bac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asio/include/asio/experimental/coro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct coro
*/
template <typename CompletionToken>
requires std::is_void_v<input_type>
auto async_resume(CompletionToken&& token)
auto async_resume(CompletionToken&& token) &
{
return async_initiate<CompletionToken,
typename traits::completion_handler>(
Expand All @@ -194,7 +194,7 @@ struct coro
* @note This overload is only available for coroutines with an input value.
*/
template <typename CompletionToken, detail::convertible_to<input_type> T>
auto async_resume(T&& ip, CompletionToken&& token)
auto async_resume(T&& ip, CompletionToken&& token) &
{
return async_initiate<CompletionToken,
typename traits::completion_handler>(
Expand Down

0 comments on commit fa4bac5

Please sign in to comment.