Optimal basic_string<>::append
Paolo Carlini
pcarlini@unitus.it
Mon Dec 17 07:43:00 GMT 2001
Hi again,
sorry Ryszard :(
my previous counterexample was flawed: if this != &__str and moreover this
is not shared, __k1 and __k2 *cannot* point inside it !!
Therefore, I think now that your approach is sound. It should spare the
call to reserve anytime this != &__str and could make a sequence of append
faster (notice, however, the the reserve istself, now that the allocation
policy is exponential, does not really reallocates such frequently)
If you manage to prepare and test a patch vs the current mainline it could
be discussed by the list. I could do this for you but not now: I'm hard at
work on other member functions (replace itself, in particular).
Thanks,
Paolo.
More information about the Libstdc++
mailing list