1 //
2 // ip/impl/basic_endpoint.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
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)
9 //
10 
11 #ifndef ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
12 #define ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #if !defined(ASIO_NO_IOSTREAM)
19 
20 #include "asio/detail/throw_error.hpp"
21 
22 #include "asio/detail/push_options.hpp"
23 
24 namespace asio {
25 namespace ip {
26 
27 template <typename Elem, typename Traits, typename InternetProtocol>
operator <<(std::basic_ostream<Elem,Traits> & os,const basic_endpoint<InternetProtocol> & endpoint)28 std::basic_ostream<Elem, Traits>& operator<<(
29     std::basic_ostream<Elem, Traits>& os,
30     const basic_endpoint<InternetProtocol>& endpoint)
31 {
32   asio::ip::detail::endpoint tmp_ep(endpoint.address(), endpoint.port());
33   return os << tmp_ep.to_string().c_str();
34 }
35 
36 } // namespace ip
37 } // namespace asio
38 
39 #include "asio/detail/pop_options.hpp"
40 
41 #endif // !defined(ASIO_NO_IOSTREAM)
42 
43 #endif // ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
44