This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/19911] New: Using std::string find the n field always causes nothing to be found
- From: "grogers at cray dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2005 20:31:56 -0000
- Subject: [Bug libstdc++/19911] New: Using std::string find the n field always causes nothing to be found
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This is for all flavors of find.
According to the documentation I can find.
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char **argv)
{
string test("this should be a bunch of words");
size_t p = test.find("s"); // correct at 3
cerr << "p = " << p << ", npos = " << string::npos << endl;
p = test.find("s", 5); // correct at 5
cerr << "p = " << p << ", npos = " << string::npos << endl;
p = test.find("s", 5, 5); // incorrect, should be 5 is npos
cerr << "p = " << p << ", npos = " << string::npos << endl;
}
--
Summary: Using std::string find the n field always causes nothing
to be found
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grogers at cray dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19911