18 #ifndef PSTORE_SUPPORT_RANDOM_HPP 19 #define PSTORE_SUPPORT_RANDOM_HPP 26 template <
typename Ty>
30 : generator_ (device_ ()) {}
32 Ty
get (Ty max) {
return distribution_ (generator_) % max; }
34 auto const max = std::numeric_limits<Ty>::max ();
35 static_assert (max > Ty (0),
"max must be > 0");
40 std::random_device device_;
41 std::mt19937_64 generator_;
42 std::uniform_int_distribution<Ty> distribution_;
47 #endif // PSTORE_SUPPORT_RANDOM_HPP Definition: random.hpp:27
Definition: nonpod2.cpp:40