Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-06-22 04:09:42

On Tue, 20 Jun 2006 16:48:32 -0700, "Dr MaaTt" <dr.maatt_at_[hidden]>

>is there a way to turn a regular (unsigned long) integer into bitset? for
>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:


For portability, you might want to use numeric_limits<> to find out
the width in bits of unsigned long.


Boost list run by bdawes at, gregod at, cpdaniel at, john at