From: Wez Furlong Date: Sat, 16 Jul 2016 21:32:38 +0000 (-0700) Subject: folly: fix constexpr methods in RandomTest on macos X-Git-Tag: 2016.07.26~40 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92fd1080ccc6b1d74def6fe4fe85dbafa2d38fc6;p=folly.git folly: fix constexpr methods in RandomTest on macos 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 --- diff --git a/folly/test/RandomTest.cpp b/folly/test/RandomTest.cpp index 984b3593..cc576ae4 100644 --- a/folly/test/RandomTest.cpp +++ b/folly/test/RandomTest.cpp @@ -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::min(); } - static result_type max() { + static constexpr result_type max() { return std::numeric_limits::max(); } };