-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<list>
, <string>
: Remove allocator-moving tagged internal constructors
#4976
<list>
, <string>
: Remove allocator-moving tagged internal constructors
#4976
Conversation
a5ea3ea
to
425e3ab
Compare
This reverts commit 425e3ab.
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.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
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. |
Thanks for making |
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.cpp
std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
MSVC STL:
VSO_0102478_moving_allocators