throw_exception.hpp 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
  2. #define BOOST_THROW_EXCEPTION_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // boost/throw_exception.hpp
  9. //
  10. // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
  11. //
  12. // Permission to copy, use, modify, sell and distribute this software
  13. // is granted provided this copyright notice appears in all copies.
  14. // This software is provided "as is" without express or implied
  15. // warranty, and with no claim as to its suitability for any purpose.
  16. //
  17. // http://www.boost.org/libs/utility/throw_exception.html
  18. //
  19. //#include <boost/config.hpp>
  20. #ifdef BOOST_NO_EXCEPTIONS
  21. # include <exception>
  22. #endif
  23. namespace boost
  24. {
  25. #ifdef BOOST_NO_EXCEPTIONS
  26. void throw_exception(std::exception const & e); // user defined
  27. #else
  28. template<class E> void throw_exception(E const & e)
  29. {
  30. throw e;
  31. }
  32. #endif
  33. } // namespace boost
  34. #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED