From 6fe55a79f18ac03c919c1ecbadde19fb2c82681b Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 26 Jul 2022 12:53:28 -0300 Subject: [PATCH] fix: use const qualifier for operator==() and allow other comparisons This fixes an implicit behavior changed by C++17. Signed-off-by: flow --- launcher/QObjectPtr.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/launcher/QObjectPtr.h b/launcher/QObjectPtr.h index 57974939..173dc5e7 100644 --- a/launcher/QObjectPtr.h +++ b/launcher/QObjectPtr.h @@ -77,10 +77,12 @@ public: { return m_ptr; } - bool operator==(const shared_qobject_ptr& other) { + template + bool operator==(const shared_qobject_ptr& other) const { return m_ptr == other.m_ptr; } - bool operator!=(const shared_qobject_ptr& other) { + template + bool operator!=(const shared_qobject_ptr& other) const { return m_ptr != other.m_ptr; }