1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 06:24:58 +00:00

LibGfx: Add VectorN::operator==

This commit is contained in:
Matthew Olsson 2024-02-28 18:45:17 -07:00 committed by Andreas Kling
parent 44afc8678d
commit 55dfeedc46

View file

@ -197,6 +197,17 @@ public:
return result;
}
template<ConvertibleTo<T> U>
constexpr bool operator==(VectorN<N, U> const& other) const
{
UNROLL_LOOP
for (auto i = 0u; i < N; ++i) {
if (m_data[i] != static_cast<T>(other.m_data[i]))
return false;
}
return true;
}
[[nodiscard]] constexpr T dot(VectorN const& other) const
{
T result {};