File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ class prevector {
65
65
iterator operator --(int ) { iterator copy (*this ); --(*this ); return copy; }
66
66
difference_type friend operator -(iterator a, iterator b) { return (&(*a) - &(*b)); }
67
67
iterator operator +(size_type n) const { return iterator (ptr + n); }
68
+ iterator friend operator +(size_type n, iterator x) { return x + n; }
68
69
iterator& operator +=(size_type n) { ptr += n; return *this ; }
69
70
iterator operator -(size_type n) const { return iterator (ptr - n); }
70
71
iterator& operator -=(size_type n) { ptr -= n; return *this ; }
@@ -116,6 +117,7 @@ class prevector {
116
117
const_iterator operator --(int ) { const_iterator copy (*this ); --(*this ); return copy; }
117
118
difference_type friend operator -(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
118
119
const_iterator operator +(size_type n) const { return const_iterator (ptr + n); }
120
+ const_iterator friend operator +(size_type n, const_iterator x) { return x + n; }
119
121
const_iterator& operator +=(size_type n) { ptr += n; return *this ; }
120
122
const_iterator operator -(size_type n) const { return const_iterator (ptr - n); }
121
123
const_iterator& operator -=(size_type n) { ptr -= n; return *this ; }
You can’t perform that action at this time.
0 commit comments