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

LibGfx: Allow non-const indexing into VectorN

This commit is contained in:
Jelle Raaijmakers 2022-08-23 13:07:16 +02:00 committed by Andreas Kling
parent 07ae5514ae
commit 3279c25553

View file

@ -58,7 +58,13 @@ public:
constexpr void set_z(T value) requires(N >= 3) { m_data[2] = value; }
constexpr void set_w(T value) requires(N >= 4) { m_data[3] = value; }
[[nodiscard]] constexpr T operator[](size_t index) const
[[nodiscard]] constexpr T const& operator[](size_t index) const
{
VERIFY(index < N);
return m_data[index];
}
[[nodiscard]] constexpr T& operator[](size_t index)
{
VERIFY(index < N);
return m_data[index];