throw_exception.hpp 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
  2. #define BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER)
  5. # pragma once
  6. #endif
  7. // boost/throw_exception.hpp
  8. //
  9. // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
  10. //
  11. // Distributed under the Boost Software License, Version 1.0. (See
  12. // accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. #include <boost/config.hpp>
  15. #ifndef BOOST_NO_EXCEPTIONS
  16. #include <exception>
  17. #endif
  18. namespace boost {
  19. namespace serialization {
  20. #ifdef BOOST_NO_EXCEPTIONS
  21. BOOST_NORETURN inline void throw_exception(std::exception const & e) {
  22. ::boost::throw_exception(e);
  23. }
  24. #else
  25. template<class E> BOOST_NORETURN inline void throw_exception(E const & e){
  26. throw e;
  27. }
  28. #endif
  29. } // namespace serialization
  30. } // namespace boost
  31. #endif // #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED