From 55dfeedc463694b2617dbf4f737de5011a5223cd Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Wed, 28 Feb 2024 18:45:17 -0700 Subject: [PATCH] LibGfx: Add VectorN::operator== --- Userland/Libraries/LibGfx/VectorN.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Userland/Libraries/LibGfx/VectorN.h b/Userland/Libraries/LibGfx/VectorN.h index 7f6ad2a82d..80bf5e1be9 100644 --- a/Userland/Libraries/LibGfx/VectorN.h +++ b/Userland/Libraries/LibGfx/VectorN.h @@ -197,6 +197,17 @@ public: return result; } + template U> + constexpr bool operator==(VectorN const& other) const + { + UNROLL_LOOP + for (auto i = 0u; i < N; ++i) { + if (m_data[i] != static_cast(other.m_data[i])) + return false; + } + return true; + } + [[nodiscard]] constexpr T dot(VectorN const& other) const { T result {};