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()) {