The new C++11 Standard has a whole chapter dedicated to random number generators. But how do I perform the simplest, most common task that used to be coded like this, but wi
I use the following code in my project. 'engine' and 'distribution' can be one of the provided by the library.
#include
#include
#include
...
std::uniform_int_distribution unif;
std::random_device rd;
std::mt19937 engine(rd());
std::function rnd = std::bind(unif, engine);
std::cout << rnd() << '\n';