[RFC] libstdc++/9817 or "passing C++ strings to C functions"
pcarlini@unitus.it
pcarlini@unitus.it
Mon Feb 24 10:39:00 GMT 2003
Quoting Pétur Runólfsson <peturr02@ru.is>:
> This breaks the strings into chunks separated by \0 and then
> compares the chunks until it finds a pair that compares unequal,
> or one or both strings are empty. Note that strlen has to be
> called for both strings since strings of different length can
> collate equal.
Hi Petur. I like algorithmically your proposal (I didn't suggest something along
the same lines basically for lazyness ;)
However, I have a major concern: what about the similar issue we have with
collate::transform? collate::compare and collate::transform should be fixed in a
similar way, not only for general consistency sake, but also because they must
be able to work together.
Therefore, probably, if we really want to work around this essential problem in
the use of C collation functions, mine (and Martin's: thanks!) hack seems more
appropriate.
Benjamin? Nathan?
Paolo.
More information about the Libstdc++
mailing list