From: John Nagle (nagle_at_[hidden])
Date: 2004-05-30 14:21:02


   I've done some cleanup on my version of fixed_string at

    http://www.animats.com/source

This now conforms to Dunn's decision on length, i.e.

    "fixed_string<char,4> s" now has space for four characters
plus a trailing null.

    I decided that "operator[]" had to let users reach the
trailing null without a subscript error, so that the classic
C idiom of a loop stopped by the trailing null

        for (i=0; s[i]; i++)

would still work. Because "operator[]" can't tell a read from
a write, this offers the possibility of overstoring the
trailing null. But c_str() will always reset the trailing
null if necessary.

    The functions of fixed_string are now all accessable
via fixed_string_base, as virtual functions, which was
an ommission in the previous version.

    "insert", "erase", and the various substring functions
still aren't in. Soon.

    We're approaching convergence on this.

                                John Nagle
                                Animats