Created on 2016-02-19.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4594.
Change [allocator.requirements], Table 28 — "Allocator requirements" as indicated:
Table 28 — Allocator requirements Expression Return type Assertion/note
pre-/post-conditionDefault … X u(std::move(a));
X u = std::move(a);Shall not exit via an exception. post: The value of a is unchanged and is equal to u u is equal to the prior value of a.…
[ 2017-06-02 Issues Telecon ]
We discussed containers that have sentinel nodes, etc, and so might have to allocate/deallocate using a moved-from allocator - and decided that we didn't want any part of that
Adjusted the wording slightly, and moved to Tentatively Ready
Previous resolution [SUPERSEDED]:
This wording is relative to N4594.
Change [allocator.requirements], Table 28 — "Allocator requirements" as indicated:
Table 28 — Allocator requirements Expression Return type Assertion/note
pre-/post-conditionDefault … X u(std::move(a));
X u = std::move(a);Shall not exit via an exception. post: u is equal to a and equal to the prior value of a u is equal to the prior value of a..…
[ 2017-02 in Kona, LEWG responds ]
Alisdair Meredith says that if you have a do-not-propagate-on-move-assignment, then the move of the allocator must compare equal to the original.
Have a data structure where all allocators are equal. Construct an element somewhere else moving from inside the container (which doesn't have a POCMA trait); you don't want the allocator of the moved-from element to now be different. So in that case, the allocator's move constructor must behave the same as copy.
We don't need to go as far as this issue, but going that far is ok for Bloomberg.
[ 2016-08 - Chicago ]
Thurs AM: Moved to LEWG, as this decision (should allocators only be copyable, not movable) is design.
[ 2016-06-20, Oulu, Daniel comments ]
According to the current working draft, the situation has changed due to changes performed by the project editor, the revised resolution has been adjusted to N4594.
[ 2016-02, Jacksonville ]
Marshall will see if this can be resolved editorially.
After discussion, the editors and I decided that this could not be handled editorially. The bit about a moved-from state of an allocator being the same as the original state is a normative change. I submitted a pull request to handle the mismatched variables in the table.
Previous resolution [SUPERSEDED]:
This wording is relative to N4567.
Change [allocator.requirements], Table 28 — "Allocator requirements" as indicated:
Note there's an editorial error in Table 28 in that line and the surrounding ones. The left column was apparently updated to use u and the right column is still using a/a1/b.
Table 28 — Allocator requirements Expression Return type Assertion/note
pre-/post-conditionDefault … X u(move(a));
X u = move(a);Shall not exit via an exception. post: u is equal to a and equal to the prior value of a a1 equals the prior value of a.…
[allocator.requirements] suggests that the moved-from state of an allocator may be unequal to its previous state. Such a move constructor would break most container implementations, which move-construct the embedded allocator along with a compressed pair. Even if a moved-from container is empty, it should still subsequently allocate from the same resource pool as it did before.
std::vector<int, pool> a(500, my_pool); auto b = std::move(a); // b uses my_pool too. a.resize(500); // should still use my_pool.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-07-30 20:18:47 | admin | set | status: voting -> wp |
2017-06-26 13:46:20 | admin | set | status: ready -> voting |
2017-06-05 15:41:21 | admin | set | messages: + msg9226 |
2017-06-05 15:41:21 | admin | set | messages: + msg9225 |
2017-06-05 15:41:21 | admin | set | status: lewg -> ready |
2016-08-05 03:33:05 | admin | set | messages: + msg8416 |
2016-08-05 03:33:05 | admin | set | status: new -> lewg |
2016-06-20 07:20:35 | admin | set | messages: + msg8178 |
2016-03-07 04:46:57 | admin | set | messages: + msg8005 |
2016-02-21 15:10:26 | admin | set | messages: + msg7990 |
2016-02-19 00:00:00 | admin | create |