[RFC] Strange line at the end of _M_mutate

Paolo Carlini pcarlini@unitus.it
Sun Dec 16 11:54:00 GMT 2001


Nathan Myers wrote:

> The first comment is obsolete; the requirement is now that _CharT()
> appear whenever s[s.size()] is examined, regardless of the cost.
>
> The only saving grace is that the effect of actually storing a non-null
> there is undefined, and is allowed to crash their program.  In practice,
> we probably have to sprinkle checks in various places to throw if we
> find it violated.  I hope this doesn't mean checking every iterator
> and indexing operation.

Thanks for your interesting reply. Therefore, in particular, if I understand
well what you are saying:
1- My two additional testcases for assign are ok (_M_mutate did put that
_CharT() too early in the _Rep before the recent changes to the library).
2- We should carefully check that, anytime the lenght of a string changes, a
_CharT() goes with that. In particular the new pair of assign, should be amended
in this way for the "work in place" case.

Agreed?

Thanks again,
Paolo.




More information about the Libstdc++ mailing list