projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c39c808
)
uint8_t isn't a valid template argument for uniform_int_distribution
author
Christopher Dykes
<cdykes@fb.com>
Tue, 1 Nov 2016 18:24:09 +0000
(11:24 -0700)
committer
Facebook Github Bot
<facebook-github-bot-bot@fb.com>
Tue, 1 Nov 2016 18:38:40 +0000
(11:38 -0700)
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
patch
|
blob
|
history
diff --git
a/folly/test/SparseByteSetTest.cpp
b/folly/test/SparseByteSetTest.cpp
index 418d797da525285f36cf38e619c76bfa1d13658f..180e0ced97c30ff822e48520f680672a5becd446 100644
(file)
--- 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<uint
8_t> dist
;
+ uniform_int_distribution<uint
16_t> dist{lims::min(), lims::max()}
;
set<uint8_t> 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);