From b106dcc786b834c250c74450a66a44a223eb0140 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Tue, 1 Nov 2016 11:24:09 -0700 Subject: [PATCH] uint8_t isn't a valid template argument for uniform_int_distribution Summary: Clang and GCC allow it, but the spec, and MSVC, don't, so use uint16_t instead. Reviewed By: yfeldblum Differential Revision: D4099285 fbshipit-source-id: cdf7ba14b6c00e1bcdfc3650b76e6e4a47a61929 --- folly/test/SparseByteSetTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/test/SparseByteSetTest.cpp b/folly/test/SparseByteSetTest.cpp index 418d797d..180e0ced 100644 --- a/folly/test/SparseByteSetTest.cpp +++ b/folly/test/SparseByteSetTest.cpp @@ -55,10 +55,10 @@ TEST_F(SparseByteSetTest, each) { TEST_F(SparseByteSetTest, each_random) { mt19937 rng; - uniform_int_distribution dist; + uniform_int_distribution dist{lims::min(), lims::max()}; set added; while (added.size() <= lims::max()) { - auto c = dist(rng); + auto c = uint8_t(dist(rng)); EXPECT_EQ(added.count(c), s.contains(c)); EXPECT_EQ(!added.count(c), s.add(c)); added.insert(c); -- 2.34.1