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: [RFC] random access iterators: indexing rather than incrementingyields aliasing improvements


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.


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