{{ message }}
P4037R1: Supporting signed char and unsigned char in random number generation - #6422
Open
Shengxin Pei (TPPPP72) wants to merge 3 commits into
Open
P4037R1: Supporting signed char and unsigned char in random number generation#6422Shengxin Pei (TPPPP72) wants to merge 3 commits into
Shengxin Pei (TPPPP72) wants to merge 3 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
There was a problem hiding this comment.
Pull request overview
Extends <random> support to signed char and unsigned char.
Changes:
- Expands random engine and distribution type constraints.
- Promotes 8-bit values for stream serialization.
- Adds coverage and removes character-casting workarounds.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
Suppressed comments (1)
stl/inc/random:49
- This diagnostic attributes the expanded type set to N4950, but that draft predates P4037R1 and does not permit
unsigned char. Cite P4037R1 (or the current wording) so the diagnostic does not direct users to a contradictory requirement.
"invalid template argument for " #_RandType ": N4950 [rand.req.genl]/1.6 requires one of " \
"unsigned char, unsigned short, unsigned int, unsigned long, or unsigned long long"); \
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
We need to drop silly |
Contributor
Author
Co-authored-by: A. Jiang <de34@live.cn>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Updated internal type constraints to allow signed char and unsigned char in
std::uniform_int_distributionand theoperator<<andoperator>>stream overloads to handle 8-bit integer types properly.Removed unnecessary historical workarounds.
Close #6240