diff options
| author | Norbert Nopper <norbert@nopper.tv> | 2025-01-28 12:10:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-28 11:10:12 +0000 |
| commit | a5b1aa08e05eb4b24b28b60a1cd10875353a9a92 (patch) | |
| tree | b4182b7558384ae77e99400330bb0e9306b55c2d /prelude | |
| parent | 92a48f6003254fc0c9323353eafed06596326232 (diff) | |
Added const version for the operator[] in Matrix (#6186)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'prelude')
| -rw-r--r-- | prelude/slang-cpp-types-core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/prelude/slang-cpp-types-core.h b/prelude/slang-cpp-types-core.h index 6c0bb7544..1f8f5bd80 100644 --- a/prelude/slang-cpp-types-core.h +++ b/prelude/slang-cpp-types-core.h @@ -392,6 +392,7 @@ template<typename T, int ROWS, int COLS> struct Matrix { Vector<T, COLS> rows[ROWS]; + const Vector<T, COLS>& operator[](size_t index) const { return rows[index]; } Vector<T, COLS>& operator[](size_t index) { return rows[index]; } Matrix() = default; Matrix(T scalar) |
