diff options
Diffstat (limited to 'src/corelib/global/qrandom.cpp')
-rw-r--r-- | src/corelib/global/qrandom.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index b276f9445f..fd742898f8 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -377,8 +377,9 @@ struct QRandomGenerator::SystemAndGlobalGenerators struct PRNGLocker { + Q_DISABLE_COPY_MOVE(PRNGLocker) const bool locked; - PRNGLocker(const QRandomGenerator *that) + Q_NODISCARD_CTOR explicit PRNGLocker(const QRandomGenerator *that) : locked(that == globalNoInit()) { if (locked) @@ -647,7 +648,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel \fn bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2) \relates QRandomGenerator - Returns true if the two the two engines \a rng1 and \a rng2 are at the same + Returns true if the two engines \a rng1 and \a rng2 are at the same state or if they are both reading from the operating system facilities, false otherwise. */ @@ -655,7 +656,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel /*! \fn bool QRandomGenerator::operator!=(const QRandomGenerator &rng1, const QRandomGenerator &rng2) - Returns \c true if the two the two engines \a rng1 and \a rng2 are at + Returns \c true if the two engines \a rng1 and \a rng2 are at different states or if one of them is reading from the operating system facilities and the other is not, \c false otherwise. */ @@ -765,7 +766,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel */ /*! - \fn template <typename UInt> void QRandomGenerator::fillRange(UInt *buffer, qsizetype count) + \fn template <typename UInt, QRandomGenerator::IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt *buffer, qsizetype count) Generates \a count 32- or 64-bit quantities (depending on the type \c UInt) and stores them in the buffer pointed by \a buffer. This is the most @@ -781,7 +782,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel */ /*! - \fn template <typename UInt, size_t N> void QRandomGenerator::fillRange(UInt (&buffer)[N]) + \fn template <typename UInt, size_t N, QRandomGenerator::IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt (&buffer)[N]) Generates \c N 32- or 64-bit quantities (depending on the type \c UInt) and stores them in the \a buffer array. This is the most efficient way to |