[RFC] Strange line at the end of _M_mutate
Paolo Carlini
pcarlini@unitus.it
Sun Dec 16 14:36:00 GMT 2001
Nathan Myers wrote:
> Sounds good to me. The easy way would be to just copy an extra character,
> and assume it hasn't been poked out. I don't know if that would be best.
Ok. I have committed the two additional testcase.
As regards the extra char, I was in fact thinking of adding it like this
(similarly to what happen inside _M_mutate):
/*
*/
if (__pos >= __newsize)
traits_type::copy(_M_data(), __str._M_data() + __pos, __newsize);
else if (__pos)
traits_type::move(_M_data(), __str._M_data() + __pos, __newsize);
// else nothing (avoid calling move unnecessarily)
_M_rep()->_M_length = __newsize;
_M_data()[__newsize] = _Rep::_S_terminal; <=========
return *this;
}
However, I'm not sure to understand well what do you mean by "...assume it
hasn't been poked out..." Could you please explain in little more detail??
Thanks,
Paolo.
P.S. Given the current state of the compiler, right now I cannot confidently
test new patches.
More information about the Libstdc++
mailing list