This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
2826.string_view
iterators use old wording
Section: 27.3.3.4 [string.view.iterators] Status: C++17 Submitter: Alisdair Meredith Opened: 2016-11-17 Last modified: 2017-07-30
Priority: 0
View all issues with C++17 status.
Discussion:
The wording for basic_string_view
was written before the definition of a contiguous iterator was added to C++17 to avoid repeating redundant wording.
Suggested modification of 27.3.3.4 [string.view.iterators] p1 (stealing words from valarray begin
/end
):
-1- A constant random-access iterator type such that, for a
const_iterator it
, if&*(it + N)
is valid, then&*(it + N) == (&*it) + N
A type that meets the requirements of a constant random access iterator (24.2.7) and of a contiguous iterator (24.2.1) whosevalue_type
is the template parametercharT
.
[2017-01-27 Telecon]
Priority 0
Proposed resolution:
This wording is relative to N4606.
Modify 27.3.3.4 [string.view.iterators] as indicated:
using const_iterator = implementation-defined;-1- A constant random-access iterator type such that, for a
-2- For aconst_iterator it
, if&*(it + N)
is valid, then&*(it + N) == (&*it) + N
type that meets the requirements of a constant random access iterator (24.3.5.7 [random.access.iterators]) and of a contiguous iterator (24.3.1 [iterator.requirements.general]) whosevalue_type
is the template parametercharT
.basic_string_view str
, any operation that invalidates a pointer in the range[str.data(), str.data() + str.size())
invalidates pointers, iterators, and references returned fromstr
's methods. -3- All requirements on container iterators (23.2 [container.requirements]) apply tobasic_string_view::const_iterator
as well.
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