diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-02 18:14:20 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-02 19:44:08 +0000 |
commit | 1b16f79bf2a4efa5c8f60ae48adbf563fa819611 (patch) | |
tree | be8861293a35b3b9d891d9aa4f48df1099ffd7d8 /src | |
parent | 0d39cf6865301c96b69cfdc0df587f5962252e8e (diff) |
QSharedData: delete the copy assignment operator
Do not merely declare it as private, use C++11's = delete.
This has the nice side effect that subclasses are no longer
implicitly copy assignable either (they shouldn't be).
Change-Id: Icd03f71006c31baf7d079365fa3bea1a2a9d559b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qshareddata.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index 04051472d6..c29a509209 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -60,9 +60,8 @@ public: inline QSharedData() : ref(0) { } inline QSharedData(const QSharedData &) : ref(0) { } -private: // using the assignment operator would lead to corruption in the ref-counting - QSharedData &operator=(const QSharedData &); + QSharedData &operator=(const QSharedData &) = delete; }; template <class T> class QSharedDataPointer |