Boost logo

Boost :

From: me22 (me22.ca_at_[hidden])
Date: 2006-06-09 14:47:24


On 6/9/06, Martin Bonner <martin.bonner_at_[hidden]> wrote:
> Well, some of them (DSPs) are freestanding implementations and don't
> /have/ fgetc. But in general, yes. Of course, on such systems the file
> will be divided into 9 or 32 bit sized chunks. (Which makes file
> transfer interesting).
>
> The sockets implementation receive octets down the wire (and they are
> called octets not bytes because the designers were aware of non-8-bit
> bytes).
>
> recv will store each octet into a byte (which C and C++ guarantees is
> big enough). send might just transmit the low eight bits of each byte
> as the octet, or it might fail if higher bits are non-zero.
>
That raises an interesting issue. It sounds like (on a platform with
32-bit bytes) for a file the octets would have to be rearranged inside
one byte, but for a socket it would need the octets spread out, each
into one byte.

Would it be worth adding allowed_bits_per_byte ( = CHAR_BIT ) and
chunk_size ( = 8 ) parameters to the templates? They certainly
wouldn't simplify the implementation.

Also, has middle-endian finally died?

Contemplative,
~ Scott McMurray


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