Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2006-01-14 17:24:07


On 1/13/06 9:29 AM, "Christopher Kohlhoff" <chris_at_[hidden]> wrote:

> --- Martin Bonner <martin.bonner_at_[hidden]> wrote:
>> From: Chris Cleeland
>>> On Fri, 13 Jan 2006, Christopher Kohlhoff wrote:
>>>
>>>> Some thoughts, both for and against:
>>>>
>>>> - Does unsigned char always imply 0..255?
>> No.
>
> 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:
[TRUNCATE]

Since this is only an issue if a byte is larger than an octet, maybe you
should #if-block it off when CHAR_BIT == 8, so you don't perform the
unnecessary test for octet-sized bytes. (C++, and C, is forbidden on
platforms where a byte is smaller than an octet.)

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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