Skip to content

asioexec::completion_token: Lvalue Completion Handler Invocation#1566

Merged
ericniebler merged 1 commit intoNVIDIA:mainfrom
RobertLeahy:lvalue_completion_handler_invocation
Jul 9, 2025
Merged

asioexec::completion_token: Lvalue Completion Handler Invocation#1566
ericniebler merged 1 commit intoNVIDIA:mainfrom
RobertLeahy:lvalue_completion_handler_invocation

Conversation

@RobertLeahy
Copy link
Copy Markdown
Contributor

As added by 35a3e31 the completion handler type used by the implementation of asioexec::completion_token only supported rvalue-qualified invocation. This was due to the fact:

  • Invocation of a completion handler is consumptive in the same way that calling set_value, set_error, or set_stopped on a receiver is (note those three operations require an rvalue-qualified operand), and
  • Asio has invoked completion handlers with rvalue qualification since 1.20.0 (standalone)/1.77 (Boost)

Unfortunately there are operations in the wild which do not rvalue qualify their completion handlers when invoking them. For example the operations provided by Boost.Beast (at least as of this writing).

Updated asioexec::completion_token to support the above-described operations by removing the rvalue qualification from the function call operator of its completion handler type.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Jul 8, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@RobertLeahy
Copy link
Copy Markdown
Contributor Author

Fixes #1534.

As added by 35a3e31 the completion
handler type used by the implementation of asioexec::completion_token
only supported rvalue-qualified invocation. This was due to the fact:

- Invocation of a completion handler is consumptive in the same way that
  calling set_value, set_error, or set_stopped on a receiver is (note
  those three operations require an rvalue-qualified operand), and
- Asio has invoked completion handlers with rvalue qualification since
  1.20.0 (standalone)/1.77 (Boost)

Unfortunately there are operations in the wild which do not rvalue
qualify their completion handlers when invoking them. For example the
operations provided by Boost.Beast (at least as of this writing).

Updated asioexec::completion_token to support the above-described
operations by removing the rvalue qualification from the function call
operator of its completion handler type.
@RobertLeahy RobertLeahy force-pushed the lvalue_completion_handler_invocation branch from 0aaf0e4 to 2957ffe Compare July 8, 2025 16:00
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 2957ffe

@ericniebler ericniebler merged commit 5012b2d into NVIDIA:main Jul 9, 2025
18 checks passed
@ericniebler
Copy link
Copy Markdown
Collaborator

thanks!

@RobertLeahy
Copy link
Copy Markdown
Contributor Author

#1534 should be resolved, I don't have permissions to close it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants