Boost logo

Boost :

From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2006-02-25 17:33:28


Christopher Kohlhoff wrote:
> So it seems that if asio is going to provide this constructor,
> then even if it uses unsigned char values there is the
> possibility (on some platforms) of out of range values.
>
> What should happen then if an out of range value is passed? The
> choice is between:
>
> - Silently changing the values to something in the range 0..255.
>
> - Throwing an exception (using boost::throw_exception of course,
> so that platforms that lack exceptions can use another way of
> handling the error).

Sorry for being soooooooo late to reply. Just got back from a month and
a half vacation...

It seems to me that the exception approach fits best to this case. I
also like Daryle's idea of #ifdef-ing out the check when CHAR_BITS == 8,
because the vast majority of Boost users do work in such environments,
and would benefit from it.

Yuval


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