equal
deleted
inserted
replaced
|
1 #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED |
|
2 #define BOOST_THROW_EXCEPTION_HPP_INCLUDED |
|
3 |
|
4 // MS compatible compilers support #pragma once |
|
5 |
|
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|
7 # pragma once |
|
8 #endif |
|
9 |
|
10 // |
|
11 // boost/throw_exception.hpp |
|
12 // |
|
13 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. |
|
14 // |
|
15 // Distributed under the Boost Software License, Version 1.0. (See |
|
16 // accompanying file LICENSE_1_0.txt or copy at |
|
17 // http://www.boost.org/LICENSE_1_0.txt) |
|
18 // |
|
19 // http://www.boost.org/libs/utility/throw_exception.html |
|
20 // |
|
21 |
|
22 #include <boost/config.hpp> |
|
23 |
|
24 #ifdef BOOST_NO_EXCEPTIONS |
|
25 # include <exception> |
|
26 #endif |
|
27 |
|
28 namespace boost |
|
29 { |
|
30 |
|
31 #ifdef BOOST_NO_EXCEPTIONS |
|
32 |
|
33 void throw_exception(std::exception const & e); // user defined |
|
34 |
|
35 #else |
|
36 |
|
37 template<class E> inline void throw_exception(E const & e) |
|
38 { |
|
39 //Adding this #if statement for WINSCW because currently winscw compiler does not support catching of const exception by non const catch blocks |
|
40 //Once compiler starts supporting, this #if statement needs to be removed |
|
41 #if ( defined __WINSCW__) |
|
42 E a = e; |
|
43 throw a; |
|
44 #else |
|
45 throw e; |
|
46 #endif |
|
47 } |
|
48 |
|
49 #endif |
|
50 |
|
51 } // namespace boost |
|
52 |
|
53 #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED |