Go to the documentation of this file.00001 #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
00002 #define BOOST_THROW_EXCEPTION_HPP_INCLUDED
00003
00004
00005
00006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
00007 # pragma once
00008 #endif
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <boost/config.hpp>
00024 #include <boost/detail/workaround.hpp>
00025 #include <exception>
00026
00027 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
00028 # define BOOST_EXCEPTION_DISABLE
00029 #endif
00030
00031 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
00032 # define BOOST_EXCEPTION_DISABLE
00033 #endif
00034
00035 #if !defined( BOOST_EXCEPTION_DISABLE )
00036 # include <boost/exception/exception.hpp>
00037 # include <boost/current_function.hpp>
00038 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
00039 ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
00040 ::boost::throw_file(__FILE__) <<\
00041 ::boost::throw_line((int)__LINE__))
00042 #else
00043 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
00044 #endif
00045
00046 namespace boost
00047 {
00048
00049 #ifdef BOOST_NO_EXCEPTIONS
00050
00051 void throw_exception( std::exception const & e );
00052
00053 #else
00054
00055 inline void throw_exception_assert_compatibility( std::exception const & ) { }
00056
00057 template<class E> inline void throw_exception( E const & e )
00058 {
00059
00060
00061 throw_exception_assert_compatibility(e);
00062
00063 #ifndef BOOST_EXCEPTION_DISABLE
00064 throw enable_current_exception(enable_error_info(e));
00065 #else
00066 throw e;
00067 #endif
00068 }
00069
00070 #endif
00071
00072 }
00073
00074 #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED