summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-13 19:05:05 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-14 17:31:44 +0000
commitcfeb09fcc8a0e342ffb7f260787b20856c5ae22c (patch)
tree3bd9307f4b7e439706250a05dddaccc9bfeed8af /src/corelib/tools
parent1df98e6bb9d0319fb9cdfb46b689cc882a775a78 (diff)
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>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qshareddata.h5
1 files changed, 3 insertions, 2 deletions
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 T> class QSharedDataPointer