Lars Gullik Bjønnes wrote:

| -void Paragraph::setChar(pos_type pos, value_type c)
| -{
| -     text_[pos] = c;
| -}

And why couldn't CT have been handled here?
In principle, it could have been handled here. However, there are good reasons not to do it here.

As you can see, setChar() is only used in one method. This method is broken right now (thus a FIXME) and should be completely rewritten. If I had introduced CT in setChar(...), "pos" of the calling method would have become invalid. Moreover, the result - from a user's perspective - were

<inserted char><deleted char><inserted char><deleted char><inserted char><deleted char><inserted char><deleted char>etc.

This is definitely not the right approach.

Finally, we should make class Paragraph as slim as possible. It is the "gate" to change tracking and there shouldn't be too many similar doors.

Michael

Reply via email to