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

Change set_value CPO to use member functions instead of tag_invoke #1295

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

msimberg
Copy link
Contributor

@msimberg msimberg commented Oct 30, 2024

Part of #1204. Changes the set_value CPO to dispatch to set_value member functions instead of using tag_invoke. No compatibility is provided for receivers still wishing to use tag_invoke.

The set_value member is mandated to be noexcept, so we static_assert inside the CPO to check that this is the case.

Consistently changes all set_value members to move the receiver by value into the set_value function scope, to emulate taking the receiver by value. With tag_invoke this was easily done by taking the receiver by value as a function parameter, but with a member function this isn't possible (without deducing this https://wg21.link/p0847), so we do the next best thing. I have not changed receivers in tests to consistently move the receiver into the function scope.

The change to a member function also triggers some compilation failures with nvcc not liking the PIKA_MOVE/PIKA_FORWARD macros. Given that #1325 is coming up soon anyway, I'm changing the offending places unconditionally to use std::move/std::forward.

@msimberg msimberg self-assigned this Oct 30, 2024
Copy link

codacy-production bot commented Oct 30, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.16% (target: -1.00%) 95.31% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (28d528f) 18263 13780 75.45%
Head commit (c244be8) 18276 (+13) 13819 (+39) 75.61% (+0.16%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1295) 64 61 95.31%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@msimberg msimberg force-pushed the set-value-member-function branch 3 times, most recently from 0c7113d to 561c629 Compare October 30, 2024 11:35
@msimberg msimberg marked this pull request as ready for review October 30, 2024 11:37
@msimberg msimberg added this pull request to the merge queue Nov 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 13, 2024
@msimberg msimberg added this pull request to the merge queue Nov 14, 2024
@msimberg msimberg removed this pull request from the merge queue due to a manual request Nov 14, 2024
@msimberg msimberg merged commit 2df06f7 into pika-org:main Nov 14, 2024
37 checks passed
@msimberg msimberg deleted the set-value-member-function branch November 14, 2024 15:40
msimberg added a commit to msimberg/pika that referenced this pull request Nov 18, 2024
…er-function"

This reverts commit 2df06f7, reversing
changes made to 6c9fdf1.
msimberg added a commit that referenced this pull request Nov 18, 2024
@msimberg msimberg added this to the 0.31.0 milestone Nov 19, 2024
msimberg added a commit to msimberg/pika that referenced this pull request Nov 19, 2024
@msimberg msimberg mentioned this pull request Nov 19, 2024
msimberg added a commit that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant