vendredi 28 juillet 2017

Not getting random list with std::shuffle()?

QStringList outList;
OutList<<"A"<<"B"<<"C"<<"D"<<"E"<<"F";
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(outList.begin(), outList.end(), g);

The outList is aways the same. I thought what I did should make "g" random therefore outList should be random. What am I missing? Thanks.




Aucun commentaire:

Enregistrer un commentaire