1 | //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. |
---|---|
2 | |
3 | //Distributed under the Boost Software License, Version 1.0. (See accompanying |
4 | //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
5 | |
6 | #define BOOST_EXCEPTION_DISABLE |
7 | |
8 | #include <boost/config.hpp> |
9 | |
10 | #if defined( BOOST_NO_EXCEPTIONS ) |
11 | # error This program requires exception handling. |
12 | #endif |
13 | |
14 | #include <boost/throw_exception.hpp> |
15 | #include <boost/detail/lightweight_test.hpp> |
16 | |
17 | class my_exception: public std::exception { }; |
18 | |
19 | int |
20 | main() |
21 | { |
22 | try |
23 | { |
24 | boost::throw_exception(e: my_exception()); |
25 | BOOST_ERROR("boost::throw_exception failed to throw."); |
26 | } |
27 | catch( |
28 | my_exception & ) |
29 | { |
30 | } |
31 | catch( |
32 | ... ) |
33 | { |
34 | BOOST_ERROR("boost::throw_exception malfunction."); |
35 | } |
36 | return boost::report_errors(); |
37 | } |
38 |