1 #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
\r
2 #define BOOST_THROW_EXCEPTION_HPP_INCLUDED
\r
4 // MS compatible compilers support #pragma once
\r
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
\r
11 // boost/throw_exception.hpp
\r
13 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
\r
14 // Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
\r
16 // Distributed under the Boost Software License, Version 1.0. (See
\r
17 // accompanying file LICENSE_1_0.txt or copy at
\r
18 // http://www.boost.org/LICENSE_1_0.txt)
\r
20 // http://www.boost.org/libs/utility/throw_exception.html
\r
23 #include <boost/exception/detail/attribute_noreturn.hpp>
\r
24 #include <boost/detail/workaround.hpp>
\r
25 #include <boost/config.hpp>
\r
26 #include <exception>
\r
28 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
\r
29 # define BOOST_EXCEPTION_DISABLE
\r
32 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
\r
33 # define BOOST_EXCEPTION_DISABLE
\r
36 #if !defined( BOOST_EXCEPTION_DISABLE )
\r
37 # include <boost/exception/exception.hpp>
\r
38 # include <boost/current_function.hpp>
\r
39 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
\r
40 ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
\r
41 ::boost::throw_file(__FILE__) <<\
\r
42 ::boost::throw_line(__LINE__))
\r
44 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
\r
50 #ifdef BOOST_NO_EXCEPTIONS
\r
52 void throw_exception( std::exception const & e ); // user defined
\r
56 inline void throw_exception_assert_compatibility( std::exception const & ) { }
\r
58 template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
\r
60 //All boost exceptions are required to derive from std::exception,
\r
61 //to ensure compatibility with BOOST_NO_EXCEPTIONS.
\r
62 throw_exception_assert_compatibility(e);
\r
64 #ifndef BOOST_EXCEPTION_DISABLE
\r
65 throw enable_current_exception(enable_error_info(e));
\r
73 } // namespace boost
\r
75 #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
\r