2 // detail/throw_exception.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
12 #define BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
21 # include <boost/throw_exception.hpp>
22 #endif // defined(BOOST_ASIO_BOOST_THROW_EXCEPTION)
28 #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
29 using boost::throw_exception;
30 #else // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
32 // Declare the throw_exception function for all targets.
33 template <typename Exception>
34 void throw_exception(const Exception& e);
36 // Only define the throw_exception function when exceptions are enabled.
37 // Otherwise, it is up to the application to provide a definition of this
39 # if !defined(BOOST_ASIO_NO_EXCEPTIONS)
40 template <typename Exception>
41 void throw_exception(const Exception& e)
45 # endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
47 #endif // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
53 #endif // BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP