diff options
author | Liang Qi <liang.qi@qt.io> | 2017-12-08 13:56:16 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-12-08 13:56:17 +0100 |
commit | 812bb236dd1622896b6a0ca9bbe1334a69855aa2 (patch) | |
tree | 94031beabaf904e2380740cec8951b3c1152203c /src/corelib/global/qrandom.h | |
parent | 79d78d814acad4e183e281aea9b131f396abe3fb (diff) | |
parent | 50117d738af526cbfbd5afa50b9a501acb0fb9ce (diff) |
Merge remote-tracking branch 'origin/5.10.0' into 5.10
Change-Id: I6dcf85067ec226136c207ea69ca9d66736c84db5
Diffstat (limited to 'src/corelib/global/qrandom.h')
-rw-r--r-- | src/corelib/global/qrandom.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h index bde64646a4..cbeab19a7b 100644 --- a/src/corelib/global/qrandom.h +++ b/src/corelib/global/qrandom.h @@ -55,10 +55,10 @@ public: QRandomGenerator(quint32 seedValue = 1) : QRandomGenerator(&seedValue, 1) {} - template <qssize_t N> QRandomGenerator(const quint32 (&seedBuffer)[N]) + template <qsizetype N> QRandomGenerator(const quint32 (&seedBuffer)[N]) : QRandomGenerator(seedBuffer, seedBuffer + N) {} - QRandomGenerator(const quint32 *seedBuffer, qssize_t len) + QRandomGenerator(const quint32 *seedBuffer, qsizetype len) : QRandomGenerator(seedBuffer, seedBuffer + len) {} Q_CORE_EXPORT QRandomGenerator(std::seed_seq &sseq) Q_DECL_NOTHROW; @@ -131,7 +131,7 @@ public: } template <typename UInt, IfValidUInt<UInt> = true> - void fillRange(UInt *buffer, qssize_t count) + void fillRange(UInt *buffer, qsizetype count) { _fillRange(buffer, buffer + count); } @@ -177,7 +177,8 @@ private: friend class QRandomGenerator64; struct SystemGenerator; struct SystemAndGlobalGenerators; - typedef std::mt19937 RandomEngine; + using RandomEngine = std::mersenne_twister_engine<quint32, + 32,624,397,31,0x9908b0df,11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253>; union Storage { uint dummy; @@ -214,10 +215,10 @@ public: QRandomGenerator64(quint32 seedValue = 1) : QRandomGenerator(seedValue) {} - template <qssize_t N> QRandomGenerator64(const quint32 (&seedBuffer)[N]) + template <qsizetype N> QRandomGenerator64(const quint32 (&seedBuffer)[N]) : QRandomGenerator(seedBuffer) {} - QRandomGenerator64(const quint32 *seedBuffer, qssize_t len) + QRandomGenerator64(const quint32 *seedBuffer, qsizetype len) : QRandomGenerator(seedBuffer, len) {} QRandomGenerator64(std::seed_seq &sseq) Q_DECL_NOTHROW |