Created on 2015-03-03.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4296.
Change [deque.modifiers]/5 to:
-5- Complexity: The number of calls to the destructor of T is the same as the number of elements erased, but the number of calls to the assignment operator of T is no more than the lesser of the number of elements before the erased elements and the number of elements after the erased elements.
Change [vector.modifiers]/4 to:
-4- Complexity: The destructor of T is called the number of times equal to the number of the elements
erased, but the move assignment operator of T is called the number of times equal to the number of
elements in the vector after the erased elements.
[ 2015-05, Lenexa ]
Move to Immediate.
In the latest draft N4296, and in all drafts up to at least N3337:
[deque.modifiers]/5 (regarding deque::erase()):Complexity: The number of calls to the destructor is the same as the number of elements erased, but the number of calls to the assignment operator is no more than the lesser of the number of elements before the erased elements and the number of elements after the erased elements.
[vector.modifiers]/4 (regarding vector::erase()):
Complexity: The destructor of T is called the number of times equal to the number of the elements erased, but the move assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
Is there any reason for explicit mentioning of move assignment for std::vector::erase()? Shouldn't these two wordings be the same with this regard?
Also, for std::deque, it's not clear from the text which destructors and assignment operators are called.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2015-10-27 16:52:45 | admin | set | status: ready -> wp |
2015-05-20 14:24:57 | admin | set | status: immediate -> ready |
2015-05-07 19:30:46 | admin | set | messages: + msg7369 |
2015-05-07 19:30:46 | admin | set | status: new -> immediate |
2015-04-02 17:25:24 | admin | set | messages: + msg7308 |
2015-03-03 00:00:00 | admin | create |