异常/调试

来源:互联网 发布:d3.js入门教程 编辑:程序博客网 时间:2024/06/01 10:15

#include <iostream>

#include <bitset>

#include <stdexcept>

 

using namespace std;

 

int main()

{

       bitset<33> bs;

      

       bs.set();

      

       try {

              bs.to_ulong();

       }catch(runtime_error err) {

              cout << "Exception: " << err.what() << endl;

#ifdef DEBUG

              cerr << "file: " << __FILE__ << endl;

              cerr << "ling: " << __LINE__ << endl;

              cerr << "date: " << __DATE__ << endl;

              cerr << "time: " << __TIME__ << endl;

#endif

       }

      

       return 0;

}

原创粉丝点击