Created on 2011-07-01.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to the FDIS.
Change [string.cons] p3 as indicated (This move constructor has a wide contract and is therefore safely marked as noexcept):
basic_string(const basic_string<charT,traits,Allocator>& str); basic_string(basic_string<charT,traits,Allocator>&& str) noexcept;-2- Effects: Constructs an object of class basic_string as indicated in Table 64. In the second form, str is left in a valid state with an unspecified value.
-3- Throws: The second form throws nothing if the allocator's move constructor throws nothing.
Change [string.cons] p18 as indicated (This move-like constructor may throw, if the allocators don't compare equal, but not because of a potentially throwing allocator copy constructor, only because the allocation attempt may fail and throw an exception):
basic_string(const basic_string& str, const Allocator& alloc); basic_string(basic_string&& str, const Allocator& alloc);[…]
-18- Throws: The second form throws nothing if alloc == str.get_allocator()unless the copy constructor for Allocator throws.
[ 2011 Bloomington. ]
Move to Ready.
[ 2011-07-11: Daniel comments and suggests wording changes ]
Further, according to paragraph 18 of the same sub-clause:
basic_string(const basic_string& str, const Allocator& alloc); basic_string(basic_string&& str, const Allocator& alloc);[…]
-18- Throws: The second form throws nothing if alloc == str.get_allocator() unless the copy constructor for Allocator throws.
The constraint "unless the copy constructor for Allocator throws" is redundant, because according to Table 28 — Allocator requirements, the expressions
X a1(a); X a(b);
impose the requirement: "Shall not exit via an exception".
Sub-clause [string.cons] contains these constructors in paragraphs 2 and 3:
basic_string(const basic_string<charT,traits,Allocator>& str); basic_string(basic_string<charT,traits,Allocator>&& str) noexcept;[…]
-3- Throws: The second form throws nothing if the allocator's move constructor throws nothing.
How can it ever throw anything if it is marked noexcept?
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2012-02-12 18:36:43 | admin | set | status: voting -> wp |
2012-02-09 04:07:48 | admin | set | status: ready -> voting |
2011-08-16 23:35:18 | admin | set | messages: + msg5858 |
2011-08-16 23:35:18 | admin | set | status: new -> ready |
2011-07-11 20:04:43 | admin | set | messages: + msg5826 |
2011-07-11 20:04:43 | admin | set | messages: + msg5825 |
2011-07-01 00:00:00 | admin | create |