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]

[RFC] random access iterators: indexing rather than incrementingyields aliasing improvementsimprovements.


Hi everyone.

I'm reading with interest this discussion thread:

http://groups.google.it/groups?dq=&hl=it&lr=&ie=UTF-8&threadm=9215d7ac.0309262129.3f014cc9%40posting.google.com&prev=/groups%3Fdq%3D%26num%3D25%26hl%3Dit%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.c%252B%252B.moderated%26start%3D25

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];

The author argues in favor of the latter, in particular for
"complex" iterators...

I think Nathan did some benchmarks for pointers to char?!?
But what about other iterators?

Thanks,
Paolo.



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