This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem using bitset bit access



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"
  }




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]