From 06257de9239597460029c5d32f436c13770e8a0a Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Mon, 17 Nov 2025 11:29:12 +0800 Subject: [PATCH] [string] Consistently spell return types and types of data members Affected sections: - [basic.string.general] Align both overloads of `data` - [basic.string.general] Use `(const_)reference` for consistency with other sequence containers - [string.access] Use `(const_)reference` for consistency with other sequence containers - [string.view.template.general] Use `const charT*` for `data` and a data member, for the consistency with `basic_string`. -[string.view.access] Use `const charT*` for `data` for consistency with `basic_string` --- source/strings.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 9e1e9481b8..d7eb529eb8 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -665,7 +665,7 @@ 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* 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 }; @@ -1110,7 +1110,7 @@ \indexlibrarymember{data}{basic_string_view}% \begin{itemdecl} -constexpr const_pointer data() const noexcept; +constexpr const charT* data() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -2131,10 +2131,10 @@ constexpr const_reference at(size_type n) const; constexpr reference at(size_type n); - constexpr const charT& front() const; - constexpr charT& front(); - constexpr const charT& back() const; - constexpr charT& back(); + constexpr const_reference front() const; + constexpr reference front(); + constexpr const_reference back() const; + constexpr reference back(); // \ref{string.modifiers}, modifiers constexpr basic_string& operator+=(const basic_string& str); @@ -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; @@ -3135,8 +3135,8 @@ \indexlibrarymember{front}{basic_string}% \begin{itemdecl} -constexpr const charT& front() const; -constexpr charT& front(); +constexpr const_reference front() const; +constexpr reference front(); \end{itemdecl} \begin{itemdescr} @@ -3151,8 +3151,8 @@ \indexlibrarymember{back}{basic_string}% \begin{itemdecl} -constexpr const charT& back() const; -constexpr charT& back(); +constexpr const_reference back() const; +constexpr reference back(); \end{itemdecl} \begin{itemdescr}