[Fwd: basic_string<> - useless because of its poor performance]
Ryszard Kabatek
Ryszard.Kabatek@softax.pl
Thu Jul 5 23:38:00 GMT 2001
The current implementation of basic_string is to slow to be useful.
BTW. I implemented the current version of _M_mutate and some other
string modification member functions :-)
I can only recommend again to implement a funcntion, like the one below
size_type
get_new_capacity(size_type n,
size_type max_len)
{
if (n > max_len) // OK, we get an exception in _Rep::_S_create
return n;
size_type result = n < 17 ? 32 : 2*n;
return result < max_len ? result : max_len; // Avoiding an exception in _Rep::_S_create
}
that will be called in _M_mutate and perhaps in other places (not in reserve).
I can prepare a patch if you like.
Regards
--
Ryszard Kabatek
More information about the Libstdc++
mailing list