Add symmetric operator+ to random_access_iterator_wrapper

Christopher Jefferson caj@cs.york.ac.uk
Tue Apr 19 16:46:00 GMT 2005


Jonathan Wakely wrote:
> On Tue, Apr 19, 2005 at 05:30:16PM +0100, Christopher Jefferson wrote:
> 
> 
>>This patch adds missing overloads to operator+ of 
>>random_access_iterator_wrapper. (Note: This doesn't fix all the errors 
>>Jonathan reported, more patches to follow!)
> 
> 
>>@@ -499,6 +486,37 @@
>>     }
>>    };
>> 
>>+  template<typename T>
>>+    random_access_iterator_wrapper<T>
>>+    operator+(random_access_iterator_wrapper<T> it, ptrdiff_t n)
>>+    {
>>+      random_access_iterator_wrapper<T> tmp = it;
>>+      return tmp += n;
>>+    }
> 
> 
> Since `it' is passed in by value, is `tmp' needed?
> 
Nope.. I'll change it. Thanks :)

Chris



More information about the Libstdc++ mailing list