This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

string::rfind() -- empty strings...


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]