lundi 26 octobre 2020

Std::random_device is not a member of std

random_device is not recognized as part of std until I include <bits/stdc++.h>. I want to ask you if there is another solution for this, because i dont really want to include all standard librarys for this purpose.

std::random_device rd;
std::mt19937 gen(rd()); 
std::uniform_int_distribution<> dis(1,5); 
std::cout<<dis(gen);

Aucun commentaire:

Enregistrer un commentaire