From 6bcd79b997f321678c763b5b8bfec6284202b0c3 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 26 Apr 2026 14:43:57 +0200 Subject: [PATCH] Revert "Derive `operator!=` from `operator==` (#1660)" This reverts commit 993879a2edde50e6cd7da7afa731b194f67bbd1d. --- include/gfx/rgba.hpp | 1 + include/itertools.hpp | 2 ++ include/link/section.hpp | 1 + src/gfx/pal_packing.cpp | 1 + src/gfx/process.cpp | 1 + 5 files changed, 6 insertions(+) diff --git a/include/gfx/rgba.hpp b/include/gfx/rgba.hpp index b86968b9..c87ad1b1 100644 --- a/include/gfx/rgba.hpp +++ b/include/gfx/rgba.hpp @@ -40,6 +40,7 @@ struct Rgba { } bool operator==(Rgba const &rhs) const { return toCSS() == rhs.toCSS(); } + bool operator!=(Rgba const &rhs) const { return !operator==(rhs); } // CGB colors are RGB555, so we use bit 15 to signify that the color is transparent instead // Since the rest of the bits don't matter then, we return 0x8000 exactly. diff --git a/include/itertools.hpp b/include/itertools.hpp index fb3ef59c..0a25c051 100644 --- a/include/itertools.hpp +++ b/include/itertools.hpp @@ -97,6 +97,7 @@ class EnumSeq { EnumT operator*() const { return _value; } bool operator==(Iterator const &rhs) const { return _value == rhs._value; } + bool operator!=(Iterator const &rhs) const { return !operator==(rhs); } }; public: @@ -131,6 +132,7 @@ public: bool operator==(ZipIterator const &rhs) const { return std::get<0>(_iters) == std::get<0>(rhs._iters); } + bool operator!=(ZipIterator const &rhs) const { return !operator==(rhs); } }; // Only needed inside `zip` below. diff --git a/include/link/section.hpp b/include/link/section.hpp index 0fb3ba36..029dc059 100644 --- a/include/link/section.hpp +++ b/include/link/section.hpp @@ -70,6 +70,7 @@ private: SectionT &operator*() const { return *_piece; } bool operator==(Iterator const &rhs) const { return _piece == rhs._piece; } + bool operator!=(Iterator const &rhs) const { return !operator==(rhs); } }; public: diff --git a/src/gfx/pal_packing.cpp b/src/gfx/pal_packing.cpp index 06257f6d..d9e32c0f 100644 --- a/src/gfx/pal_packing.cpp +++ b/src/gfx/pal_packing.cpp @@ -100,6 +100,7 @@ private: AssignedSetsIter() = default; bool operator==(AssignedSetsIter const &rhs) const { return _iter == rhs._iter; } + bool operator!=(AssignedSetsIter const &rhs) const { return !operator==(rhs); } AssignedSetsIter &operator++() { ++_iter; diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index 4d0673ba..1c2c6f44 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -263,6 +263,7 @@ struct Image { } bool operator==(Iterator const &rhs) const { return coords() == rhs.coords(); } + bool operator!=(Iterator const &rhs) const { return !operator==(rhs); } }; public: