From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,6abc61b412883cbe,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-01-12 06:36:07 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!newsfeed.icl.net!news.tele.dk!195.25.12.36!oleane.net!oleane!jussieu.fr!univ-lyon1.fr!news-rocq!fantomas.inria.fr!lasgoutt From: lasgoutt@fantomas.inria.fr (Jean-Marc Lasgouttes) Newsgroups: comp.unix.tru64 Subject: Bug in cxx 6.2 basic_string::compare? Date: 12 Jan 2001 14:16:19 GMT Organization: INRIA Rocquencourt Domaine de Voluceau BP 105 - 78153 Le Chesnay Cedex France Message-ID: <93n3jj$74j$1@ites.inria.fr> NNTP-Posting-Host: fantomas.inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ites.inria.fr 979308979 7315 128.93.11.34 (12 Jan 2001 14:16:19 GMT) X-Complaints-To: usenet@inria.fr NNTP-Posting-Date: 12 Jan 2001 14:16:19 GMT X-Newsreader: xrn 9.02-beta-3 Xref: supernews.google.com comp.unix.tru64:1436 Hello, I am currently using Compaq C++ V6.2-024 for Digital UNIX V4.0F (Rev. 1229) and noticed that the following program aborts in strict_ansi mode: --------- #include using std::string; int main() { string a("a"); string bb("bb"); a.compare(0, 2, bb); return 0; } ------------ >From what I understand, the problem is that basic_string::compare(size_t pos1, size_t n1,const basic_string &str) throws an out_of_range exception when pos1+n1 > length(), whereas my reading of the standard shows that the only requirement is pos1 <= length(). So, is that really a bug, and has it been fixed already? Input appreciated. JMarc -- ------------------------------------------------- Jean-Marc Lasgouttes, Projet MEVAL, INRIA, France e-mail : jean-marc.lasgouttes@inria.fr