basic_string::npos
From: Gene Wirchenko (gwirchenkoEXCEPT_at_CAPITALSwencomine.com)
Date: 10/30/03
- Next message: John: "templated class in microsoft visual c++ 7.0"
- Previous message: Martin: "Re: Accelerated C++ Answer Key"
- Next in thread: Derek Baker: "Re: basic_string::npos"
- Reply: Derek Baker: "Re: basic_string::npos"
- Reply: Gene Wirchenko: "Re: basic_string::npos"
- Reply: Andrey Tarasevich: "Re: basic_string::npos"
- Reply: Micah Cowan: "Re: basic_string::npos"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Oct 2003 21:48:27 GMT
In the documentation that is a cruel joke department, we have:
Supposedly string.find() returns basic_string::npos if the search
string is not found. What is this value? The docs I have state:
"basic_string::max_size
size_type max_size() const;
The member function returns the length of the longest sequence that
the object can control.
basic_string::npos
static const size_type npos = -1;
The constant is the largest representable value of type size_type. It
is assuredly larger than max_size(), hence it serves as either a very
large value or as a special code."
1) -1 is assuredly larger than the length of the longest sequence
that a string can control?
2) Despite
#include <string>
I am not able to refer to this value anyway.
What is the correct data, please?
Sincerely,
Gene Wirchenko
- Next message: John: "templated class in microsoft visual c++ 7.0"
- Previous message: Martin: "Re: Accelerated C++ Answer Key"
- Next in thread: Derek Baker: "Re: basic_string::npos"
- Reply: Derek Baker: "Re: basic_string::npos"
- Reply: Gene Wirchenko: "Re: basic_string::npos"
- Reply: Andrey Tarasevich: "Re: basic_string::npos"
- Reply: Micah Cowan: "Re: basic_string::npos"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|