This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2834. Resolution LWG 2223 is missing wording about end iterators

Section: 27.4.3.5 [string.capacity], 23.3.5.3 [deque.capacity], 23.3.13.3 [vector.capacity] Status: C++17 Submitter: Thomas Koeppe Opened: 2016年11月29日 Last modified: 2020年09月06日

Priority: 0

View all other issues in [string.capacity].

View all issues with C++17 status.

Discussion:

The resolution of LWG 2223 (i) 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 (追記ここまで).

[2017年01月27日 Telecon]

Priority 0

Proposed resolution:

This wording is relative to N4618.

  1. Edit 27.4.3.5 [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 23.3.5.3 [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 23.3.13.3 [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.

AltStyle によって変換されたページ (->オリジナル) /