summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Matrix.h
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-12-30 07:42:16 +0100
committerAndreas Kling <kling@serenityos.org>2021-12-30 14:24:29 +0100
commite056cf7e3f32b81ee7d10646a9bbab3fd9692c74 (patch)
tree090044f8cc86fdfe494470a2a48bd061daccbe8c /Userland/Libraries/LibGfx/Matrix.h
parent57e1dc776558bc62067f9e027a00ba2f13229fad (diff)
downloadserenity-e056cf7e3f32b81ee7d10646a9bbab3fd9692c74.zip
LibGfx: Mark some `Matrix` functions as `[[nodiscard]]`
Diffstat (limited to 'Userland/Libraries/LibGfx/Matrix.h')
-rw-r--r--Userland/Libraries/LibGfx/Matrix.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGfx/Matrix.h b/Userland/Libraries/LibGfx/Matrix.h
index 8c93956002..427c43b8b9 100644
--- a/Userland/Libraries/LibGfx/Matrix.h
+++ b/Userland/Libraries/LibGfx/Matrix.h
@@ -92,7 +92,7 @@ public:
return division;
}
- constexpr Matrix adjugate() const
+ [[nodiscard]] constexpr Matrix adjugate() const
{
if constexpr (N == 1)
return Matrix(1);
@@ -107,7 +107,7 @@ public:
return adjugate;
}
- constexpr T determinant() const
+ [[nodiscard]] constexpr T determinant() const
{
if constexpr (N == 1) {
return m_elements[0][0];
@@ -122,7 +122,7 @@ public:
}
}
- constexpr T first_minor(size_t skip_row, size_t skip_column) const
+ [[nodiscard]] constexpr T first_minor(size_t skip_row, size_t skip_column) const
{
static_assert(N > 1);
VERIFY(skip_row < N);
@@ -145,7 +145,7 @@ public:
return first_minor.determinant();
}
- constexpr static Matrix identity()
+ [[nodiscard]] constexpr static Matrix identity()
{
Matrix result;
for (size_t i = 0; i < N; ++i) {
@@ -159,14 +159,14 @@ public:
return result;
}
- constexpr Matrix inverse() const
+ [[nodiscard]] constexpr Matrix inverse() const
{
auto det = determinant();
VERIFY(det != 0);
return adjugate() / det;
}
- constexpr Matrix transpose() const
+ [[nodiscard]] constexpr Matrix transpose() const
{
Matrix result;
for (size_t i = 0; i < N; ++i) {