Created on 2016-10-25.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4606.
In [string.append], add the allocator parameter to the range overload temporary:
template<class InputIterator> basic_string& append(InputIterator first, InputIterator last);-19- Requires: [first, last) is a valid range.
-20- Effects: Equivalent to append(basic_string(first, last, get_allocator())). -21- Returns: *this.
In [string.assign], add the allocator parameter to the range overload temporary:
template<class InputIterator> basic_string& assign(InputIterator first, InputIterator last);-23- Effects: Equivalent to assign(basic_string(first, last, get_allocator())).
-24- Returns: *this.
In [string.insert], add the allocator parameter to the range overload temporary:
template<class InputIterator> iterator insert(const_iterator p, InputIterator first, InputIterator last);-23- Requires: p is a valid iterator on *this. [first, last) is a valid range.
-24- Effects: Equivalent to insert(p - begin(), basic_string(first, last, get_allocator())). -25- Returns: An iterator which refers to the copy of the first inserted character, or p if first == last.
In [string.replace], add the allocator parameter to the range overload temporary:
template<class InputIterator> basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2);-32- Requires: [begin(), i1), [i1, i2) and [j1, j2) are valid ranges.
-33- Effects: Calls replace(i1 - begin(), i2 - i1, basic_string(j1, j2, get_allocator())). -34- Returns: *this.
[ Kona 2017-02-28 ]
Accepted as Immediate.
[ 2017-02-13 Alisdair responds: ]
Looks good to me - no suggested alternative
[ 2016-11-12, Issaquah ]
Sat AM: Priority 2
Alisdair to investigate and (possibly) provide an alternate P/R
Email discussion occurred on the lib reflector.
basic_string's mutation functions show construction of temporary basic_string instances, without passing an allocator parameter. This says that basic_string needs to use a default-initialized allocator, which is clearly unintentional. The temporary needs to use the same allocator the current basic_string instance uses, if an implmentation needs to create a temporary at all. libc++ already does this; I believe libstdc++ does as well (due to the bug report we got from a user that brought this to our attention), but have not verified there. I implemented this in MSVC++'s STL and this change is scheduled to ship in VS "15" RTW.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2017-03-05 23:46:08 | admin | set | status: immediate -> wp |
2017-03-03 22:08:49 | admin | set | messages: + msg9051 |
2017-03-03 22:08:49 | admin | set | status: new -> immediate |
2017-02-13 16:09:44 | admin | set | messages: + msg8939 |
2016-11-21 05:09:01 | admin | set | messages: + msg8671 |
2016-11-01 19:49:14 | admin | set | messages: + msg8579 |
2016-10-25 00:00:00 | admin | create |