
22 Jun
2006
22 Jun
'06
8:09 a.m.
On Tue, 20 Jun 2006 16:48:32 -0700, "Dr MaaTt" <dr.maatt@gmail.com> wrote:
is there a way to turn a regular (unsigned long) integer into bitset? for example, unsigned long int a=1234567890; boost::dynamic_bitset<> b(32);
can I do something similar to boost::dynamic_bitset<> b(32, a);
Yes, there's a constructor for that: <http://www.boost.org/libs/dynamic_bitset/dynamic_bitset.html#constructors> For portability, you might want to use numeric_limits<> to find out the width in bits of unsigned long. --Gennaro.