Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Tomas Puverle (Tomas.Puverle_at_[hidden])
Date: 2010-05-30 11:33:46


> Its somewhat off-topic, and I didn't post the code for this class, because
> its complicated, but
>
> bitfield<big, 3, 6, -21, 9>
>
> means four consecutive unsigned integer bit fields with widths of 3, 6, 21,
> and 9 bits, respectively,

Presumably, based on your explanation, you mean 3 unsigned bit fields and one
signed one.

Seems neat.

One question though - is this supposed to swap the "bitfields" (i.e. is this a
generalized endian bit swapper) or is the intent to have a bitfield which then
gets treated as one "larger" type and gets swapped byte-wise?

> My point was that I don't think of endianess as being a "swapping" problem,
> but an "ordering" problem.
> The bit-endianness of messages makes this clear for me, since swapping
> doesn't work.

I would be interested in knowing what you'd think about implementing the
swapping using the user defined type endian swapping facility in my library.
At first sight, it seems like it should be possible.

Tom


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