@@ -155,7 +155,7 @@ class r_vector {
155
155
inline bool operator !=(const const_iterator& other) const ;
156
156
inline bool operator ==(const const_iterator& other) const ;
157
157
158
- inline T operator *();
158
+ inline T operator *() const ;
159
159
160
160
friend class writable ::r_vector<T>::iterator;
161
161
@@ -265,7 +265,7 @@ class r_vector : public cpp11::r_vector<T> {
265
265
266
266
inline iterator& operator ++();
267
267
268
- inline proxy operator *();
268
+ inline proxy operator *() const ;
269
269
270
270
using cpp11::r_vector<T>::const_iterator::operator !=;
271
271
@@ -554,7 +554,7 @@ inline typename cpp11::r_vector<T>::const_iterator cpp11::r_vector<T>::find(
554
554
}
555
555
556
556
template <typename T>
557
- inline T r_vector<T>::const_iterator::operator *() {
557
+ inline T r_vector<T>::const_iterator::operator *() const {
558
558
if (data_->is_altrep ()) {
559
559
return buf_[pos_ - block_start_];
560
560
} else {
@@ -586,7 +586,7 @@ r_vector<T>::proxy::proxy(SEXP data, const R_xlen_t index, T* const p, bool is_a
586
586
: data_(data), index_(index), p_(p), is_altrep_(is_altrep) {}
587
587
588
588
template <typename T>
589
- inline typename r_vector<T>::proxy r_vector<T>::iterator::operator *() {
589
+ inline typename r_vector<T>::proxy r_vector<T>::iterator::operator *() const {
590
590
if (data_.is_altrep ()) {
591
591
return proxy (data_.data (), pos_, &buf_[pos_ - block_start_], true );
592
592
} else {
0 commit comments