From f353b025303817b763172e4f6b89ac5042ee03f8 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 17 Feb 2024 11:41:47 +0200 Subject: [PATCH] Since C++20 we no longer need operator!=. --- src/app/puzzle/layout/layoutdef.cpp | 2 ++ src/app/puzzle/layout/layoutdef.h | 7 +++++-- src/libs/vpatterndb/vformula.cpp | 2 ++ src/libs/vpatterndb/vformula.h | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/puzzle/layout/layoutdef.cpp b/src/app/puzzle/layout/layoutdef.cpp index ae28b5ed8..946b5f4b0 100644 --- a/src/app/puzzle/layout/layoutdef.cpp +++ b/src/app/puzzle/layout/layoutdef.cpp @@ -89,8 +89,10 @@ auto VPTransformationOrigon::operator==(const VPTransformationOrigon &origin) co return this->origin == origin.origin && custom == origin.custom; } +#if __cplusplus < 202002L //--------------------------------------------------------------------------------------------------------------------- auto VPTransformationOrigon::operator!=(const VPTransformationOrigon &origin) const -> bool { return !VPTransformationOrigon::operator==(origin); } +#endif diff --git a/src/app/puzzle/layout/layoutdef.h b/src/app/puzzle/layout/layoutdef.h index 376c6ae2d..e316d142a 100644 --- a/src/app/puzzle/layout/layoutdef.h +++ b/src/app/puzzle/layout/layoutdef.h @@ -55,11 +55,14 @@ auto StrToGrainlineType(const QString &string) -> GrainlineType; struct VPTransformationOrigon { - QPointF origin{}; // NOLINT(misc-non-private-member-variables-in-classes) - bool custom{false}; // NOLINT(misc-non-private-member-variables-in-classes) + QPointF origin{}; // NOLINT(misc-non-private-member-variables-in-classes) + bool custom{false}; // NOLINT(misc-non-private-member-variables-in-classes) auto operator==(const VPTransformationOrigon &origin) const -> bool; + +#if __cplusplus < 202002L auto operator!=(const VPTransformationOrigon &origin) const -> bool; +#endif }; #endif // LAYOUTDEF_H diff --git a/src/libs/vpatterndb/vformula.cpp b/src/libs/vpatterndb/vformula.cpp index a4dd6bcba..a594cf926 100644 --- a/src/libs/vpatterndb/vformula.cpp +++ b/src/libs/vpatterndb/vformula.cpp @@ -87,11 +87,13 @@ auto VFormula::operator==(const VFormula &formula) const -> bool d->error == formula.error() && VFuzzyComparePossibleNulls(d->dValue, formula.getDoubleValue()); } +#if __cplusplus < 202002L //--------------------------------------------------------------------------------------------------------------------- auto VFormula::operator!=(const VFormula &formula) const -> bool { return !VFormula::operator==(formula); } +#endif //--------------------------------------------------------------------------------------------------------------------- auto VFormula::GetFormula(FormulaType type) const -> QString diff --git a/src/libs/vpatterndb/vformula.h b/src/libs/vpatterndb/vformula.h index 03f630019..5eab3612c 100644 --- a/src/libs/vpatterndb/vformula.h +++ b/src/libs/vpatterndb/vformula.h @@ -59,7 +59,10 @@ public: ~VFormula(); auto operator==(const VFormula &formula) const -> bool; + +#if __cplusplus < 202002L auto operator!=(const VFormula &formula) const -> bool; +#endif auto GetFormula(FormulaType type = FormulaType::ToUser) const -> QString; void SetFormula(const QString &value, FormulaType type = FormulaType::FromSystem);