5 // Copyright (c) 2003-2023 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_IP_IMPL_ADDRESS_HPP
12 #define BOOST_ASIO_IP_IMPL_ADDRESS_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #if !defined(BOOST_ASIO_NO_IOSTREAM)
20 #include <boost/asio/detail/throw_error.hpp>
22 #include <boost/asio/detail/push_options.hpp>
28 #if !defined(BOOST_ASIO_NO_DEPRECATED)
30 inline address address::from_string(const char* str)
32 return boost::asio::ip::make_address(str);
35 inline address address::from_string(
36 const char* str, boost::system::error_code& ec)
38 return boost::asio::ip::make_address(str, ec);
41 inline address address::from_string(const std::string& str)
43 return boost::asio::ip::make_address(str);
46 inline address address::from_string(
47 const std::string& str, boost::system::error_code& ec)
49 return boost::asio::ip::make_address(str, ec);
52 #endif // !defined(BOOST_ASIO_NO_DEPRECATED)
54 template <typename Elem, typename Traits>
55 std::basic_ostream<Elem, Traits>& operator<<(
56 std::basic_ostream<Elem, Traits>& os, const address& addr)
58 return os << addr.to_string().c_str();
65 #include <boost/asio/detail/pop_options.hpp>
67 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
69 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_HPP