File: throw_exception.hpp

package info (click to toggle)
boost 1.32.0-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 93,952 kB
  • ctags: 128,458
  • sloc: cpp: 492,477; xml: 52,125; python: 13,519; ansic: 13,013; sh: 1,773; yacc: 853; makefile: 526; perl: 418; lex: 110; csh: 6
file content (52 lines) | stat: -rw-r--r-- 1,265 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef BOOST_SERIALIZATION_EXCEPTION_HPP
#define BOOST_SERIALIZATION_EXCEPTION_HPP

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
//  throw_exception.hpp
//
//  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
//
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
//  http://www.boost.org/libs/utility/throw_exception.html
//

#include <boost/config.hpp>
#include <boost/throw_exception.hpp>

#ifndef BOOST_NO_EXCEPTIONS
# include <exception>
#endif

namespace boost {

#ifdef BOOST_NO_EXCEPTIONS
    // user defined
    void throw_exception(std::exception const & e); 
    void throw_exception();
    } // namespace boost
    #define BOOST_TRY
    #define BOOST_CATCH(x) if(0)
#else
//  inline template<class E> void throw_exception(E const & e)
//  {
//      throw e;
//  }
    inline void throw_exception()
    {
        throw;
    }
    #define BOOST_TRY try
    #define BOOST_CATCH(x) catch(x)
#endif

} // namespace boost

#endif // BOOST_SERIALIZATION_EXCEPTION_HPP