This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
Section: 24.3.11.3 [vector.capacity], 24.3.8.3 [deque.capacity] Status: C++14 Submitter: Stephan T. Lavavej Opened: 2013-09-21 Last modified: 2017-07-05
Priority: 0
View other active issues in [vector.capacity].
View all other issues in [vector.capacity].
View all issues with C++14 status.
Discussion:
First, 24.3.8.3 [deque.capacity]/4 and 24.3.11.3 [vector.capacity]/16 say that resize(size_type sz, const T& c) "Requires: T shall be MoveInsertable into *this and CopyInsertable into *this." The CopyInsertable requirement is correct (because sz might be size() + 2 or more), but the MoveInsertable requirement is redundant due to 24.2.2.1 [container.requirements.general]/13: "T is CopyInsertable into X means that, in addition to T being MoveInsertable into X, the [...]". (LWG 2033's resolution said that this was "not redundant, because CopyInsertable is not necessarily a refinement of MoveInsertable" which was true at the time, but then LWG 2177's resolution made it a refinement.)
Second, 24.3.11.3 [vector.capacity]/17 says "Remarks: If an exception is thrown other than by the move constructor of a non-CopyInsertable T there are no effects." This is confusing because T is required to be CopyInsertable. (/14 says the same thing for resize(size_type sz), where it is correct because that overload requires only MoveInsertable and DefaultInsertable.)[Issaquah 2014-02-11: Move to Immediate]
Proposed resolution:
This wording is relative to N3691.
Edit 24.3.8.3 [deque.capacity]/4 as indicated:
void resize(size_type sz, const T& c);[…]
-4- Requires: T shall beMoveInsertable into *this andCopyInsertable into *this.
Edit 24.3.11.3 [vector.capacity]/16+17 as indicated:
void resize(size_type sz, const T& c);[…]
-16- Requires: T shall beMoveInsertable into *this andCopyInsertable into *this. -17- Remarks: If an exception is thrownother than by the move constructor of a non-CopyInsertable Tthere are no effects.