Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / align / detail / throw_exception.hpp
1 /*
2 Copyright 2019 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7 */
8 #ifndef BOOST_ALIGN_DETAIL_THROW_EXCEPTION_HPP
9 #define BOOST_ALIGN_DETAIL_THROW_EXCEPTION_HPP
10
11 #include <boost/config.hpp>
12 #if defined(BOOST_NO_EXCEPTIONS)
13 #include <exception>
14 #endif
15
16 namespace boost {
17
18 #if defined(BOOST_NO_EXCEPTIONS)
19 BOOST_NORETURN void throw_exception(const std::exception&);
20 #endif
21
22 namespace alignment {
23 namespace detail {
24
25 #if !defined(BOOST_NO_EXCEPTIONS)
26 template<class E>
27 BOOST_NORETURN inline void
28 throw_exception(const E& error)
29 {
30     throw error;
31 }
32 #else
33 BOOST_NORETURN inline void
34 throw_exception(const std::exception& error)
35 {
36     boost::throw_exception(error);
37 }
38 #endif
39
40 } /* detail */
41 } /* alignment */
42 } /* boost */
43
44 #endif