This patch is a continuation of rCXX352512. This revision appears to be incomplete. It makes possible for the source containers to remain not empty after move construction of another container. In this case, less deallocations will be registered by test_allocator with counter. So, checks on Counter_base::gConstructed also require modification provided by this patch.
Details
Diff Detail
Event Timeline
test/std/containers/associative/map/map.cons/move_alloc.pass.cpp | ||
---|---|---|
181–182 | Technically, I think the container could also have just 2 elements remaining, no? IOW, what you mean is really that num+6 <= Counter_base::gConstructed <= num+6+3? |
test/std/containers/associative/map/map.cons/move_alloc.pass.cpp | ||
---|---|---|
181–182 | This assumption looks very strange to me. The std::move() either deletes everything in the source container or preserves everything. Any intermediate solution when this function deletes any random(??) number of elements looks unreasonable. However, if you have any specific reasons for implementing (and testing) such intermediate solution, please, provide them. Please, also consult Marshall who is the author of these tests. |
test/std/containers/associative/map/map.cons/move_alloc.pass.cpp | ||
---|---|---|
181–182 | Well.. the standard says this (http://eel.is/c++draft/lib.types.movedfrom):
I couldn't find something that said that std::map behaved differently, therefore as far as the Standard is concerned, a moved-from map must be left in a valid-but-unspecified state. @mclow.lists can double-check that I'm not mistaken here. If I'm right, then leaving the moved-from map completely full, leaving it empty, or leaving any number of elements in it are all valid implementations. Therefore your patch is not really improving the test suite, it's just making the specific implementation you're testing pass. Instead, I think Counter_base::gConstructed <= num+6+m1.size() would be better. |
Technically, I think the container could also have just 2 elements remaining, no? IOW, what you mean is really that num+6 <= Counter_base::gConstructed <= num+6+3?