Re: basic_string::npos

From: Gene Wirchenko (gwirchenkoEXCEPT_at_CAPITALSwencomine.com)
Date: 10/30/03


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



Relevant Pages

  • Re: basic_string::npos
    ... "Gene Wirchenko" wrote in message ... > In the documentation that is a cruel joke department, ... > string is not found. ... > the object can control. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: basic_string::npos
    ... > string is not found. ... > The member function returns the length of the longest sequence that ... > the object can control. ... > I am not able to refer to this value anyway. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: CreateEventProc error
    ... Private Sub BuildDisplayForm(strPath As String, ... Dim qdf As QueryDef, qdfControls As QueryDef ... Dim ctl As Control, ctlLabel As Control, ctlParent As Control ... Dim strFilter As String, strSuffix As String, strParentName As String, ...
    (microsoft.public.access.forms)
  • Having trouble with multi-select list box in Access
    ... Const mstrcRange_Begin As String ... name of a control that represents the End part of a range ... On Error GoTo ErrHandler ...
    (microsoft.public.access.gettingstarted)
  • Re: All Menu Navigation
    ... i based the implementation on sample code from http://www.asp.net/CSSAdapters/Menu.aspx, which shows how to create decent HTML for a Menu control bound to a SiteMapDataSource. ... public void RenderBeginTag(HtmlTextWriter writer, string cssClass) ... static public void RemoveProblemTypes ...
    (microsoft.public.dotnet.framework.aspnet)