From ee2c3236dd44a0eaa7ee1c34b05939d29ed6a06e Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 29 Oct 2015 11:29:18 -0700 Subject: [PATCH] Fix compilation problem on Windows. char is not a valid template parameter for std::uniform_int_distribution according to the standard. Replacing with int should be just fine. --- tools/write_stress.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/write_stress.cc b/tools/write_stress.cc index d121946dc..c0501faa5 100644 --- a/tools/write_stress.cc +++ b/tools/write_stress.cc @@ -160,7 +160,7 @@ class WriteStress { std::uniform_real_distribution dist(0, 1); auto random_string = [](std::mt19937& r, int len) { - std::uniform_int_distribution char_dist('a', 'z'); + std::uniform_int_distribution char_dist('a', 'z'); std::string ret; for (int i = 0; i < len; ++i) { ret += char_dist(r); @@ -204,7 +204,7 @@ class WriteStress { void PrefixMutatorThread() { std::mt19937 rng(static_cast(FLAGS_seed)); std::uniform_real_distribution dist(0, 1); - std::uniform_int_distribution char_dist('a', 'z'); + std::uniform_int_distribution char_dist('a', 'z'); while (!stop_.load(std::memory_order_relaxed)) { Env::Default()->SleepForMicroseconds(FLAGS_prefix_mutate_period_sec * 1000 * 1000LL);