9 std::unique_ptr<std::random_device> rng_dev(
new std::random_device());
16 std::uniform_int_distribution<int> distribution(min, max);
17 return distribution(self->rng_engine);
An implementation of Rng for C++ using the standard functions from <random>.
BetterRng()
Seeds the rng_engine using std::random_device.
std::default_random_engine rng_engine
static int random_range_impl(Rng *rng, int min, int max)
See Rng::random_range.
A wrapper around random number generators.
int(* random_range)(struct Rng *self, int min, int max)
Generates and returns a value in the range [min; max) (i.e. from min inclusive to max exclusive).