throw_exception.hpp 963 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <boost/throw_exception.hpp>
  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>
  26. BOOST_NORETURN inline void throw_exception(E const & e){
  27. throw e;
  28. }
  29. #endif
  30. } // namespace serialization
  31. } // namespace boost
  32. #endif // #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED