This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] random access iterators: indexing rather than incrementingyields aliasing improvements
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org, Nathan Myers <ncm at cantrip dot org>
- Date: Sun, 28 Sep 2003 15:34:23 +0200
- Subject: Re: [RFC] random access iterators: indexing rather than incrementingyields aliasing improvements
- References: <3F76E252.8070500@unitus.it>
Paolo Carlini wrote:
which basically is about (used in libstdc++ for copy):
for (n = last - first; n > 0; --n)
{
*result = *first;
++first; ++result;
}
vs
for (i = 0; i != n; ++n)
result [n] = first [n];
Sorry, I have blindly reproduced typos present in the
original posting. Of course is:
for (i = 0; i != n; ++i)
result [i] = first [i];
Paolo.