Title
Effects of resize(size()) on a list
Status
c++11
Section
[list.capacity]
Submitter
BSI

Created on 2010-08-25.00:00:00 last changed 162 months ago

Messages

Date: 2010-11-14.16:26:57

Proposed resolution:

Ammend [list.capacity] p1:

void resize(size_type sz);

Effects: If sz <= size(), equivalent to list<T>::iterator it = begin(); advance(it, sz); erase(it, end());. If size() < sz, appends sz - size() default constructed value initialized elements to the sequence.

Date: 2010-11-14.16:26:57

[ 2010 Batavia ]

Accepted with a simplified resolution turning one of the < comparisons into <=.

Date: 2010-10-26.13:57:17

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

Date: 2010-10-26.13:57:17

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.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2011-04-11 11:23:23adminsetstatus: voting -> wp
2011-03-05 15:24:28adminsetstatus: ready -> voting
2010-11-14 16:26:57adminsetmessages: + msg5367
2010-11-14 16:26:57adminsetstatus: review -> ready
2010-11-13 16:30:04adminsetstatus: open -> review
2010-10-26 13:57:17adminsetmessages: + msg5149
2010-10-26 13:57:17adminsetmessages: + msg5148
2010-10-24 03:04:13adminsetmessages: + msg4917
2010-08-25 00:00:00admincreate