Skip to content

Commit

Permalink
folly: fix constexpr methods in RandomTest on macos
Browse files Browse the repository at this point in the history
Summary:
the RNG max and min methods must be marked constexpr in order to
compile.  The macos compiler doesn't know to propagate the constexpr-ness from
numeric_limits::max on its own, so we have to be explicit (this also matches
the annotations in ThreadLocalPRNG in Random.h)

Reviewed By: yfeldblum

Differential Revision: D3576189

fbshipit-source-id: e4eeb3361d1c48f582dad5a52e35cae133f007a1
  • Loading branch information
wez authored and Facebook Github Bot 5 committed Jul 16, 2016
1 parent 95fb46d commit 92fd108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions folly/test/RandomTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ TEST(Random, FixedSeed) {
return 4; // chosen by fair dice roll.
// guaranteed to be random.
}
static result_type min() {
static constexpr result_type min() {
return std::numeric_limits<result_type>::min();
}
static result_type max() {
static constexpr result_type max() {
return std::numeric_limits<result_type>::max();
}
};
Expand Down

0 comments on commit 92fd108

Please sign in to comment.