2-throw_exception_no_exceptions_test.cpp 537 B

1234567891011121314151617181920212223242526
  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. #include <boost/throw_exception.hpp>
  6. class my_exception: public std::exception { };
  7. namespace
  8. boost
  9. {
  10. void
  11. throw_exception( std::exception const & )
  12. {
  13. exit(0);
  14. }
  15. }
  16. int
  17. main()
  18. {
  19. boost::throw_exception(my_exception());
  20. return 1;
  21. }