This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Add symmetric operator+ to random_access_iterator_wrapper
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Christopher Jefferson <caj at cs dot york dot ac dot uk>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 19 Apr 2005 17:37:35 +0100
- Subject: Re: Add symmetric operator+ to random_access_iterator_wrapper
- References: <20050418151844.GA69028@compsoc.man.ac.uk> <42653218.40702@cs.york.ac.uk>
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