1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

LibGfx: Make Matrix and VectorN more constexpr-friendly

This allows the copy constructor of Matrix to be called constexpr,
which should allow more values to be compile-time calculated.

Likewise, VectorN.data() is now constexpr so that it can be compile-time
evaluated.
This commit is contained in:
Zaggy1024 2022-09-30 17:38:24 -05:00 committed by Andreas Kling
parent 0994e6964b
commit ba79de0439
2 changed files with 15 additions and 5 deletions

View file

@ -251,8 +251,8 @@ public:
return result;
}
auto& data() { return m_data; }
auto const& data() const { return m_data; }
constexpr auto& data() { return m_data; }
constexpr auto const& data() const { return m_data; }
private:
AK::Array<T, N> m_data;