random
library.
.entropy()
member function
random_device seedDevice int seed if (seedDevice.entropy() > 0) { seed = seedDevice(); } else { seed = time(null); }
uniform_int_distribution
or uniform_real_distribution
uniform_int_distribution<int> uniformIntDistribution{1,20}; uniform_real_distribution<double> uniformRealDistribution{1.0, 21.0};
cout << uniformIntDistribution(engine) << endl;
uniform_int_distribution<int> uniformIntDistribution{1,20}; auto uniformIntGenerator{bind(uniformIntDistribution, engine)};
uniformIntGenerator
is callable as a function
cout << uniformIntGenerator() << endl;