From 332aee2f8861bac3504b6022422a2146f889b143 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 14 Jun 2019 10:15:08 +0000 Subject: [PATCH] exposed non-const getValueAt() and operator[] in Array.hpp --- qse/include/qse/cmn/Array.hpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/qse/include/qse/cmn/Array.hpp b/qse/include/qse/cmn/Array.hpp index 80199593..48b22e96 100644 --- a/qse/include/qse/cmn/Array.hpp +++ b/qse/include/qse/cmn/Array.hpp @@ -397,14 +397,11 @@ public: return INVALID_INDEX; } - // i don't want expose a non-const accessor as i don't like - // a proper update procesure to be skipped. - // use setValueAt() or update() to modify the existing element. - //T& operator[] (qse_size_t index) - //{ - // QSE_ASSERT (index < this->count); - // return this->buffer[index]; - //} + T& operator[] (qse_size_t index) + { + QSE_ASSERT (index < this->count); + return this->buffer[index]; + } const T& operator[] (qse_size_t index) const { @@ -412,14 +409,11 @@ public: return this->buffer[index]; } - // i don't want expose a non-const accessor as i don't like - // a proper update procesure to be skipped. - // use setValueAt() or update() to modify the existing element. - //T& getValueAt (qse_size_t index) - //{ - // QSE_ASSERT (index < this->count); - // return this->buffer[index]; - //} + T& getValueAt (qse_size_t index) + { + QSE_ASSERT (index < this->count); + return this->buffer[index]; + } const T& getValueAt (qse_size_t index) const {