File indexing completed on 2025-01-18 09:29:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_IP_BAD_ADDRESS_CAST_HPP
0012 #define BOOST_ASIO_IP_BAD_ADDRESS_CAST_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <typeinfo>
0020
0021 #include <boost/asio/detail/push_options.hpp>
0022
0023 namespace boost {
0024 namespace asio {
0025 namespace ip {
0026
0027
0028 class bad_address_cast :
0029 #if defined(BOOST_ASIO_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
0030 public std::exception
0031 #else
0032 public std::bad_cast
0033 #endif
0034 {
0035 public:
0036
0037 bad_address_cast() {}
0038
0039
0040 bad_address_cast(const bad_address_cast& other) noexcept
0041 #if defined(BOOST_ASIO_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
0042 : std::exception(static_cast<const std::exception&>(other))
0043 #else
0044 : std::bad_cast(static_cast<const std::bad_cast&>(other))
0045 #endif
0046 {
0047 }
0048
0049
0050 virtual ~bad_address_cast() noexcept {}
0051
0052
0053 virtual const char* what() const noexcept
0054 {
0055 return "bad address cast";
0056 }
0057 };
0058
0059 }
0060 }
0061 }
0062
0063 #include <boost/asio/detail/pop_options.hpp>
0064
0065 #endif