Re: [asio-users] endpoint and address string conversions
Brought to you by:
chris_kohlhoff
From: Christopher K. <ch...@ko...> - 2005-09-09 02:57:32
|
Hi Arvid, --- Arvid Norberg <c9...@cs...> wrote: > I was also thinking that maybe the address class should have an > overload of the operator<<(std::ostream&, asio::address). This would > make the type play nicely with boost::lexical_cast<std::string>() as > well as being more easily streamed out. > > Maybe the endpoint types should have stream operators too, that would > be handy, especially when debugging. Good ideas. I'll put these changes in 0.3.4. > To avoid having to include <iostream>, maybe the stream operators > could be put in a separate header file (like boost.date_time does). I could probably do the same thing as I have done for asio::error, where the << operator is a template: template <Ostream> Ostream& operator<<(Ostream& os, const address& a) { ... } This will remove any need to include iostream. Cheers, Chris |