From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-08-28 18:27:04


On Thursday 28 August 2003 09:35 am, Neal D. Becker wrote:
> I have looked at std::bitset, std::vector<bool>, and boost:dyn_bitset, but
> none seems to supply a feature I need.
>
> I'd like to be able to assign to a contiguous field of bits in one
> operation. For example:
>
> bitset<12> n;
> n.subset (1, 10) = 0x2;
>
> Is there any good c++ lib that can do this?

Not that I know of...

> Would this be a good addition to boost?

I'm sure it would be a good addition to boost::dyn_bitset at least. It depends
on whether you need std::bitset, std::vector<bool>, or boost::dyn_bitset
semantics for the rest of your code as to which one you would benefit most
from modifying.

        Doug