Skip to content

P3655 R0 zstring_view #2285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wg21bot opened this issue Mar 19, 2025 · 1 comment
Open

P3655 R0 zstring_view #2285

wg21bot opened this issue Mar 19, 2025 · 1 comment
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++29 Targeted at C++29 IS Ship vehicle: IS LEWG Library Evolution size - medium paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Mar 19, 2025

P3655R0 zstring_view (Peter Bindels, Hana Dusikova, Jeremy Rifkin)

@wg21bot wg21bot added the LEWG Library Evolution label Mar 19, 2025
@wg21bot wg21bot added this to the 2025-telecon milestone Mar 19, 2025
@inbal2l inbal2l added IS Ship vehicle: IS C++29 Targeted at C++29 B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 size - medium paper size estimate labels Mar 20, 2025
@tahonermann
Copy link
Collaborator

SG16 reviewed P3655R0 during the 2025-04-23 SG16 meeting. The following polls were taken.

  • Poll 1: P3655R0: No objection to use of std::char_traits for consistency and compatibility with std::string_view.
    • Attendees: 8 (no abstentions)
      SF F N A SA
      7 1 0 0 0
    • Strong consensus.
  • Poll 2: P3655R0: Forward to LEWG with encouragement to add analysis of overload resolution and techniques to address ambiguity.
    • Attendees: 8 (no abstentions)
      SF F N A SA
      8 0 0 0 0
    • Strong consensus.

Poll 1 was taken in response to questions brought up regarding the utility of std::char_traits. SG16 has, on many occasions, discussed various deficiencies of std::char_traits as it applies to modern text. The general sentiment within SG16 is that std::char_traits is no longer fit for its original purpose and that new interfaces should avoid using it or taking a dependency on it. In this case, SG16 felt that an exception was warranted due to std::basic_string_view's existing use of std::char_traits and the explicit intent that specializations of the proposed std::basic_zstring_view be substitutable for, and convertible to, the corresponding specializations of std::basic_string_view.

Poll 2 demonstrates that SG16 sees significant value in std::basic_zstring_view. It was acknowledged that null terminated strings are not going away any time soon and that this proposal offers a more natural and performant way to interact with existing interfaces that consume such strings. However, SG16 also recognized that there are deployment and adoption concerns with respect to existing function overload sets that accept std::basic_string, std::basic_string_view, and const CharT* arguments. Such concerns fall more under LEWG's purview, so SG16 has encouraged the proposal authors to add additional analysis of the consequences of adding an additional overload that accepts a std::basic_zstring_view argument to an existing overload set, and the consequences of passing a std::basic_zstring_view argument (which will be convertible to std::basic_string_view) to such existing overload sets. In cases that lead to ambiguous overload resolution, SG16 encourages investigation into how such ambiguity can be mitigated; perhaps through the use of constrained function template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++29 Targeted at C++29 IS Ship vehicle: IS LEWG Library Evolution size - medium paper size estimate
Projects
None yet
Development

No branches or pull requests

3 participants