diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-31 18:16:28 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-01 01:59:10 +0000 |
commit | aaa74e8f99c91bb877e5f3a8ee4a8b313d2fa133 (patch) | |
tree | 38819722f8e7f6bde73d3853a8462bfdf231841c /src | |
parent | 724a3693085a3e29f3a1c25549e567ce2aacdf9f (diff) |
QWeakPointer: make default ctor constexpr
... and thereby also QPointer's.
Found by applying C++20 constinit around the codebase.
Pick-to: 6.3 6.2
Change-Id: I9f149b2346624ca913c29b796f94ac7d24fe560a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 7b02ffe50a..b29de5f79a 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -571,7 +571,7 @@ public: explicit operator bool() const noexcept { return !isNull(); } bool operator !() const noexcept { return isNull(); } - inline QWeakPointer() noexcept : d(nullptr), value(nullptr) { } + constexpr QWeakPointer() noexcept : d(nullptr), value(nullptr) { } inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; } QWeakPointer(const QWeakPointer &other) noexcept : d(other.d), value(other.value) |