This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add symmetric operator+ to random_access_iterator_wrapper


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?

jon

-- 
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
	- M.A. Jackson


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]