Skip to content

Conversation

@frederick-vs-ja
Copy link
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
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.

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`
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