Skip to content
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

[charconv.syn] Clarify what types match integer-type #6847

Merged
merged 1 commit into from Apr 18, 2024

Conversation

Eisenwave
Copy link
Contributor

@Eisenwave Eisenwave commented Mar 3, 2024

The current wording in [charconv.syn] is confusing at a surface level, but this is purely an editorial problem:

... the implementation provides overloads for all cv-unqualified signed and unsigned integer types and char in lieu of integer-types

Firstly, the reader may ask whether this means:

  • (signed and unsigned integer types) and char, or
  • (signed and unsigned) (integer types and char)

In other words, does this include signed char and unsigned char, or does it include char? However, signed char and unsigned char are already signed/unsigned integer types, so mentioning char separately here would be totally redundant. Only the former interpretation is plausible to me.

Secondly, the reader may ask whether "cv-unqualified" applies to char as well, but this question is totally pointless since char is already cv-unqualified.

Overall, we can reduce mental complexity here by simply putting char in front. Each of these questions has a clear answer (which is why this edit is not normative), but it would be better if those questions were eliminated completely.

@jwakely
Copy link
Member

jwakely commented Mar 3, 2024

Another reason the second interpretation is wrong is just that we never say "signed char" let alone "signed and unsigned char". That would just be very confusing (does it mean char when that happens to be signed/unsigned on a given architecture?)

The types are signed char and unsigned char, not "signed and unsigned char".

So there's no ambiguity here. The change seems harmless though, and maybe clearer.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

Let's do it.

@jensmaurer jensmaurer merged commit 2de1552 into cplusplus:main Apr 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants