#include using namespace std; class Document { public: Document ( void ) : docid ( 0 ) { } int get_docid ( void ); private: int docid; }; int Document::get_docid ( void ) { return docid; } int main ( void ) { try { Document mydoc1; throw mydoc1; } catch ( ... ) //违背1 { cout << "缺省捕获" << endl; } catch ( Document &d ) { cout << d.get_docid ( ) << endl; } return ( 0 ); }