Questions tagged [bitsets]

DO NOT USE: use bitset instead

18 questions
0
votes
1 answer

dynamic_bit set print?

std::string charBuff = "11010"; dbitset = boost::dynamic_bitset (charBuff); for (boost::dynamic_bitset<>::size_type i = 0; i < dbitset.size(); ++i) { std::cout << dbitset[i]; } It prints from the LSB to MSB. Output: 01011. What…
kal
  • 28,545
  • 49
  • 129
  • 149
0
votes
2 answers

How to assign bitset value from a string after initializaion

I know it is possible to initialize bitsets using an integer or a string of 0s and 1s as below: bitset<8> myByte (string("01011000")); // initialize from string Is there anyway to change value of a bitset using an string as above after…
dahma
  • 75
  • 2
  • 6
0
votes
5 answers

Why not implement BitSet with a more size-deterministic type?

The Java reference here indicates that boolean types, while represented with a "bit" of information, do not have a precisely defined size. In contrast, other types seem to suggest that the size is defined. For example, an int is 32-bits, end of…
Kirby
  • 3,649
  • 3
  • 26
  • 28
1
2