diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-18 19:31:03 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-18 19:31:03 +0100 |
commit | e206dc1cf625f28149c19eb4dfcbf495ef0efbb4 (patch) | |
tree | bdcc6152dbce14f27a17b1a33814b0f8e365969f /src/random_generator.cpp | |
parent | 3e4d91b6b029374813cfd0900db1fa8984ad7aa3 (diff) |
Diffstat (limited to 'src/random_generator.cpp')
-rw-r--r-- | src/random_generator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/random_generator.cpp b/src/random_generator.cpp index 1f17a88..3fdc2d4 100644 --- a/src/random_generator.cpp +++ b/src/random_generator.cpp @@ -1,6 +1,6 @@ #include "random_generator.hpp" -RandomNumberGenerator::RandomNumberGenerator(unsigned int seed) +RandomNumberGenerator::RandomNumberGenerator(const unsigned int &seed) { this->_generator = std::make_unique<std::mt19937>(seed); } @@ -12,7 +12,8 @@ RandomNumberGenerator::RandomNumberGenerator() this->_generator = std::make_unique<std::mt19937>(random_device()); } -unsigned int RandomNumberGenerator::in_range(unsigned int a, unsigned int b) +unsigned int RandomNumberGenerator::in_range(const unsigned int &a, + const unsigned int &b) const { auto random_distribution = std::uniform_int_distribution<unsigned int>(a, b); |