* Bug in cxx 6.2 basic_string::compare?
@ 2001-01-12 14:16 Jean-Marc Lasgouttes
0 siblings, 0 replies; only message in thread
From: Jean-Marc Lasgouttes @ 2001-01-12 14:16 UTC (permalink / 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-01-12 14:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-12 14:16 Bug in cxx 6.2 basic_string::compare? Jean-Marc Lasgouttes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox