Skip to content

Commit cf0edad

Browse files
committed
factor out random generator
1 parent 4a4d768 commit cf0edad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cp-algo/random/rng.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#include <chrono>
44
#include <random>
55
namespace cp_algo::random {
6+
std::mt19937_64 gen(
7+
std::chrono::steady_clock::now().time_since_epoch().count()
8+
);
69
uint64_t rng() {
7-
static std::mt19937_64 rng(
8-
std::chrono::steady_clock::now().time_since_epoch().count()
9-
);
10-
return rng();
10+
return gen();
1111
}
1212
}
1313
#endif // CP_ALGO_RANDOM_RNG_HPP

0 commit comments

Comments
 (0)