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>
This commit is contained in:
Giuseppe D'Angelo 2019-05-02 18:14:20 +02:00
parent 0d39cf6865
commit 1b16f79bf2

View File

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