From cb7bd0778b28aa71f07f2f76a55b41e54dc2b1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 5 Jan 2024 18:33:24 +0100 Subject: [PATCH] C++20 modernization: drop comparison operators made obsolete by rewriting rules The implicit conversion from Vector to ConstVector, in addition to the rewriting rules and ConstVector::operator<=>, ensure that those are no longer needed. --- mex/sources/libkorder/sylv/Vector.cc | 30 ---------------------------- mex/sources/libkorder/sylv/Vector.hh | 8 -------- 2 files changed, 38 deletions(-) diff --git a/mex/sources/libkorder/sylv/Vector.cc b/mex/sources/libkorder/sylv/Vector.cc index 1972417052..9dad003dbd 100644 --- a/mex/sources/libkorder/sylv/Vector.cc +++ b/mex/sources/libkorder/sylv/Vector.cc @@ -114,36 +114,6 @@ Vector::Vector(mxArray* p) : throw SYLV_MES_EXCEPTION("This is not a dense array of real doubles."); } -bool -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 -{ - return ConstVector(*this) <= y; -} - -bool -Vector::operator>(const Vector& y) const -{ - return ConstVector(*this) > y; -} - -bool -Vector::operator>=(const Vector& y) const -{ - return ConstVector(*this) >= y; -} - void Vector::zeros() { diff --git a/mex/sources/libkorder/sylv/Vector.hh b/mex/sources/libkorder/sylv/Vector.hh index d097ac105b..191dd3b0d0 100644 --- a/mex/sources/libkorder/sylv/Vector.hh +++ b/mex/sources/libkorder/sylv/Vector.hh @@ -109,14 +109,6 @@ public: return s; } - // Exact equality. - bool operator==(const Vector& y) const; - // Lexicographic ordering. - bool operator<(const Vector& y) const; - bool operator<=(const Vector& y) const; - bool operator>(const Vector& y) const; - bool operator>=(const Vector& y) const; - virtual ~Vector() { if (destroy) -- GitLab