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

RandomNumberGenerator::result_type should be unsigned #1050

Merged
merged 3 commits into from
Oct 15, 2017
Merged

RandomNumberGenerator::result_type should be unsigned #1050

merged 3 commits into from
Oct 15, 2017

Conversation

sgrottel
Copy link
Contributor

Description

result_type must be unsigned:
http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator

Using a signed type causes an infinite loop working with MS Visual Studio 2017, targetting: v140, WindowsTargetPlatformVersion 10.0.15063.0, Debug, x64

Simply using uint32_t seems sufficient, since the value of max() is small enough.

GitHub Issues

@horenmar
Copy link
Member

That change won't work for Catch master either, as it still has to be backwards compatible with C++98 (which doesn't have <cstdint>).

@sgrottel
Copy link
Contributor Author

Ah. I see. I wasn't aware of that. So, it's unsigned int then, I guess.

@horenmar
Copy link
Member

The last version will work nicely, thanks.

@horenmar horenmar merged commit 296955c into catchorg:master Oct 15, 2017
horenmar pushed a commit that referenced this pull request Oct 31, 2017
`result_type` must be unsigned:
http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator

Using a signed type causes an infinite loop working with MS Visual Studio 2017, targetting: v140, WindowsTargetPlatformVersion 10.0.15063.0, Debug, x64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants