Skip to content

[strings] Consistently spell return types and types of data members#8107

Merged
tkoeppe merged 1 commit into
cplusplus:mainfrom
frederick-vs-ja:string-return-types
Dec 13, 2025
Merged

[strings] Consistently spell return types and types of data members#8107
tkoeppe merged 1 commit into
cplusplus:mainfrom
frederick-vs-ja:string-return-types

Conversation

@frederick-vs-ja
Copy link
Copy Markdown
Contributor

For basic_string::front/basic_string::back, the return types are modified to (const_)reference for the consistency with other sequence containers.

For basic_string_view::data, the return types is modified to const charT* for the consistency with basic_string. The same change applies to spelling of the type of closely related exposition-only data member data_.

@eisenwave eisenwave added the P3-Other Triaged issue not in P1 or P2 label Nov 6, 2025
@frederick-vs-ja frederick-vs-ja changed the title [strings] Consistently spell return types [strings] Consistently spell return types and types of data members Nov 17, 2025
Copy link
Copy Markdown
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the string view changes.

I consider the (const_)reference typedefs to be mostly noise in string, since they're always just plain references, but I suppose the consistency doesn't do any harm, especially as string view already uses those typedefs.

Comment thread source/strings.tex Outdated
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`
@tkoeppe tkoeppe merged commit 284ffb8 into cplusplus:main Dec 13, 2025
2 checks passed
@frederick-vs-ja frederick-vs-ja deleted the string-return-types branch December 13, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3-Other Triaged issue not in P1 or P2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants