A bitset with a fixed number of bits, having possibly an infinite number of leading virtual 1's. More...
#include <libecc/bitset.h>
Public Member Functions | |
void | base2_print_on (std::ostream &os) const |
Print the bitset in binary form to os. | |
bitset_digit_t | digit (unsigned int d) const |
Access digit number d. |
A bitset with a fixed number of bits, having possibly an infinite number of leading virtual 1's.
When dealing with expressions, short bitsets are assumed to have leading zeros. This class however can represent an 'inverted' bitset, meaning that it has an infinite number of leading ones.
The use of this class should be restricted to (optimized out) temporaries in expressions like a = ~b;
or a |= b & ~c
. The user should not use this class directly.
N | The number of bits in the bitset. | |
inverted | True when each internal bit has the opposite meaning. |
void libecc::bitset_invertible< N, inverted >::base2_print_on | ( | std::ostream & | os | ) | const |
Print the bitset in binary form to os.
Print bitset base 2.
For debugging purposes.
For example (assuming you are using libcwd):
bitset<N> btst; Dout(dc::notice, cwprint_using(btst, &bitset::base2_print_on));
References libecc::bitset_invertible< N, inverted >::digit().
bitset_digit_t libecc::bitset_invertible< N, inverted >::digit | ( | unsigned int | d | ) | const [inline] |
Access digit number d.
Referenced by libecc::bitset_invertible< N, inverted >::base2_print_on().