Remove use of deprecated function std::random_shuffle
std::random_shuffle is deprecated in C++14, removed in C++17. Replace
with std::shuffle.
Tested-by: Build Bot
#include <ctype.h>
#include <limits.h>
#include <algorithm>
+#include <random>
#include <string>
using namespace lcb;
@@ -256,7 +257,9 @@ Hostlist::next(bool wrap)
void
Hostlist::randomize()
{
- std::random_shuffle(hosts.begin(), hosts.end());
+ std::random_device rd;
+ std::mt19937 g(rd());
+ std::shuffle(hosts.begin(), hosts.end(), g);
reset_strlist();
}
