mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
Fix build with old c++
This commit is contained in:
parent
f201bf05fb
commit
db61f10497
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user