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:
chris_kohlhoff 2005-11-25 11:41:38 +00:00
parent 7915060ce0
commit 46410e8518
2 changed files with 10 additions and 8 deletions

View File

@ -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

View File

@ -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