return 0;
}
这个例子抛出了一个用户自定义类型(structured_exception)的c++异常。为了让这个例子更具实际意义,也更方便阅读,我将structured_exception的申明放到了头文件structured_exception.h中:
#if !defined inc_structured_exception_
#define inc_structured_exception_
#include "windows.h"
class structured_exception
{
public:
structured_exception(exception_pointers const &) throw();
static void install() throw();
unsigned what() const throw();
void const *where() const throw();
private:
void const *address_;
unsigned code_;
};
#endif // !defined inc_structured_exception_