diff --git a/Userland/Libraries/LibGfx/Matrix.h b/Userland/Libraries/LibGfx/Matrix.h index af7358c017..638ced76f5 100644 --- a/Userland/Libraries/LibGfx/Matrix.h +++ b/Userland/Libraries/LibGfx/Matrix.h @@ -50,7 +50,7 @@ public: constexpr auto elements() const { return m_elements; } constexpr auto elements() { return m_elements; } - constexpr Matrix operator*(Matrix const& other) const + [[nodiscard]] constexpr Matrix operator*(Matrix const& other) const { Matrix product; for (size_t i = 0; i < N; ++i) { @@ -84,7 +84,7 @@ public: return product; } - constexpr Matrix operator+(Matrix const& other) const + [[nodiscard]] constexpr Matrix operator+(Matrix const& other) const { Matrix sum; for (size_t i = 0; i < N; ++i) { @@ -94,7 +94,7 @@ public: return sum; } - constexpr Matrix operator/(T divisor) const + [[nodiscard]] constexpr Matrix operator/(T divisor) const { Matrix division; for (size_t i = 0; i < N; ++i) { @@ -104,7 +104,7 @@ public: return division; } - friend constexpr Matrix operator*(Matrix const& matrix, T scalar) + [[nodiscard]] friend constexpr Matrix operator*(Matrix const& matrix, T scalar) { Matrix scaled; for (size_t i = 0; i < N; ++i) { @@ -114,7 +114,7 @@ public: return scaled; } - friend constexpr Matrix operator*(T scalar, Matrix const& matrix) + [[nodiscard]] friend constexpr Matrix operator*(T scalar, Matrix const& matrix) { return matrix * scalar; }