Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-01-06 12:07:46


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk