Repository navigation
LWG-4158 packaged_task::operator= should abandon its shared state - #6488
Open
Zhuo Ming (Pen-NineCat) wants to merge 1 commit into
Open
Zhuo Ming (Pen-NineCat) wants to merge 1 commit into
Zhuo Ming (Pen-NineCat) wants to merge 1 commit into
Conversation
…4158, and a simple test.
This comment was marked as resolved.
This comment was marked as resolved.
Author
|
@microsoft-github-policy-service agree |
Member
|
Can you please edit your PR description to properly auto-close our tracking issue? See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests . You need to literally say |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Author
|
Sorry for the confusion — I've updated the PR description to use |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves https://cplusplus.github.io/LWG/issue4158
Implement
packaged_task& operator=(packaged_task&&)withClose #6315
Maybe an other problem:
The self-assignment test (not in current PR)
{ std::packaged_task<int()> task([] { return 42; }); task = std::move(task); assert(task.valid()); }passes on most configurations but fails on 5/46 (all
/std:c++latest, mixed/MT//MDd).I don't know why only these configurations fail. My implementation follows the proposed resolution
packaged_task(std::move(rhs)).swap(*this), so I expected task to stay valid after self-move-assignment. Could this be a separate issue, or is my test wrong? I'm not sure if self-move-assignment is supposed to be covered by this test at all.