Bug in bitset for size > 32 bits
Brad Garcia
bgarcia@laurelnetworks.com
Mon May 29 10:48:00 GMT 2000
gcc 2.95.2, libstdc++ 2.90.8
To reproduce:
#include <bitset>
#include <string>
unsigned long blah()
{
std::bitset<33> bits(std::string("10101010"));
return bits.to_ulong();
}
Gives:
bits/std_bitset.h: In method `long unsigned int _Base_bitset<2,long unsigned int>::_M_do_to_ulong() const':
bits/std_bitset.h:806: instantiated from here
bits/std_bitset.h:264: warning: right shift count >= width of type
Brad Garcia
More information about the Libstdc++
mailing list