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>
bb10
Rym Bouabid 2024-04-11 12:54:45 +02:00
parent 4c286d6f6c
commit 7d44817fc0
1 changed files with 2 additions and 1 deletions

View File

@ -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)