From 78f9ec83807f67fd113168183037a889979013f5 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 Nov 2023 19:56:08 +0100 Subject: [PATCH] =?UTF-8?q?P2836R1=20std::basic=5Fconst=5Fiterator=20shoul?= =?UTF-8?q?d=20follow=20its=20underlying=20type=E2=80=99s=20convertibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/iterators.tex | 31 +++++++++++++++++++++++++++++++ source/support.tex | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index b765432c953..3a0abc79da3 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -4288,6 +4288,13 @@ template<@\libconcept{sentinel_for}@ S> constexpr bool operator==(const S& s) const; + template<@\exposconcept{not-a-const-iterator}@ CI> + requires @\exposconcept{constant-iterator}@ && @\libconcept{convertible_to}@ + constexpr operator CI() const&; + template<@\exposconcept{not-a-const-iterator}@ CI> + requires @\exposconcept{constant-iterator}@ && @\libconcept{convertible_to}@ + constexpr operator CI() &&; + constexpr bool operator<(const basic_const_iterator& y) const requires @\libconcept{random_access_iterator}@; constexpr bool operator>(const basic_const_iterator& y) const @@ -4590,6 +4597,30 @@ Equivalent to: \tcode{return \exposid{current_} == s;} \end{itemdescr} +\begin{itemdecl} +template<@\exposconcept{not-a-const-iterator}@ CI> + requires @\exposconcept{constant-iterator}@ && @\libconcept{convertible_to}@ +constexpr operator CI() const&; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\exposid{current_}. +\end{itemdescr} + +\begin{itemdecl} +template<@\exposconcept{not-a-const-iterator}@ CI> + requires @\exposconcept{constant-iterator}@ && @\libconcept{convertible_to}@ +constexpr operator CI() &&; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{std::move(\exposid{current_})}. +\end{itemdescr} + \indexlibrarymember{operator<}{basic_const_iterator}% \indexlibrarymember{operator>}{basic_const_iterator}% \indexlibrarymember{operator<=}{basic_const_iterator}% diff --git a/source/support.tex b/source/support.tex index 4376a443cf2..255b480d5f5 100644 --- a/source/support.tex +++ b/source/support.tex @@ -715,7 +715,7 @@ #define @\defnlibxname{cpp_lib_quoted_string_io}@ 201304L // also in \libheader{iomanip} #define @\defnlibxname{cpp_lib_ranges}@ 202302L // also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_as_const}@ 202207L // freestanding, also in \libheader{ranges} +#define @\defnlibxname{cpp_lib_ranges_as_const}@ 202311L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_as_rvalue}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_cartesian_product}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges}