Title
list::resize description uses random access iterators
Status
tc1
Section
[list.capacity]
Submitter
Howard Hinnant

Created on 1999-03-06.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

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

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [list.capacity] 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());
         }
Date: 1999-03-06.00:00:00

The description reads:

-1- Effects:

         if (sz > size())
           insert(end(), sz-size(), c);
         else if (sz < size())
           erase(begin()+sz, end());
         else
           ;                           //  do nothing

Obviously list::resize should not be specified in terms of random access iterators.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1587
2010-10-21 18:28:33adminsetmessages: + msg1586
1999-03-06 00:00:00admincreate