Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofTC1 status.

132. list::resize description uses random access iterators

Section: 23.3.11.3[list.capacity]Status:TC1Submitter: Howard HinnantOpened: 1999-03-06Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [list.capacity].

View all issues withTC1 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 nothing

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

Proposed resolution:

Change 23.3.11.3[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());         }

[Dublin: The LWG asked Howard to discuss exception safety offlinewith David Abrahams. They had a discussion and believe there isno issue of exception safety with the proposed resolution.]


[8]ページ先頭

©2009-2026 Movatter.jp