Title
string_view iterators use old wording
Status
c++17
Section
[string.view.iterators]
Submitter
Alisdair Meredith

Created on 2016-11-17.00:00:00 last changed 89 months ago

Messages

Date: 2017-01-30.15:17:53

Proposed resolution:

This wording is relative to N4606.

  1. Modify [string.view.iterators] as indicated:

    using const_iterator = implementation-defined;
    

    -1- A constant random-access iterator type such that, for a const_iterator it, if &*(it + N) is valid, then &*(it + N) == (&*it) + Ntype that meets the requirements of a constant random access iterator ([random.access.iterators]) and of a contiguous iterator ([iterator.requirements.general]) whose value_type is the template parameter charT.

    -2- For a 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 from str's methods.

    -3- All requirements on container iterators ([container.requirements]) apply to basic_string_view::const_iterator as well.

Date: 2017-01-27.00:00:00

[ 2017-01-27 Telecon ]

Priority 0

Date: 2016-11-17.00:00:00

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 [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) + NA type that meets the requirements of a constant random access iterator (24.2.7) and of a contiguous iterator (24.2.1) whose value_type is the template parameter charT.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2017-03-05 23:41:16adminsetstatus: ready -> wp
2017-01-30 15:17:53adminsetmessages: + msg8804
2017-01-30 15:17:53adminsetstatus: new -> ready
2016-11-28 21:03:02adminsetmessages: + msg8701
2016-11-17 00:00:00admincreate