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: [Patch] Fix libstdc++/12439


Nathan Myers wrote:

else
- {
- *__s = __c;
- ++__s;
- }
+ *__s++ = *__tmp;
}
return __s;
}



This last delta is suboptimal. Post-increment is quite expensive on many iterator types. Code that takes general iterator types should
always use pre-increment. Any use of post-increment where we don't know the iterator type should be considered a performance bug.


Hi. Ok for this. I'd rather prefer not answering in public the other part...

Paolo.


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