From aba6cbe5f8823eea4c0889e85c72076ccedbc70a Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 10 Jan 2024 21:05:13 +0800 Subject: [PATCH 1/5] [basic.string.general] Use shorter forms of the return types --- source/strings.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index cc13d13f95..a128d9a742 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -2126,10 +2126,10 @@ constexpr bool empty() const noexcept; // \ref{string.access}, element access - constexpr const_reference operator[](size_type pos) const; - constexpr reference operator[](size_type pos); - constexpr const_reference at(size_type n) const; - constexpr reference at(size_type n); + constexpr const charT& operator[](size_type pos) const; + constexpr charT& operator[](size_type pos); + constexpr const charT& at(size_type n) const; + constexpr charT& at(size_type n); constexpr const charT& front() const; constexpr charT& front(); From 39dd36c2f2447150171b63de221668c3ded41ed4 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 10 Jan 2024 20:53:35 +0800 Subject: [PATCH 2/5] [basic.string.general] Align both overloads of `data` --- source/strings.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/strings.tex b/source/strings.tex index a128d9a742..779830d322 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -2238,7 +2238,7 @@ // \ref{string.ops}, string operations constexpr const charT* c_str() const noexcept; constexpr const charT* data() const noexcept; - constexpr charT* data() noexcept; + constexpr charT* data() noexcept; constexpr operator basic_string_view() const noexcept; constexpr allocator_type get_allocator() const noexcept; From b4e4581548e3a4a39e50fbea625aa4b17566d314 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 10 Jan 2024 21:06:26 +0800 Subject: [PATCH 3/5] [string.access] Use shorter forms of return types --- source/strings.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 779830d322..5cadf4ddeb 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3090,8 +3090,8 @@ \indexlibrarymember{operator[]}{basic_string}% \begin{itemdecl} -constexpr const_reference operator[](size_type pos) const; -constexpr reference operator[](size_type pos); +constexpr const charT& operator[](size_type pos) const; +constexpr charT& operator[](size_type pos); \end{itemdecl} \begin{itemdescr} @@ -3117,8 +3117,8 @@ \indexlibrarymember{at}{basic_string}% \begin{itemdecl} -constexpr const_reference at(size_type pos) const; -constexpr reference at(size_type pos); +constexpr const charT& at(size_type pos) const; +constexpr charT& at(size_type pos); \end{itemdecl} \begin{itemdescr} From 2efe5f194bcece7d16d0581d5feec571957a13d2 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 10 Jan 2024 21:15:01 +0800 Subject: [PATCH 4/5] [string.view.template.general] Use shorter forms of return types and a data member --- source/strings.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 5cadf4ddeb..3519b46a4b 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -661,11 +661,11 @@ constexpr bool empty() const noexcept; // \ref{string.view.access}, element access - constexpr const_reference operator[](size_type pos) const; - constexpr const_reference at(size_type pos) const; // freestanding-deleted - constexpr const_reference front() const; - constexpr const_reference back() const; - constexpr const_pointer data() const noexcept; + constexpr const charT& operator[](size_type pos) const; + constexpr const charT& at(size_type pos) const; // freestanding-deleted + constexpr const charT& front() const; + constexpr const charT& back() const; + constexpr const charT* data() const noexcept; // \ref{string.view.modifiers}, modifiers constexpr void remove_prefix(size_type n); @@ -734,7 +734,7 @@ constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const; private: - const_pointer @\exposid{data_}@; // \expos + const charT* @\exposid{data_}@; // \expos size_type @\exposid{size_}@; // \expos }; From c7c19da04eaec05f785b53b349d83414645a1378 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 10 Jan 2024 21:11:54 +0800 Subject: [PATCH 5/5] [string.view.access] Use shorter forms of return types --- source/strings.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 3519b46a4b..81434f2704 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -1035,7 +1035,7 @@ \indexlibrarymember{operator[]}{basic_string_view}% \begin{itemdecl} -constexpr const_reference operator[](size_type pos) const; +constexpr const char& operator[](size_type pos) const; \end{itemdecl} \begin{itemdescr} @@ -1057,7 +1057,7 @@ \indexlibrarymember{at}{basic_string_view}% \begin{itemdecl} -constexpr const_reference at(size_type pos) const; +constexpr const char& at(size_type pos) const; \end{itemdecl} \begin{itemdescr} @@ -1072,7 +1072,7 @@ \indexlibrarymember{front}{basic_string_view}% \begin{itemdecl} -constexpr const_reference front() const; +constexpr const char& front() const; \end{itemdecl} \begin{itemdescr} @@ -1091,7 +1091,7 @@ \indexlibrarymember{back}{basic_string_view}% \begin{itemdecl} -constexpr const_reference back() const; +constexpr const char& back() const; \end{itemdecl} \begin{itemdescr} @@ -1110,7 +1110,7 @@ \indexlibrarymember{data}{basic_string_view}% \begin{itemdecl} -constexpr const_pointer data() const noexcept; +constexpr const char* data() const noexcept; \end{itemdecl} \begin{itemdescr}