This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
1420. Effects ofresize(size())
on a list
Section: 23.3.11.3 [list.capacity] Status: C++11 Submitter: BSI Opened: 2010-08-25 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [list.capacity].
View all issues with C++11 status.
Discussion:
Addresses GB-115
There is no mention of what happens if sz==size()
. While it obviously does nothing I feel a standard needs to say this explicitely.
[ Resolution proposed in ballot comment ]
Express the semantics as pseudo-code similarly to the way it is done for the copying overload that follows (in p3). Include an else clause that does nothing and covers the sz==size()
case.
[ 2010 Batavia ]
Accepted with a simplified resolution turning one of the <
comparisons into <=.
Proposed resolution:
Ammend [list.capacity] p1:
void resize(size_type sz);
Effects: If
sz < = size()
, equivalent tolist<T>::iterator it = begin(); advance(it, sz); erase(it, end());
. Ifsize() < sz
, appendssz - size()
default constructed value initialized elements to the sequence .
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4