17 static std::default_random_engine
engine;
27 engine.seed(std::chrono::system_clock::now().time_since_epoch().count());
31 int range = max - min;
32 auto elem = distributions.find(range);
33 if (elem == distributions.end()) {
34 distributions[range] = std::uniform_int_distribution<int>(0, range);
35 return distributions[range](
engine) + min;
37 return std::get<1>(*elem)(
engine) + min;
static std::default_random_engine engine
#define assertGreaterThan(x, y)
int randomInteger(int max, int min)
static std::map< int, std::uniform_int_distribution< int > > distributions
static bool engineIsSeeded
Random number generation.