Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:02:54

0001 //
0002 // detail/throw_exception.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
0012 #define BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 
0020 #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
0021 # include <boost/throw_exception.hpp>
0022 #endif // defined(BOOST_ASIO_BOOST_THROW_EXCEPTION)
0023 
0024 namespace boost {
0025 namespace asio {
0026 namespace detail {
0027 
0028 #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
0029 using boost::throw_exception;
0030 #else // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
0031 
0032 // Declare the throw_exception function for all targets.
0033 template <typename Exception>
0034 void throw_exception(
0035     const Exception& e
0036     BOOST_ASIO_SOURCE_LOCATION_DEFAULTED_PARAM);
0037 
0038 // Only define the throw_exception function when exceptions are enabled.
0039 // Otherwise, it is up to the application to provide a definition of this
0040 // function.
0041 # if !defined(BOOST_ASIO_NO_EXCEPTIONS)
0042 template <typename Exception>
0043 void throw_exception(
0044     const Exception& e
0045     BOOST_ASIO_SOURCE_LOCATION_PARAM)
0046 {
0047   throw e;
0048 }
0049 # endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
0050 
0051 #endif // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
0052 
0053 } // namespace detail
0054 } // namespace asio
0055 } // namespace boost
0056 
0057 #endif // BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP