A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue1525 below:

Effects of resize(size()) on a vector

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.

1525. Effects of resize(size()) on a vector

Section: 23.3.13.3 [vector.capacity] Status: C++11 Submitter: BSI Opened: 2011-03-24 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [vector.capacity].

View all other issues in [vector.capacity].

View all issues with C++11 status.

Discussion:

Addresses GB-117

23.3.13.3 [vector.capacity] p. 9 (Same as for 23.3.5.3 [deque.capacity] p. 1 i.e. deque::resize). There is no mention of what happens if sz==size(). While it obviously does nothing I feel a standard needs to say this explicitely.

Suggested resolution:

Append "If sz == size(), does nothing" to the effects.

[2011-03-24 Daniel comments]

During the edit of this issue some non-conflicting overlap with 2033(i) became obvious. CopyInsertable should be MoveInsertable and there is missing the DefaultConstructible requirements, but this should be fixed by 2033(i).

Proposed resolution:

Change 23.3.13.3 [vector.capacity] p. 9 as follows:

void resize(size_type sz);

9 Effects: If sz < = size(), equivalent to erase(begin() + sz, end());. If size() < sz, appends sz - size() value-initialized elements to the sequence.

10 Requires: T shall be CopyInsertable into *this.

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