这个语法是怎么回事:int main()try{}catch(){}
本帖最后由 shendaowu 于 2013-08-10 12:35:11 编辑 http://www.stroustrup.com/Programming/std_lib_facilities.h
#include "../../_h_file_/std_lib_facilities.h"
int main()
try{
error( "asdf" );
return 0;
}
catch(runtime_error& e){
cerr << "runtime error: " << e.what() <<endl;
keep_window_open();
return 1;
}
void f()cout << "test";
class A
{
A() try: x(5) {} catch(std::bad_alloc& e) {}
vector<int> x;
};