
6 Jan
2006
6 Jan
'06
5:07 p.m.
Chris Cleeland wrote:
Whatever is necessary. If the args were shorts (signed or unsigned), the interface is representing that the following would be legal:
asio::ipv4::address my_address(322, 798, 0, 1024);
And we know that's not correct.
If the arguments are unsigned chars, you (the author of the function) have no way of knowing whether it's correct, because you won't see 322 or 798.
If the caller trusts implicit conversions rather than explicitly passing unsigned chars, then that's their problem.
Callers that explicitly pass unsigned char don't care about the argument type; their code will work with either.