mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:07:34 +00:00
LibGfx: Allow non-const indexing into VectorN
This commit is contained in:
parent
07ae5514ae
commit
3279c25553
1 changed files with 7 additions and 1 deletions
|
@ -58,7 +58,13 @@ public:
|
||||||
constexpr void set_z(T value) requires(N >= 3) { m_data[2] = value; }
|
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; }
|
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);
|
VERIFY(index < N);
|
||||||
return m_data[index];
|
return m_data[index];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue