From f7e935792dd57f9c870e08afba940f6b14b90871 Mon Sep 17 00:00:00 2001
From: AlQuemist <alquemist@Lyriks>
Date: Fri, 20 Sep 2024 14:46:35 +0200
Subject: [PATCH] Sample/Lattice/ISelectionRule: add explicit implementation of
 operator ==

---
 Sample/Lattice/ISelectionRule.cpp | 5 +++++
 Sample/Lattice/ISelectionRule.h   | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Sample/Lattice/ISelectionRule.cpp b/Sample/Lattice/ISelectionRule.cpp
index e276bd34a3b..402b2f6d6cf 100644
--- a/Sample/Lattice/ISelectionRule.cpp
+++ b/Sample/Lattice/ISelectionRule.cpp
@@ -38,3 +38,8 @@ bool SimpleSelectionRule::isEqualTo(const ISelectionRule& isr) const
         return *this == *sr;
     return false;
 }
+
+bool SimpleSelectionRule::operator==(const SimpleSelectionRule& other) const
+{
+    return (m_a == other.m_a && m_b == other.m_b && m_c == other.m_c && m_mod == other.m_mod);
+}
diff --git a/Sample/Lattice/ISelectionRule.h b/Sample/Lattice/ISelectionRule.h
index 446480d9d72..220e9647c8f 100644
--- a/Sample/Lattice/ISelectionRule.h
+++ b/Sample/Lattice/ISelectionRule.h
@@ -29,7 +29,7 @@ public:
 
     virtual bool isEqualTo(const ISelectionRule& isr) const = 0;
 
-    bool operator==(const ISelectionRule&) const = default;
+    bool operator==(const ISelectionRule&) const { return false; }
 };
 
 //! Selection rule (v*q)%modulus!=0, defined by vector v(a,b,c) and modulus.
@@ -45,7 +45,7 @@ public:
 
     bool isEqualTo(const ISelectionRule& isr) const override;
 
-    bool operator==(const SimpleSelectionRule&) const = default;
+    bool operator==(const SimpleSelectionRule& other) const;
 
 private:
     int m_a, m_b, m_c;
-- 
GitLab