<list>, <string>: Remove allocator-moving tagged internal constructors#4976
Merged
StephanTLavavej merged 7 commits intomicrosoft:mainfrom Sep 28, 2024
Merged
Conversation
a5ea3ea to
425e3ab
Compare
This reverts commit 425e3ab.
StephanTLavavej
approved these changes
Sep 27, 2024
Member
|
Thanks! 😻 I fixed the basic EH guarantee and a couple of test nitpicks - please double-check. |
This comment was marked as resolved.
This comment was marked as resolved.
StephanTLavavej
approved these changes
Sep 27, 2024
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
I had to push an additional commit due to a I was too much of a lazy kitty for a targeted workaround, so I used the impure matrix. |
Member
|
Thanks for making |
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.
Fixes #4929.
Currently, these internal tagged constructors are implemented in some non-conforming manner such that they can be selected by conforming user codes. They exist for constructing containers with the stored allocators move-constructed, while the corresponding standard constructors copy-construct allocators. This PR removes the these internal tagged constructors and makes allocators copy-constructed.
Although the Standard currently requires that sometimes the allocator is move-constructed ([container.reqmts]), it's highly unusual and perhaps pointless to make move construction of an allocator type not equivalent to copy construction, because LWG-2593 requires that the move construction doesn't change the value of the source allocator. It seems that there can be different side effects can be different, but such difference can't affect further allocations.
In the future, there might be an LWG issue to allow move construction of containers to copy-construct allocators.
Affected tests - skipped during the development, unskipped later due to another approach
libcxx:
std/containers/unord/unord.map/unord.map.cnstr/move.pass.cppstd/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cppstd/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cppstd/containers/unord/unord.set/unord.set.cnstr/move.pass.cppMSVC STL:
VSO_0102478_moving_allocators