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>
This commit is contained in:
Marc Mutz 2022-01-31 18:16:28 +01:00
parent 724a369308
commit aaa74e8f99

View File

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