From 5cdbd74e01dff8a48ab4617013e526ad62987b61 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 23 Dec 2025 21:03:16 -0600 Subject: [PATCH] feat(array): add const qualified TSBaseArray::operator[] --- storm/array/TSBaseArray.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storm/array/TSBaseArray.hpp b/storm/array/TSBaseArray.hpp index 11da6a4..0a95d86 100644 --- a/storm/array/TSBaseArray.hpp +++ b/storm/array/TSBaseArray.hpp @@ -19,6 +19,7 @@ class TSBaseArray { // Member functions T& operator[](uint32_t index); + const T& operator[](uint32_t index) const; void CheckArrayBounds(uint32_t index) const; void Constructor(); uint32_t Count() const; @@ -33,6 +34,12 @@ T& TSBaseArray::operator[](uint32_t index) { return this->m_data[index]; } +template +const T& TSBaseArray::operator[](uint32_t index) const { + this->CheckArrayBounds(index); + return this->m_data[index]; +} + template void TSBaseArray::CheckArrayBounds(uint32_t index) const { if (index < this->Count()) {