New STL implementation from SGI
Joe Buck
jbuck@synopsys.com
Mon Jul 13 15:28:00 GMT 1998
> What is the purpose of reference-counted strings?
In many applications, they are reasonably fast.
> For portable code, one cannot depend on fast copy-operations ...
meaning that if egcs uses a reference-counted string class, people moving
from a class that works like Microsoft CString (always deep copy) will
see a speedup. In practice, since the committee said nothing about speed,
people who need speed can't use the standard string class at all; they
would need to design a custom class or else specifically choose which
class to use on a per-platform basis.
> and if one writes code especially for egcs, rope is better anyway.
Not always. For many operations where the current egcs string, or the SGI
string, are O(1), rope is O(log(N)). See the SGI documentation on rope
for a discussion. Some rope operations are slow. But rope will run on
many compilers, not just egcs, so using rope isn't that unportable.
More information about the Gcc
mailing list