Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy/move assignment in std::vector::erase() and std::deque::erase()

At Lenexa meeting the issue got Immediate status with proposed resolution:

This wording is relative to N4296.

Change 23.3.3.4 [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 23.3.6.5 [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.

That is, if the resolution is accepted there will be no special mention of the move assignment for std::vector::erase, and also the wording for std::deque::erase will be clarified a bit.