This is Unofficial EPICS BASE Doxygen Site
throw_exception.hpp
Go to the documentation of this file.
1 #ifndef UUID_AA15E74A856F11E08B8D93F24824019B
2 #define UUID_AA15E74A856F11E08B8D93F24824019B
3 #if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
4 #pragma GCC system_header
5 #endif
6 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
7 #pragma warning(push,1)
8 #endif
9 
10 // MS compatible compilers support #pragma once
11 
12 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
13 # pragma once
14 #endif
15 
16 //
17 // boost/throw_exception.hpp
18 //
19 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
20 // Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
21 //
22 // Distributed under the Boost Software License, Version 1.0. (See
23 // accompanying file LICENSE_1_0.txt or copy at
24 // http://www.boost.org/LICENSE_1_0.txt)
25 //
26 // http://www.boost.org/libs/utility/throw_exception.html
27 //
28 
31 #include <boost/config.hpp>
32 #include <exception>
33 
34 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
35 # define BOOST_EXCEPTION_DISABLE
36 #endif
37 
38 #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
39 # define BOOST_EXCEPTION_DISABLE
40 #endif
41 
42 #if !defined( BOOST_EXCEPTION_DISABLE )
45 # define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_CURRENT_FUNCTION,__FILE__,__LINE__)
46 #else
47 # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
48 #endif
49 
50 namespace boost
51 {
52 #ifdef BOOST_NO_EXCEPTIONS
53 
54 void throw_exception( std::exception const & e ); // user defined
55 
56 #else
57 
58 inline void throw_exception_assert_compatibility( std::exception const & ) { }
59 
60 template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
61 {
62  //All boost exceptions are required to derive from std::exception,
63  //to ensure compatibility with BOOST_NO_EXCEPTIONS.
65 
66 #ifndef BOOST_EXCEPTION_DISABLE
68 #else
69  throw e;
70 #endif
71 }
72 
73 #endif
74 
75 #if !defined( BOOST_EXCEPTION_DISABLE )
76  namespace
77  exception_detail
78  {
79  template <class E>
81  void
82  throw_exception_( E const & x, char const * current_function, char const * file, int line )
83  {
85  set_info(
86  set_info(
87  set_info(
89  throw_function(current_function)),
90  throw_file(file)),
91  throw_line(line)));
92  }
93  }
94 #endif
95 } // namespace boost
96 
97 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
98 #pragma warning(pop)
99 #endif
100 #endif
error_info< struct throw_file_, char const * > throw_file
Definition: exception.hpp:90
exception_detail::clone_impl< T > enable_current_exception(T const &x)
Definition: exception.hpp:474
error_info< struct throw_line_, int > throw_line
Definition: exception.hpp:91
Definition: assert.hpp:91
void throw_exception_assert_compatibility(std::exception const &)
exception_detail::enable_error_info_return_type< T >::type enable_error_info(T const &x)
Definition: exception.hpp:375
char * line
Definition: reader.c:25
#define BOOST_ATTRIBUTE_NORETURN
E const & set_info(E const &, error_info< Tag, T > const &)
error_info< struct throw_function_, char const * > throw_function
Definition: exception.hpp:87
BOOST_ATTRIBUTE_NORETURN void throw_exception_(E const &x, char const *current_function, char const *file, int line)
BOOST_ATTRIBUTE_NORETURN void throw_exception(E const &e)