
20 Jun
2006
20 Jun
'06
11:48 p.m.
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); or 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); Thanks