Created on 2016-09-27.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4606.
Change [string.copy] as indicated:
size_type copy(charT* s, size_type n, size_type pos = 0) const;
-?- Let rlen be the smaller of n and size() - pos.
-2- Throws: out_of_range if pos > size().
-?- Requires: [s, s + rlen) is a valid range.
-3- Effects: Determines the effective length rlen of the string
to copy as the smaller of n and size() - pos. s shall
designate an array of at least rlen elements.Equivalent to: traits::copy(s, data() + pos, rlen).
[Note: This does not terminate s with a null object. — end note]
The function then replaces the string designated by s with a string of
length rlen whose elements are a copy of the string controlled by
*this beginning at position pos.
The function does not append a null object to the string designated by s.
-4- Returns: rlen.
Change [string.view.ops] as indicated:
size_type copy(charT* s, size_type n, size_type pos = 0) const;
-1- Let rlen be the smaller of n and size() - pos.
-2- Throws: out_of_range if pos > size().
-3- Requires: [s, s + rlen) is a valid range.
-4- Effects: Equivalent to: copy_n(begin() + pos, rlen, s)traits::copy(s,
data() + pos, rlen)
-5- Returns: rlen.
-6- Complexity: 𝒪(rlen).
[ Issues processing Telecon 2016-10-7 ]
P0; set to Tentatively Ready
Removed "Note to project editor", since the issue there has been fixed in the current draft.
basic_string_view::copy is inconsistent with basic_string::copy, in that the former uses copy_n and the latter uses traits::copy. We should have this handling be consistent.
Moreover, the basic_string::copy description is excessively roundabout due to copy-on-write era wording.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-10-08 04:58:13 | admin | set | messages: + msg8546 |
2016-10-08 04:58:13 | admin | set | status: new -> ready |
2016-10-03 16:56:10 | admin | set | messages: + msg8533 |
2016-09-27 00:00:00 | admin | create |