Commit b0cbeefa authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Use std::shuffle rather than std::random_shuffle

Summary: Because the latter was removed in C++17, and MSVC no longer supports it.

Reviewed By: yfeldblum

Differential Revision: D9565195

fbshipit-source-id: 7603ac5280ccf540abec296c7c76a43142581eb3
parent f1da3149
......@@ -93,7 +93,7 @@ TEST(EventCount, Simple) {
VLOG(1) << "Using " << ops.size() << " threads: uppers=" << uppers
<< " downers=" << downers << " sem_count=" << count;
std::random_shuffle(ops.begin(), ops.end());
std::shuffle(ops.begin(), ops.end(), std::mt19937(std::random_device()()));
std::vector<std::thread> threads;
threads.reserve(ops.size());
......
......@@ -134,7 +134,8 @@ TEST(TDigest, MergeLargeAsDigests) {
values.push_back(i);
}
// Ensure that the values do not monotonically increase across digests.
std::random_shuffle(values.begin(), values.end());
std::shuffle(
values.begin(), values.end(), std::mt19937(std::random_device()()));
for (int i = 0; i < 10; ++i) {
std::vector<double> unsorted_values(
values.begin() + (i * 100), values.begin() + (i + 1) * 100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment