delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/31/07:00:29

From: Rodeo Red <rodeored AT netstep DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: compare()
Date: Tue, 31 Oct 2000 06:52:57 -0500
Organization: Church of Evangelical Environmental Extremism
Lines: 51
Message-ID: <2D3CEFEF9F5772C9.21D15067E7ACE130.3275BE6B77FD834E@lp.airnews.net>
X-Orig-Message-ID: <39FEB299 DOT 65CF4E63 AT netstep DOT net>
References: <1F7509A3BB20243A DOT 7FD3AC2DC483DD04 DOT 6BB6DE9721314E90 AT lp DOT airnews DOT net> <39fea8f5 DOT 9349153 AT news DOT freeserve DOT net>
Abuse-Reports-To: support at netstep.net to report improper postings
NNTP-Proxy-Relay: library2.airnews.net
NNTP-Posting-Time: Tue Oct 31 05:44:03 2000
NNTP-Posting-Host: !c.r`-@[.tbfYD2 (Encoded at Airnews!)
Mime-Version: 1.0
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Steamer wrote:
> 
> Rodeo Red wrote:
> 
> > On my djgpp compiler I get the error messages below, and  I thought it
> > might be a compiler specific glitch.  Does anyone know why this does not
> > compile ?  It compares the last three letters of the word with a string.
> 
> The compare() member functions for std::string in GCC's C++ library
> are non-standard.  

What exactly does that mean ? 

I'd guess you are saying that compare() is a standard C++ library
function, except GCC doesn't include all the standard variations, such
as :
int compare(size_type pos1, size_type n1, const basic_string& str)
const; 
but includes other versions, which arent standard, such as:
int compare(const basic_string& str, size_type n1,)  
  

> This should be fixed in GCC 3.0, which is due out
> by the end of the year.  STLport (http://www.stlport.org) would also
> solve the problem - if you can get it to work with DJGPP.
> 
> The code that Stan Moore posted obviously won't work with most C++
> compilers.


Well its not so obvious to me.:)
Let me see if I got this straight
He's using this  form of compare:  
if (( pos3 > 0 ) && (word.compare(ies, pos3)))  

which would match:
int compare(const basic_string& str, size_type n1,)  

Which does not match any compare() function in standard c++ but is
included with djgpp. 

Correct ? 
As you can tell I'm just learning how to understand the prototypes cited
in the error messages and the documentation, so I really would like to
know if I finally am getting it right. 

Red    
If this is right, maybe it means I finaly can follow those long, cryptic
error messages I get when there's no matching function.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019