QSharedData: code tidies

Add noexcept and honor the RO3 to silence warnings.
In theory this could also be constexpred, but there might
still be compilers we support that do not have constexpr initialization
for atomics...

Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Giuseppe D'Angelo 2019-05-13 19:05:05 +02:00
parent 1df98e6bb9
commit cfeb09fcc8
1 changed files with 3 additions and 2 deletions

View File

@ -61,11 +61,12 @@ QSharedData
public:
mutable QAtomicInt ref;
inline QSharedData() : ref(0) { }
inline QSharedData(const QSharedData &) : ref(0) { }
inline QSharedData() noexcept : ref(0) { }
inline QSharedData(const QSharedData &) noexcept : ref(0) { }
// using the assignment operator would lead to corruption in the ref-counting
QSharedData &operator=(const QSharedData &) = delete;
~QSharedData() = default;
};
template <class T> class QSharedDataPointer