Boost logo

Boost :

Subject: Re: [boost] [dynamic_bitset] Endianess and Adaption Vs Copying
From: Joel (jdy_at_[hidden])
Date: 2012-05-03 11:55:04


Francois Duranleau <xiao.bai.xiong <at> gmail.com> writes:
>
> Wrong, in increasing address order, it would rather be
>
> 07 06 05 04 03 02 01 00 15 14 13 12 11 10 09 08

You are, of course, correct. Brain fart on my part.

> > That doesn't seem right---7th and 8th bits should be adjacent. Does
> > anyone have suggestions for controlling this?
>
> Why? How is that a problem?

It isn't necessarily a problem. It is an arbitrary choice. However,
dynamic_bitset provides a constructor that takes raw data as input. If
the source for that input has the bits ordered consecutively (which would
allow one to change the block type without changing the ordering of the bits)
then the constructor will not function properly. At minimum, the bit-ordering
imposed by dynamic-bitset should be explicitly documented.
 
> > Second, has anyone adapted dynamic_bitset to be an adaptor for an existing
> > memory range to avoid copying?
>
> I haven't, but it sounds like a good idea :)

Should it be part of dynamic_bitset or should it be a new class?

Joel


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