From cfeb09fcc8a0e342ffb7f260787b20856c5ae22c Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 13 May 2019 19:05:05 +0200 Subject: 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 --- src/corelib/tools/qshareddata.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qshareddata.h') diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index 16bbc88143..816583c766 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -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 QSharedDataPointer -- cgit v1.2.3