diff options
author | Rym Bouabid <rym.bouabid@qt.io> | 2024-04-11 12:54:45 +0200 |
---|---|---|
committer | Rym Bouabid <rym.bouabid@qt.io> | 2024-04-12 15:01:38 +0200 |
commit | 7d44817fc06e2eb4f5ff1fbce8e1905652825c05 (patch) | |
tree | 88b4bbde44f075b7a162de9686037986d3e5ce9c /src/corelib/global/qrandom.cpp | |
parent | 4c286d6f6c746d41ad7a95ef1f28d1cccf244649 (diff) |
PRNGLocker: disable copy and move
Axivion (SV61) points out based on Qt-RuleOfThree the lack of copy and
move constructors and operators.
We don't need them, so tell the compiler not to create them.
As a drive-by change mark the constructor as explicit and not
discardable.
Task-number: QTBUG-122619
Pick-to: 6.7 6.5
Change-Id: I466f5cedea427608b434b71fda0d1e50619b9b20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qrandom.cpp')
-rw-r--r-- | src/corelib/global/qrandom.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 21448b8c14..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) |