This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
string::rfind() -- empty strings...
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: string::rfind() -- empty strings...
- From: brent verner <brent at rcfile dot org>
- Date: Fri, 23 Jun 2000 09:34:14 -0400
Following the recent bugfix in basic_string<>::find(..), there is
a (similar) non-compliant behavior in rfind when the searched for
string is an empty string. I deduce the following behavior would be
correct based on the now-compliant behavior of find().
std::string a("str");
std::string b;
int pos;
a.find(b,pos);
//^^^^^^^^^^^ return pos for a.size() < pos => 0, npos otherwise
I'll have a patch as well as a test case for this sometime after work
today. If the behavior described is incorrect, stop me before I f@#$
it up :)
Cheers.
Brent
--
Damon Brent Verner
Cracker JackŪ Certified Professional
brent@rcfile.org, brent@linux1.org