4-throw_exception_no_both_test.cpp 569 B

123456789101112131415161718192021222324252627
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #define BOOST_NO_EXCEPTIONS
  5. #define BOOST_EXCEPTION_DISABLE
  6. #include <boost/throw_exception.hpp>
  7. class my_exception: public std::exception { };
  8. namespace
  9. boost
  10. {
  11. void
  12. throw_exception( std::exception const & )
  13. {
  14. exit(0);
  15. }
  16. }
  17. int
  18. main()
  19. {
  20. boost::throw_exception(my_exception());
  21. return 1;
  22. }