Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forwarding of return type from execution::then callable #994

Merged

Conversation

msimberg
Copy link
Contributor

The result of the callable in then (and cuda::then_on_host) was previously taken by universal reference (auto&&) but then moved into the successor receiver. This would be wrong when the return type of the callable is a reference, and fail to compile if the successor receiver also expects a reference. This moves the call of the callable to simply directly pass the result into set_value instead of going via an intermediate local variable. This also adds a regression test for then.

@msimberg msimberg self-assigned this Jan 23, 2024
@msimberg
Copy link
Contributor Author

cscs-ci run

@msimberg msimberg added this pull request to the merge queue Jan 23, 2024
Merged via the queue into pika-org:main with commit 65fa6cd Jan 23, 2024
52 of 53 checks passed
@msimberg msimberg added this to the 0.22.0 milestone Jan 23, 2024
@msimberg msimberg deleted the then-forwarding-callable-return-type branch January 31, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant