Title
Are std::basic_string's iterator and const_iterator constexpr iterators?
Status
c++23
Section
[basic.string.general]
Submitter
Jiang An

Created on 2021-12-04.00:00:00 last changed 12 months ago

Messages

Date: 2022-02-10.12:58:57

Proposed resolution:

This wording is relative to N4901.

  1. Modify [basic.string.general], as indicated:

    -3- In all cases, [data(), data() + size()] is a valid range, data() + size() points at an object with value charT() (a "null terminator"), and size() <= capacity() is true.

    -4- A size_type parameter type in a basic_string deduction guide refers to the size_type member type of the type deduced by the deduction guide.

    -?- The types iterator and const_iterator meet the constexpr iterator requirements ([iterator.requirements.general]).

Date: 2022-02-10.00:00:00

[ 2022-02-10 Approved at February 2022 virtual plenary. Status changed: Tentatively Ready → WP. ]

Date: 2022-01-15.00:00:00

[ 2022-01-30; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2021-12-04.00:00:00

std::vector's iterator and const_iterator are required to meet constexpr iterator requirements in C++20 per P1004R2, but it seems that the similar wording is missing for std::basic_string in both P0980R1 and the current working draft.

I think we should add a bullet "The types iterator and const_iterator meet the constexpr iterator requirements ([iterator.requirements.general])." to [basic.string.general].

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-02-10 12:58:57adminsetmessages: + msg12361
2022-02-10 12:58:57adminsetstatus: ready -> wp
2022-01-30 16:43:52adminsetmessages: + msg12306
2022-01-30 16:43:52adminsetstatus: new -> ready
2021-12-04 15:14:52adminsetmessages: + msg12251
2021-12-04 00:00:00admincreate