This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
string's operator == fails for empty string
- To: libstdc++ at sources dot redhat dot com
- Subject: string's operator == fails for empty string
- From: Samuel dot Krempp at crans dot ens-cachan dot fr (Samuel Krempp)
- Date: Sat, 4 Nov 2000 07:21:40 +0100
I noticed that the empty string "" is found equal to any string, when using libstdc++-v2.
When using v3 the behaviour is normal.
#include <string>
#include <iostream>
int main() {
using namespace std;
string nawak="Ce g++ fait n\'importe nawak.";
cerr<<nawak<<" is an empty string : "
<< (nawak=="")<<endl;
}
g++ -v
Reading specs from /home/krempp/egcs/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: --prefix=/home/krempp/egcsv2 --enable-shared
gcc version 2.97 20001103 (experimental)
--> says nawak and "" are equal.
While --enable-libstdcxx-v3 says they differ.
--
Sam