Fix allocator construction tracking #13
Merged
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.
My attention was brought to this issue by Ilya Gorbatenko (Горбатенко Илья). Thanks Ilya!
An oversight which was made during development was the fact that construction of values should be done using the correct allocator during copy-assign, move-assign, and swap operations. This PR will fix that.
For example, during a move, if we have unequal allocators, and
propagate_on_container_move_assignmentistrue, and if we need to construct elements in the inline buffer, then we need to make sure we construct those elements with the incoming allocator, rather than the existing one. This is a bit less trivial than it would seem because of the need to account for sound exception handling.These changes still need a bit of cleanup, but should be correct, as verified by the improved rigor of the unit tests.