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 {
6565 iterator operator --(int ) { iterator copy (*this ); --(*this ); return copy; }
6666 difference_type friend operator -(iterator a, iterator b) { return (&(*a) - &(*b)); }
6767 iterator operator +(size_type n) const { return iterator (ptr + n); }
68+ iterator friend operator +(size_type n, iterator x) { return x + n; }
6869 iterator& operator +=(size_type n) { ptr += n; return *this ; }
6970 iterator operator -(size_type n) const { return iterator (ptr - n); }
7071 iterator& operator -=(size_type n) { ptr -= n; return *this ; }
@@ -116,6 +117,7 @@ class prevector {
116117 const_iterator operator --(int ) { const_iterator copy (*this ); --(*this ); return copy; }
117118 difference_type friend operator -(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
118119 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; }
119121 const_iterator& operator +=(size_type n) { ptr += n; return *this ; }
120122 const_iterator operator -(size_type n) const { return const_iterator (ptr - n); }
121123 const_iterator& operator -=(size_type n) { ptr -= n; return *this ; }
You can’t perform that action at this time.
0 commit comments