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