--- contrib/restricted/thrift/thrift/transport/TSocketPool.cpp (index) +++ contrib/restricted/thrift/thrift/transport/TSocketPool.cpp (working tree) @@ -21,11 +21,13 @@ #include #include +#if __cplusplus >= 201703L +#include +#endif #include using std::pair; -using std::random_shuffle; using std::string; using std::vector; @@ -189,7 +191,13 @@ void TSocketPool::open() { } if (randomize_ && numServers > 1) { - random_shuffle(servers_.begin(), servers_.end()); +#if __cplusplus >= 201703L + 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) {