Re: basic_string::npos
From: Gene Wirchenko (gwirchenkoEXCEPT_at_CAPITALSwencomine.com)
Date: 10/30/03
- Next message: Jumbo: "Re: 2-dimensional arrays and functions"
- Previous message: Derek Baker: "Re: basic_string::npos"
- In reply to: Gene Wirchenko: "basic_string::npos"
- Next in thread: Andrey Tarasevich: "Re: basic_string::npos"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Oct 2003 22:25:14 GMT
On Thu, 30 Oct 2003 21:48:27 GMT, Gene Wirchenko
<gwirchenkoEXCEPT@CAPITALSwencomine.com> wrote:
> 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?
This is still a puzzle. There is nothing quite like
documentation that assumes you already know the material.
> 2) Despite
> #include <string>
>I am not able to refer to this value anyway.
Well, I have managed to get this one:
std::wstring::npos
Sincerely,
Gene Wirchenko
- Next message: Jumbo: "Re: 2-dimensional arrays and functions"
- Previous message: Derek Baker: "Re: basic_string::npos"
- In reply to: Gene Wirchenko: "basic_string::npos"
- Next in thread: Andrey Tarasevich: "Re: basic_string::npos"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|