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

RNG refactoring #2459

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

RNG refactoring #2459

wants to merge 3 commits into from

Conversation

DNKpp
Copy link

@DNKpp DNKpp commented Feb 17, 2021

As already discussed on discord, the current workflow of locking and unlocking rng seems quite dirty. My solution is wrapping the rng in a simple polymorphic adapter class, which let's us exchange the behavior during runtime (e.g. for tests).
I also added a simple ScopedRNGWrapper class, which will exchange the current global rng with a newly created one and exchanges it back on destruction.

Finally I added some test cases.

@Ghabry
Copy link
Member

Ghabry commented Feb 17, 2021

Jenkins: Test this please

@DNKpp
Copy link
Author

DNKpp commented Feb 17, 2021

Well, I've mixed up the c++ versions. Most _v type_trait suffixes are from c++17. Questions is, when do you plan upgrading version? If it's planned for the near future I'll simply wait and instead upgrading the other parts to c++17 .

@fdelapena fdelapena added the Awaiting Rebase Pull requests with conflicting files due to former merge label Mar 23, 2021
@carstene1ns carstene1ns marked this pull request as draft April 24, 2022 13:05
@carstene1ns
Copy link
Member

Since we do use c++17 now, this should be looked at again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Rebase Pull requests with conflicting files due to former merge Enhancement
Development

Successfully merging this pull request may close these issues.

4 participants