rand_int() re-creates a random device each time it is called. Change it to use a static random_device, and get random numbers from a random_engine instead of from the device directly. This avoids exhausting entropy, see [1] for details. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94087
13 KiB
13 KiB