exposed non-const getValueAt() and operator[] in Array.hpp

This commit is contained in:
hyung-hwan 2019-06-14 10:15:08 +00:00
parent f26ce3bf40
commit 332aee2f88

View File

@ -397,14 +397,11 @@ public:
return INVALID_INDEX; return INVALID_INDEX;
} }
// i don't want expose a non-const accessor as i don't like T& operator[] (qse_size_t index)
// a proper update procesure to be skipped. {
// use setValueAt() or update() to modify the existing element. QSE_ASSERT (index < this->count);
//T& operator[] (qse_size_t index) return this->buffer[index];
//{ }
// QSE_ASSERT (index < this->count);
// return this->buffer[index];
//}
const T& operator[] (qse_size_t index) const const T& operator[] (qse_size_t index) const
{ {
@ -412,14 +409,11 @@ public:
return this->buffer[index]; return this->buffer[index];
} }
// i don't want expose a non-const accessor as i don't like T& getValueAt (qse_size_t index)
// a proper update procesure to be skipped. {
// use setValueAt() or update() to modify the existing element. QSE_ASSERT (index < this->count);
//T& getValueAt (qse_size_t index) return this->buffer[index];
//{ }
// QSE_ASSERT (index < this->count);
// return this->buffer[index];
//}
const T& getValueAt (qse_size_t index) const const T& getValueAt (qse_size_t index) const
{ {