This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Problem using bitset bit access
- To: Meenaradchagan Vishnu <mvishnu at fore dot com>
- Subject: Re: Problem using bitset bit access
- From: Benjamin Kosnik <bkoz at cygnus dot com>
- Date: Mon, 4 Oct 1999 15:00:38 -0700 (PDT)
- cc: libstdc++ at sourceware dot cygnus dot com
Meenaradchagan,
A couple of things.
1) this looks like a bug in the libstdc++ that was shipped w/ egcs-2.95.1
and that is not present in the current libstdc++-v3 distro. These are
separate libraries, with different sources. You may want to use the v-3
snapshots--see
http://sourceware.cygnus.com/libstdc++
2) hash_map is an extension to the standard. You shouldn't need it to
compile, and if you do indeed use it with v-3, you'll need to do
#include <ext/hash_map.h>
not
#include <hash_map.h>
Okay?
-Benjamin
This works for me with current v-3 sources:
#include <iostream>
#include <bitset>
int main()
{
bitset<191> b;
b[1] = 1;
b[2] = 0;
cout << b[1] << endl; // "1"
cout << b[2] << endl; // "0"
}