summaryrefslogtreecommitdiff
path: root/src/SimpleRandomizer.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-28 22:00:37 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-28 22:00:37 +0900
commit986f69e5bf3caad104bcb20a07ceaaee79182e49 (patch)
tree1b5fd5cb2eacddc7a80db3b05769ab170f68a1aa /src/SimpleRandomizer.h
parent44479c910ecc89304fccea98b0ce0bed5d3e3801 (diff)
SimpleRandomizer: Use std::random
Diffstat (limited to 'src/SimpleRandomizer.h')
-rw-r--r--src/SimpleRandomizer.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/SimpleRandomizer.h b/src/SimpleRandomizer.h
index 7e0afad9..fce68696 100644
--- a/src/SimpleRandomizer.h
+++ b/src/SimpleRandomizer.h
@@ -38,6 +38,7 @@
#include "Randomizer.h"
#include <memory>
+#include <random>
#ifdef __MINGW32__
# include <wincrypt.h>
@@ -51,17 +52,19 @@ private:
#ifdef __MINGW32__
HCRYPTPROV cryProvider_;
-#endif //__MINGW32__
+#else // !__MINGW32__
+ std::minstd_rand eng_;
+#endif //!__MINGW32__
SimpleRandomizer();
public:
static const std::unique_ptr<SimpleRandomizer>& getInstance();
- static void init();
-
virtual ~SimpleRandomizer();
+ void init();
+
virtual long int getRandomNumber() CXX11_OVERRIDE;
virtual long int getMaxRandomNumber() CXX11_OVERRIDE;