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

LibGfx: Add an indexing operator to Matrix

This commit is contained in:
Matthew Olsson 2024-02-28 18:44:47 -07:00 committed by Andreas Kling
parent 9e502dcfe4
commit 44afc8678d

View file

@ -60,6 +60,10 @@ public:
constexpr auto elements() const { return m_elements; }
constexpr auto elements() { return m_elements; }
// FIXME: Change to multi-arg operator[] once we upgrade to C++23
constexpr auto const& operator()(size_t row, size_t col) const { return m_elements[row][col]; }
constexpr auto& operator()(size_t row, size_t col) { return m_elements[row][col]; }
[[nodiscard]] constexpr Matrix operator*(Matrix const& other) const
{
Matrix product;