2 // ip/impl/address_v6.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2016 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_V6_HPP
12 #define BOOST_ASIO_IP_IMPL_ADDRESS_V6_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 template <typename Elem, typename Traits>
29 std::basic_ostream<Elem, Traits>& operator<<(
30 std::basic_ostream<Elem, Traits>& os, const address_v6& addr)
32 boost::system::error_code ec;
33 std::string s = addr.to_string(ec);
36 if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
37 boost::asio::detail::throw_error(ec);
39 os.setstate(std::basic_ostream<Elem, Traits>::failbit);
42 for (std::string::iterator i = s.begin(); i != s.end(); ++i)
51 #include <boost/asio/detail/pop_options.hpp>
53 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
55 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP