I want to randomly select an integer among n numbers, where n is small (say 5). To do this, I am using std::uniform_int_distribution
.
The exact details
As said, I should seed the generator. Notice that the reference does not provide something obvious for a seed.
The working code is here.
Notice, that as mentioned in the answers, mt19937
should be used, for better speed and quality.
Example in first answer here.
Here is another example, found on the internet, that compiles.