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

Update IceUtilInternal::Random implementation to use std::random #1715

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

pepone
Copy link
Member

@pepone pepone commented Jan 23, 2024

No description provided.

@bernardnormier
Copy link
Member

For a follow-up PR: since we call random and generateRandom only a few times (very few), my preference would be to get rid of this IceUtilInternal helper and just use the correct random function where we need it.

std::random_device rd;
std::mt19937 rng(rd());
thread_local static std::random_device rd;
thread_local static std::mt19937 rng(rd());
Copy link
Member

Choose a reason for hiding this comment

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

We can't write this as something like?

thread_local static std::mt19937 rng(std::random_device());

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably, I will check when I do the follow up PR

@pepone pepone merged commit f7eec74 into zeroc-ice:main Jan 23, 2024
18 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.

3 participants