bounds checking in bitset.

BHARAT JOSHI bharatj@students.iiit.net
Fri Feb 3 22:18:00 GMT 2006


The bounds checking/exceptions in bitset does not seem to work. I used gcc 
3.4.2 on a FC3 system and also gcc 4.0.0 on a FC4.
this snippet compiles (and runs) with no warnings with -W and -Wall 
options enabled.

bitset<9> n;
n[15]=1;	//works
for (i=0 to 20) printf ("%d\n", int(n[i]));  //all 0's excepet in 15th postition

sincerely
-- 
Bharat Joshi
Home: http://students.iiit.ac.in/~bharatj



More information about the Libstdc++ mailing list