]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/throw_exception.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
930ec357dc834d1ab6394ca8f3ffbfee815dc5af
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / throw_exception.hpp
1 #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED\r
2 #define BOOST_THROW_EXCEPTION_HPP_INCLUDED\r
3 \r
4 // MS compatible compilers support #pragma once\r
5 \r
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
7 # pragma once\r
8 #endif\r
9 \r
10 //\r
11 //  boost/throw_exception.hpp\r
12 //\r
13 //  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.\r
14 //  Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.\r
15 //\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
19 //\r
20 //  http://www.boost.org/libs/utility/throw_exception.html\r
21 //\r
22 \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
27 \r
28 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )\r
29 # define BOOST_EXCEPTION_DISABLE\r
30 #endif\r
31 \r
32 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )\r
33 # define BOOST_EXCEPTION_DISABLE\r
34 #endif\r
35 \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
43 #else\r
44 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)\r
45 #endif\r
46 \r
47 namespace boost\r
48 {\r
49 \r
50 #ifdef BOOST_NO_EXCEPTIONS\r
51 \r
52 void throw_exception( std::exception const & e ); // user defined\r
53 \r
54 #else\r
55 \r
56 inline void throw_exception_assert_compatibility( std::exception const & ) { }\r
57 \r
58 template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )\r
59 {\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
63 \r
64 #ifndef BOOST_EXCEPTION_DISABLE\r
65     throw enable_current_exception(enable_error_info(e));\r
66 #else\r
67     throw e;\r
68 #endif\r
69 }\r
70 \r
71 #endif\r
72 \r
73 } // namespace boost\r
74 \r
75 #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED\r