Boost logo

Boost :

From: Dr MaaTt (dr.maatt_at_[hidden])
Date: 2006-06-20 19:48:32

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);
b |= a;
without resorting to xxxUL etc?
at the moment I am doing
for( int i=0 ; i< 32 ; i++ ) if( (a & (1UL << i) ) ) b.set(i);


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