[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost
Subject:    [boost] [asio] some stuff about ipv4::address
From:       Yuval Ronen <ronen_yuval () yahoo ! com>
Date:       2005-12-31 17:12:38
Message-ID: dp6e80$sh6$1 () sea ! gmane ! org
[Download RAW message or body]

Hi.
These are minor things I noticed with, and was bothered by, the 
asio::ipv4::address class. This is by no means an asio review (although 
we desperately need some networking library, that's for sure).

What I dislike is the string-accepting contructor and the to_string() 
method. My personal taste is that textual conversions (and the 
ip::address class is a very good candidate for this) should be made 
through the standard ostream/istream operators. This has the usual 
advantages of using an idiom. It also provides standard means to detect 
parsing error using the ios_base::fail bit. The ip::address currently 
has the only option of throwing in the string-accepting contructor, 
however, this is not intuitive, IMHO (and not documented). String 
conversions can be easily performed using boost::lexical_cast.

Another thing is the plethora of assingment operators. Wouldn't a single 
copy-assignment be enough?

And one last suggestion: A construtor taking 4 unsigned chars, allowing 
this:
asio::ipv4::address my_address(192, 168, 0, 1);

Thanks for listening,
Yuval


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic