From 2bfa311636ae736890be9a330137d63af131a9e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 5 Jan 2024 18:12:32 +0100
Subject: [PATCH] C++20 modernization: remove trivial != operator definitions

Those are no longer needed thanks to expression rewriting.
---
 mex/sources/libkorder/sylv/QuasiTriangular.hh | 7 +------
 mex/sources/libkorder/sylv/Vector.cc          | 8 +-------
 mex/sources/libkorder/sylv/Vector.hh          | 8 +-------
 mex/sources/libkorder/tl/equivalence.hh       | 7 +------
 mex/sources/libkorder/tl/gs_tensor.hh         | 7 +------
 mex/sources/libkorder/tl/int_sequence.hh      | 7 +------
 mex/sources/libkorder/tl/symmetry.hh          | 5 -----
 mex/sources/libkorder/tl/tensor.hh            | 7 +------
 8 files changed, 7 insertions(+), 49 deletions(-)

diff --git a/mex/sources/libkorder/sylv/QuasiTriangular.hh b/mex/sources/libkorder/sylv/QuasiTriangular.hh
index a719a0408f..0d7bcf1045 100644
--- a/mex/sources/libkorder/sylv/QuasiTriangular.hh
+++ b/mex/sources/libkorder/sylv/QuasiTriangular.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004-2011 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -245,11 +245,6 @@ public:
   {
     return ptr == it.ptr;
   }
-  bool
-  operator!=(const _Self& it) const
-  {
-    return ptr != it.ptr;
-  }
   _TRef
   operator*() const
   {
diff --git a/mex/sources/libkorder/sylv/Vector.cc b/mex/sources/libkorder/sylv/Vector.cc
index d108c0aac2..1887a62471 100644
--- a/mex/sources/libkorder/sylv/Vector.cc
+++ b/mex/sources/libkorder/sylv/Vector.cc
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004-2011 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -120,12 +120,6 @@ Vector::operator==(const Vector& y) const
   return ConstVector(*this) == y;
 }
 
-bool
-Vector::operator!=(const Vector& y) const
-{
-  return ConstVector(*this) != y;
-}
-
 bool
 Vector::operator<(const Vector& y) const
 {
diff --git a/mex/sources/libkorder/sylv/Vector.hh b/mex/sources/libkorder/sylv/Vector.hh
index 1168ff0bb8..be6d5f378c 100644
--- a/mex/sources/libkorder/sylv/Vector.hh
+++ b/mex/sources/libkorder/sylv/Vector.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004-2011 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -110,7 +110,6 @@ public:
 
   // Exact equality.
   bool operator==(const Vector& y) const;
-  bool operator!=(const Vector& y) const;
   // Lexicographic ordering.
   bool operator<(const Vector& y) const;
   bool operator<=(const Vector& y) const;
@@ -220,11 +219,6 @@ public:
   }
   // Exact equality
   bool operator==(const ConstVector& y) const;
-  bool
-  operator!=(const ConstVector& y) const
-  {
-    return !operator==(y);
-  }
   // Lexicographic ordering
   bool operator<(const ConstVector& y) const;
   bool
diff --git a/mex/sources/libkorder/tl/equivalence.hh b/mex/sources/libkorder/tl/equivalence.hh
index 1ff89fc77c..1cc9e9abe2 100644
--- a/mex/sources/libkorder/tl/equivalence.hh
+++ b/mex/sources/libkorder/tl/equivalence.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -121,11 +121,6 @@ public:
   Equivalence(const Equivalence& e, int i1, int i2);
 
   bool operator==(const Equivalence& e) const;
-  bool
-  operator!=(const Equivalence& e) const
-  {
-    return !operator==(e);
-  }
   [[nodiscard]] int
   getN() const
   {
diff --git a/mex/sources/libkorder/tl/gs_tensor.hh b/mex/sources/libkorder/tl/gs_tensor.hh
index 966ecb1115..69046e3be8 100644
--- a/mex/sources/libkorder/tl/gs_tensor.hh
+++ b/mex/sources/libkorder/tl/gs_tensor.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -81,11 +81,6 @@ public:
   {
     return nvs == td.nvs && sym == td.sym;
   }
-  bool
-  operator!=(const TensorDimens& td) const
-  {
-    return !operator==(td);
-  }
 
   [[nodiscard]] int
   dimen() const
diff --git a/mex/sources/libkorder/tl/int_sequence.hh b/mex/sources/libkorder/tl/int_sequence.hh
index d43d82d8e6..e3af71b3a0 100644
--- a/mex/sources/libkorder/tl/int_sequence.hh
+++ b/mex/sources/libkorder/tl/int_sequence.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -120,11 +120,6 @@ public:
       delete[] data;
   }
   bool operator==(const IntSequence& s) const;
-  bool
-  operator!=(const IntSequence& s) const
-  {
-    return !operator==(s);
-  }
   int&
   operator[](int i)
   {
diff --git a/mex/sources/libkorder/tl/symmetry.hh b/mex/sources/libkorder/tl/symmetry.hh
index 38af83afb5..997d0052ce 100644
--- a/mex/sources/libkorder/tl/symmetry.hh
+++ b/mex/sources/libkorder/tl/symmetry.hh
@@ -131,11 +131,6 @@ public:
   {
     return dim == it.dim && run == it.run;
   }
-  bool
-  operator!=(const symiterator& it)
-  {
-    return !operator==(it);
-  }
 };
 
 /* The class SymmetrySet defines a set of symmetries of the given length
diff --git a/mex/sources/libkorder/tl/tensor.hh b/mex/sources/libkorder/tl/tensor.hh
index 5a326a4fa9..a210bd8898 100644
--- a/mex/sources/libkorder/tl/tensor.hh
+++ b/mex/sources/libkorder/tl/tensor.hh
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2004 Ondra Kamenik
- * Copyright © 2019-2023 Dynare Team
+ * Copyright © 2019-2024 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -155,11 +155,6 @@ public:
     {
       return offset == n.offset;
     }
-    bool
-    operator!=(const index& n) const
-    {
-      return offset != n.offset;
-    }
     [[nodiscard]] const IntSequence&
     getCoor() const
     {
-- 
GitLab