|
Boost : |
Subject: Re: [boost] [dynamic_bitset] Endianess
From: Joel (jdy_at_[hidden])
Date: 2012-05-03 12:07:51
Phil Endecott <spam_from_boost_dev <at> chezphil.org> writes:
> Joel wrote:
> > I've noticed that the dynamic_bitset seems to have endian issues.
>
> Do you have a test case that you can share?
This isn't a classic endian issue. I just needed to know in what order
the bits were arranged within each block. This didn't match the bit
ordering from the source I had.
> > For masking
> > out the ith bit in a block, it uses 1 shifted left by i. As a
> > result, the bits are not consecutive.
>
> What do you mean by "consecutive"? Why do you think this matters?
If one has a need to use the raw memory managed by the bitset for some
purpose one needs to know the ordering. Also, if one needed to change
the block_type for that chunk of raw memory it would matter.
> (I have just had a quick look at the code, and I've not seen anything
> like casts or unions that could cause endianness issues.)
You are right
> Regards, Phil.
Thanks Phil. I do think the ordering should be documented for the
constructor that takes start and end block iterators.
Joel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk