<list>
, <string>
: Remove allocator-moving tagged internal constructors by frederick-vs-ja · Pull Request #4976 · microsoft/STL (original) (raw)
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