From dc21a8ea5156de3db88f71d1a240e4285242b3ee Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 16 Sep 2025 19:12:25 +0300 Subject: [PATCH] update random.hpp --- src/util/random.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/random.hpp b/src/util/random.hpp index fc79317d..075d5aa7 100644 --- a/src/util/random.hpp +++ b/src/util/random.hpp @@ -5,10 +5,10 @@ #include namespace util { - template - typename std::enable_if::type seeded_random_engine( - std::random_device& source - ) { + template < + class T = std::mt19937, + std::size_t N = T::state_size * sizeof(typename T::result_type)> + auto seeded_random_engine(std::random_device& source) { std::random_device::result_type randomData[(N - 1) / sizeof(source()) + 1]; std::generate(std::begin(randomData), std::end(randomData), std::ref(source)); std::seed_seq seeds(std::begin(randomData), std::end(randomData));