From 986f69e5bf3caad104bcb20a07ceaaee79182e49 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 Sep 2013 22:00:37 +0900 Subject: SimpleRandomizer: Use std::random --- src/SimpleRandomizer.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/SimpleRandomizer.h') 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 +#include #ifdef __MINGW32__ # include @@ -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& getInstance(); - static void init(); - virtual ~SimpleRandomizer(); + void init(); + virtual long int getRandomNumber() CXX11_OVERRIDE; virtual long int getMaxRandomNumber() CXX11_OVERRIDE; -- cgit