Fix build with old c++

This commit is contained in:
proller 2018-12-10 16:25:04 +03:00 committed by James E. King III
parent f201bf05fb
commit db61f10497

View File

@ -189,9 +189,13 @@ void TSocketPool::open() {
}
if (randomize_ && numServers > 1) {
#if __cplusplus >= 201500L // c++17
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(servers_.begin(), servers_.end(), urng);
#else
std::random_shuffle(servers_.begin(), servers_.end());
#endif
}
for (size_t i = 0; i < numServers; ++i) {