Title
Resolution LWG 2223 is missing wording about end iterators
Status
c++17
Section
[string.capacity][deque.capacity][vector.capacity]
Submitter
Thomas Koeppe

Created on 2016-11-29.00:00:00 last changed 89 months ago

Messages

Date: 2017-01-30.15:17:53

Proposed resolution:

This wording is relative to N4618.

  1. Edit [string.capacity] as indicated:

    void shrink_to_fit();
    

    […]

    -15- Remarks: Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator. If no reallocation happens, they remain valid.

  2. Edit [deque.capacity] as indicated:

    void shrink_to_fit();
    

    […]

    -8- Remarks: shrink_to_fit invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator.

  3. Edit [vector.capacity] as indicated:

    void shrink_to_fit();
    

    […]

    -10- Remarks: Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator. If no reallocation happens, they remain valid.

Date: 2017-01-27.00:00:00

[ 2017-01-27 Telecon ]

Priority 0

Date: 2016-11-29.00:00:00

The resolution of LWG 2223 added the wording "Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence." to a number of shrink_to_fit operations.

This seems to be missing any mention of end iterators. Surely end iterators are invalidated, too?

Suggested resolution:

For string, deque, and vector each, append as follows:

Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2017-03-05 23:41:16adminsetstatus: ready -> wp
2017-01-30 15:17:53adminsetmessages: + msg8809
2017-01-30 15:17:53adminsetstatus: new -> ready
2016-12-14 19:23:41adminsetmessages: + msg8716
2016-11-29 00:00:00admincreate