This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: [RFC] libstdc++/9817 or "passing C++ strings to C functions"
- From: Pétur Runólfsson <peturr02 at ru dot is>
- To: "Paolo Carlini" <pcarlini at unitus dot it>
- Cc: <libstdc++ at gcc dot gnu dot org>,"Nathan Myers" <ncm at cantrip dot org>,<bkoz at redhat dot com>,<sebor at roguewave dot com>
- Date: Mon, 24 Feb 2003 13:31:35 -0000
- Subject: RE: [RFC] libstdc++/9817 or "passing C++ strings to C functions"
Paolo Carlini wrote:
> >Isn't it possible to use the same strategy? That is break the
> >string into chunks separated by \0, then transform each chunk
> >with strxfrm (again, untested code):
> >
> Interesting.
> Do you believe that proceeding in this way the corresponding
> results are always consistent?
> I mean, collate::transform and then plain string compare always
> give the same result of collate::compare?
Yes, I think I can give a formal proof of this if anybody is
interested (hint: split each string x into zero-terminated
substrings x1, x2, ... xn, then consider the results for each
substring xi), but I would like to at least compile this before
giving a definite answer :-)
By the way, is there a list somewhere of useful future extensions
for glibc that could be used to simplify and speed up libstdc++?
For example, collate would be trivial if there were functions
memcoll and memxfrm with the obvious semantics.
Petur