| 1 | #include <stdexcept> |
|---|---|
| 2 | |
| 3 | #include <boost/exception/exception.hpp> |
| 4 | #include <boost/throw_exception.hpp> |
| 5 | |
| 6 | struct hex_decode_error : virtual boost::exception, virtual std::exception {}; |
| 7 | struct not_enough_input : virtual hex_decode_error {}; |
| 8 | struct non_hex_input : virtual hex_decode_error {}; |
| 9 | |
| 10 | void toss() { BOOST_THROW_EXCEPTION(not_enough_input()); } |
| 11 | |
| 12 | int main () { |
| 13 | try { toss(); } |
| 14 | catch ( const hex_decode_error & /*ex*/ ) {} |
| 15 | } |
| 16 |
