———
This page is a snapshot from the LWG issues list, see the
for more information and the meaning of
status.
. list::resize description uses random access iterators
Section: 23.3.11.3
Status:
Submitter: Howard Hinnant Opened: 1999-03-06 Last modified: 2016-01-28
Priority: Not Prioritized
View all other
in [list.capacity].
View all issues with
status.
Discussion:
The description reads:
-1- Effects:
if (sz > size()) insert(end(), sz-size(), c); else if (sz < size()) erase(begin()+sz, end()); else ; // do nothingObviously list::resize should not be specified in terms of random access iterators.
Proposed resolution:
Change 23.3.11.3
paragraph 1 to:
Effects:
if (sz > size()) insert(end(), sz-size(), c); else if (sz < size()) { iterator i = begin(); advance(i, sz); erase(i, end()); }[Dublin: The LWG asked Howard to discuss exception safety offline with David Abrahams. They had a discussion and believe there is no issue of exception safety with the proposed resolution.]