This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug in libstdc++ bitset
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Ed Parcell <ed at edparcell dot com>
- Cc: gcc at gnu dot org
- Date: Mon, 19 Aug 2002 09:30:36 -0400
- Subject: Re: bug in libstdc++ bitset
After changing it to let it compile under 3.x,
#include <bitset>
#include <iostream>
using namespace std;
int main() {
bitset <33> b;
b.set(32);
cout << b << ' ' << b.count() << ' ' << b.none() << '\n';
}
With the current cvs, it compiles fine and outputs:
100000000000000000000000000000000 1 0
which looks to be the right answer.
Thanks,
Andrew Pinski
On Monday, August 19, 2002, at 09:05 , Ed Parcell wrote:
Hi,
Sorry that this is almost definitely the wrong place to send this to.
Anyway, here goes. bitset::none() and bitset::any() appear to only look
at the first word. Here is example code to exhibit this:
#include <bitset>
#include <iostream>
void main() {
bitset <33> b;
b.set(32);
cout << b << ' ' << b.count() << ' ' << b.none() << '\n';
}
I am using libstdc++ in the debian package libstdc++2.10, which has the
description "This is not a final release, but taken from the CVS
gcc-2_95-branch
(dated 2001-10-02)". This bug also occurs on libstdc++3-3.0.1-3 I
believe.
Thanks,
Ed.