Borland C++ won't find the operator<< for ipv4::tcp::endpoint or
ipv4::udp::endpoint unless they are at global scope.
This commit is contained in:
parent
7915060ce0
commit
46410e8518
@ -238,6 +238,9 @@ private:
|
||||
asio::detail::inet_addr_v4_type addr_;
|
||||
};
|
||||
|
||||
} // namespace ipv4
|
||||
} // namespace asio
|
||||
|
||||
/// Output an endpoint as a string.
|
||||
/**
|
||||
* Used to output a human-readable string for a specified endpoint.
|
||||
@ -251,15 +254,13 @@ private:
|
||||
* @relates tcp::endpoint
|
||||
*/
|
||||
template <typename Ostream>
|
||||
Ostream& operator<<(Ostream& os, const tcp::endpoint& endpoint)
|
||||
Ostream& operator<<(Ostream& os,
|
||||
const asio::ipv4::tcp::endpoint& endpoint)
|
||||
{
|
||||
os << endpoint.address().to_string() << ':' << endpoint.port();
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ipv4
|
||||
} // namespace asio
|
||||
|
||||
#include "asio/detail/pop_options.hpp"
|
||||
|
||||
#endif // ASIO_IPV4_TCP_HPP
|
||||
|
@ -233,6 +233,9 @@ private:
|
||||
asio::detail::inet_addr_v4_type addr_;
|
||||
};
|
||||
|
||||
} // namespace ipv4
|
||||
} // namespace asio
|
||||
|
||||
/// Output an endpoint as a string.
|
||||
/**
|
||||
* Used to output a human-readable string for a specified endpoint.
|
||||
@ -246,15 +249,13 @@ private:
|
||||
* @relates tcp::endpoint
|
||||
*/
|
||||
template <typename Ostream>
|
||||
Ostream& operator<<(Ostream& os, const udp::endpoint& endpoint)
|
||||
Ostream& operator<<(Ostream& os,
|
||||
const asio::ipv4::udp::endpoint& endpoint)
|
||||
{
|
||||
os << endpoint.address().to_string() << ':' << endpoint.port();
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ipv4
|
||||
} // namespace asio
|
||||
|
||||
#include "asio/detail/pop_options.hpp"
|
||||
|
||||
#endif // ASIO_IPV4_UDP_HPP
|
||||
|
Loading…
Reference in New Issue
Block a user