ConstantRNG should implement UniformRandomBitGenerator
authorChristopher Dykes <cdykes@fb.com>
Fri, 1 Jul 2016 05:01:48 +0000 (22:01 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Fri, 1 Jul 2016 05:08:23 +0000 (22:08 -0700)
Summary: As per http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator it was almost there, except that `min()` and `max()` need to be static members.

Reviewed By: yfeldblum

Differential Revision: D3507595

fbshipit-source-id: 5e0b321c477e37ab8a3487ad643caa83cc6cfc9d

folly/test/RandomTest.cpp

index 69447872efdd0b5e23166025c6b15fda56483941..984b3593de2b2762ff42a96a845df1d9d3089e33 100644 (file)
@@ -55,10 +55,10 @@ TEST(Random, FixedSeed) {
       return 4; // chosen by fair dice roll.
                 // guaranteed to be random.
     }
-    result_type min() {
+    static result_type min() {
       return std::numeric_limits<result_type>::min();
     }
-    result_type max() {
+    static result_type max() {
       return std::numeric_limits<result_type>::max();
     }
   };