Add const equvalent for OpenGL::Vector operator[]

This commit is contained in:
wheremyfoodat 2023-06-10 16:09:13 +03:00
parent df414acc23
commit 48e25870a5
2 changed files with 14 additions and 1 deletions

View file

@ -20,6 +20,7 @@
#pragma once
#include <array>
#include <cassert>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <iostream>
@ -546,7 +547,8 @@ namespace OpenGL {
T& y() { return g(); }
T& z() { return b(); }
T& w() { return a(); }
T& operator[](int index) { return m_storage[index]; }
T& operator[](size_t index) { return m_storage[index]; }
const T& operator[](size_t index) const { return m_storage[index]; }
T& u() { return r(); }
T& v() { return g(); }