#include using namespace std; class A1 { public: A1 ( void ) { } }; class A2 { public: A2 ( void ) { } }; int main ( void ) { int i = 0; //... try { if ( i > 0 ) { throw A1 ( ); } else { throw A2 ( ); //违背1 } } catch ( A1 & ) { cout << "exception: A1" << endl; } return ( 0 ); }