@@ -57,7 +57,7 @@ class Iterator {
5757 rows_(mat.rows()),
5858 p_mat_(&mat) {}
5959
60- Iterator operator +(int i) {
60+ Iterator operator +(int i) const {
6161 int posP, iP, jP;
6262 posP = pos ();
6363 posP += i;
@@ -75,17 +75,17 @@ class Iterator {
7575 return *this ;
7676 }
7777
78- Iterator operator -(int i) {
78+ Iterator operator -(int i) const {
7979 int posP, iP, jP;
8080 posP = pos ();
8181 posP -= i;
8282 posToIn (posP, iP, jP);
8383 return Iterator (iP, jP, *p_mat_);
8484 }
8585
86- int operator -(const Iterator &it) { return pos () - it.pos (); }
86+ int operator -(const Iterator &it) const { return pos () - it.pos (); }
8787
88- bool operator <(const Iterator &it) {
88+ bool operator <(const Iterator &it) const {
8989 if (j_ < it.j_ ) {
9090 return true ;
9191 } else if (j_ > it.j_ ) {
@@ -97,14 +97,14 @@ class Iterator {
9797 return false ;
9898 }
9999
100- bool operator ==(const Iterator &it) {
100+ bool operator ==(const Iterator &it) const {
101101 if (i_ == it.i_ && j_ == it.j_ )
102102 return true ;
103103 else
104104 return false ;
105105 }
106106
107- bool operator >(const Iterator &it) {
107+ bool operator >(const Iterator &it) const {
108108 if (j_ > it.j_ ) {
109109 return true ;
110110 } else if (j_ > it.j_ ) {
@@ -116,15 +116,15 @@ class Iterator {
116116 return false ;
117117 }
118118
119- bool operator >=(const Iterator &it) {
119+ bool operator >=(const Iterator &it) const {
120120 if (!(*this < it)) {
121121 return true ;
122122 }
123123
124124 return false ;
125125 }
126126
127- bool operator !=(const Iterator &it) {
127+ bool operator !=(const Iterator &it) const {
128128 if (i_ != it.i_ || j_ != it.j_ )
129129 return true ;
130130 else
0 commit comments