1 2 #ifndef EXCEPTIONS_H 3 #define EXCEPTIONS_H 4 5 struct ExceptionBase { 6 ExceptionBase(); 7 ~ExceptionBase(); 8 }; 9 10 struct ExceptionA : ExceptionBase { 11 ExceptionA(); 12 ~ExceptionA(); 13 14 int a; 15 }; 16 17 struct ExceptionB : ExceptionBase { 18 ExceptionB(); 19 ~ExceptionB(); 20 21 int b; 22 }; 23 24 struct VirtualExceptionBase : ExceptionBase { 25 VirtualExceptionBase(); 26 virtual ~VirtualExceptionBase(); 27 }; 28 29 struct VirtualExceptionA : VirtualExceptionBase { 30 VirtualExceptionA(); 31 virtual ~VirtualExceptionA(); 32 33 int a; 34 }; 35 36 struct VirtualExceptionB : VirtualExceptionBase { 37 VirtualExceptionB(); 38 virtual ~VirtualExceptionB(); 39 40 int b; 41 }; 42 43 void throwBase(); 44 void throwA(); 45 void throwB(); 46 void throwVirtualBase(); 47 void throwVirtualA(); 48 void throwVirtualB(); 49 void throwInt(); 50 51 52 #endif // EXCEPTIONS_H 53