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.5 Change-Id: I466f5cedea427608b434b71fda0d1e50619b9b20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7d44817fc06e2eb4f5ff1fbce8e1905652825c05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8aae3bd438
commit
c304f45b54
@ -377,8 +377,9 @@ struct QRandomGenerator::SystemAndGlobalGenerators
|
|||||||
|
|
||||||
struct PRNGLocker
|
struct PRNGLocker
|
||||||
{
|
{
|
||||||
|
Q_DISABLE_COPY_MOVE(PRNGLocker)
|
||||||
const bool locked;
|
const bool locked;
|
||||||
PRNGLocker(const QRandomGenerator *that)
|
Q_NODISCARD_CTOR explicit PRNGLocker(const QRandomGenerator *that)
|
||||||
: locked(that == globalNoInit())
|
: locked(that == globalNoInit())
|
||||||
{
|
{
|
||||||
if (locked)
|
if (locked)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user