fork download
  1. #include <iostream>
  2. #include <bitset>
  3.  
  4. int main() {
  5.  
  6. std::bitset<0> b = 511;
  7.  
  8. //std::cout << b << std::endl;
  9.  
  10. b[1] = true;
  11. /*
  12.   std::cout << b[100] << std::endl; */
  13.  
  14. return 0;
  15. }
Runtime error #stdin #stdout #stderr 0s 2980KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Base_bitset::_M_getword