13 requires std::integral<T> || std::floating_point<T>
15 static std::random_device device{};
16 static std::mt19937_64 engine(device());
17 if constexpr (std::integral<T>) {
18 return std::uniform_int_distribution<T>(lower, upper)(engine);
20 return std::uniform_real_distribution<T>(lower, upper)(engine);
27 template <std::random_access_iterator It>
29 static std::random_device device{};
30 static std::mt19937_64 engine(device());
31 std::shuffle(begin, end, engine);
void shuffle(It begin, It end)
Randomly shuffle the elements in the range [begin, end).
T getRandomNumber(T lower, T upper)
Produces a random number uniformly distributed on the closed interval [lower, upper].