Answers for "std::random_device"

C++
0

std::random_device

std::random_device rd;
std::mt19937 e{rd()}; // or std::default_random_engine e{rd()};
std::uniform_int_distribution<int> dist{1, 5};

// get random numbers with:
dist(e);
Posted by: Guest on November-06-2020

Browse Popular Code Answers by Language