Title
LWG 2853 should apply to deque::erase too
Status
c++20
Section
[deque.modifiers]
Submitter
Tim Song

Created on 2017-03-30.00:00:00 last changed 46 months ago

Messages

Date: 2017-07-15.22:58:07

Proposed resolution:

This wording is relative to N4659.

  1. Change [deque.modifiers] as indicated:

    iterator erase(const_iterator position);
    iterator erase(const_iterator first, const_iterator last);
    void pop_front();
    void pop_back();
    

    -4- Effects: […]

    -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.

    -6- Throws: Nothing unless an exception is thrown by the copy constructor, move constructor, assignment operator, or move assignment operator of T.

Date: 2017-07-15.22:58:07

[ 2017-07 Toronto Wed Issue Prioritization ]

Priority 0; Move to Ready

Date: 2017-03-30.00:00:00

Most of the discussion of LWG 2853 applies, mutatis mutandis, to deque::erase. The relevant requirements table requires neither Copy/MoveInsertable nor Copy/MoveConstructible for the erase operations, so there's no way a copy/move constructor can safely be called.

And "assignment operator or move assignment operator" is just "assignment operator", since "move assignment operator" is just a species of "assignment operator".

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2017-11-13 19:01:36adminsetstatus: voting -> wp
2017-10-17 18:34:55adminsetstatus: ready -> voting
2017-07-15 22:58:07adminsetmessages: + msg9381
2017-07-15 22:58:07adminsetstatus: new -> ready
2017-04-24 11:00:11adminsetmessages: + msg9160
2017-03-30 00:00:00admincreate