[PATCH] Assign(_str, _pos, _n) (take2) + benchmarks

Paolo Carlini pcarlini@unitus.it
Sat Dec 15 02:49:00 GMT 2001


Nathan Myers wrote:

> What if pos is zero?  The code as written will work, and will just
> call move() unnecessarily, which on x86 appears to run through the
> loop copying all the characters in place.  I don't know whether it's
> worth optimizing for.

Thanks for your feedback. Indeed, I think that pos == 0 can be a relatively
common case and if move is not sufficiently smart ;-) we'll take care of this!

In a few hours I will submit a next round including also an optimized
assign(const _CharT* __s, size_type __n).

Cheers,
Paolo.




More information about the Libstdc++ mailing list