From: lasgoutt@fantomas.inria.fr (Jean-Marc Lasgouttes)
Subject: Bug in cxx 6.2 basic_string::compare?
Date: 12 Jan 2001 14:16:19 GMT [thread overview]
Message-ID: <93n3jj$74j$1@ites.inria.fr> (raw)
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 <string>
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
reply other threads:[~2001-01-12 14:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox