Remove QWeakPointer::operator->

operator-> was only defined if QWEAKPOINTER_ENABLE_ARROW is defined.
However, even in that case it would call QWeakPointer<T>::data, which
does not actually exist. Take this as an indicator that nobody actually
uses operator->, and remove the code completely.
Note that the QWEAKPOINTER_ENABLE_ARROW was not documented, and neither
was operator->.

Change-Id: I2f4aa961a64281542c8c1b248a993e83471c059d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Fabian Kosmale 2021-10-01 09:45:54 +02:00
parent 1bed4a2565
commit 5381f6c877

View File

@ -634,10 +634,6 @@ public:
// std::weak_ptr compatibility:
inline QSharedPointer<T> lock() const { return toStrongRef(); }
#if defined(QWEAKPOINTER_ENABLE_ARROW)
inline T *operator->() const { return data(); }
#endif
template <class X>
bool operator==(const QWeakPointer<X> &o) const noexcept
{ return d == o.d && value == static_cast<const T *>(o.value); }