diff --git a/util/autovector.h b/util/autovector.h index 7ad4f5bef1e..010d8689586 100644 --- a/util/autovector.h +++ b/util/autovector.h @@ -120,35 +120,20 @@ class autovector { } // -- Reference - reference operator*() { + reference operator*() const { assert(vect_->size() >= index_); return (*vect_)[index_]; } - const_reference operator*() const { - assert(vect_->size() >= index_); - return (*vect_)[index_]; - } - - pointer operator->() { - assert(vect_->size() >= index_); - return &(*vect_)[index_]; - } - - const_pointer operator->() const { + pointer operator->() const { assert(vect_->size() >= index_); return &(*vect_)[index_]; } - reference operator[](difference_type len) { - return *(*this + len); - } - - const_reference operator[](difference_type len) const { + reference operator[](difference_type len) const { return *(*this + len); } - // -- Logical Operators bool operator==(const self_type& other) const { assert(vect_ == other.vect_);