STL-compliant fixed-size sequence of N bits.
Declared in <bslstl_bitset.h>
template<std::size_t N>
class bitset;
This class template provides an STL-compliant bitset. For the requirements of a bitset class, consult the second revision of the ISO/IEC 14882 Programming Language c++ (2011).
In addition to the methods defined in the standard, this class also provides an extra constructor that takes a bsl::basic_string. This extra constructor provides the capability to construct a bitset from a bsl::basic_string, in addition to a std::basic_string.
| Name | Description |
|---|---|
reference | This class represents a reference to a modifiable bit inside a bsl::bitset. |
| Name | Description |
|---|---|
bitset [constructor] | Constructors |
all | Return true if all of the bits in this bitset have the value of 1 and false otherwise. Note that all() and none() are both true for bitsets of size 0. |
any | Return true if one or more of the bits in this bitset has the value of 1 and false otherwise. |
count | Return the number of bits in this bitset that have the value of 1. |
flip | flip overloads |
none | Return true if all the bits in this bitset has the value of 0 and false otherwise. Note that all() and none() are both true for bitsets of size 0. |
operator&= | Clear bits of this bitset where the corresponding bits of rhs are 0. |
operator<<= | Shift the bits of this bitset left by the specified pos. |
operator>> | Return a bitset constructed from shifting this bitset right by the specified pos. |
operator>>= | Shift the bits of this bitset right by the specified pos. |
operator[] | Subscript operators |
operator^= | Toggle bits of this bitset where the corresponding bits of rhs are 1. |
operator|= | Set bits of this bitset where the corresponding bits of rhs are 1. |
operator~ | Toggle all bits of this bitset and return a reference to this modifiable bitset. |
reset | reset overloads |
set | set overloads |
size | Return the number of bits this bitset holds. |
test | Return true if the bit at the specified pos has the value of 1 and false otherwise. |
to_string | Return a string representation of this bitset using zero and one. |
to_ulong | Return an unsigned long with the same bit pattern as this bitset. |
operator<< | Return a bitset constructed from shifting this bitset left by the specified pos. |
operator== | Return true if rhs has the same bit values as this bitset. |
operator!= | Return true if rhs does not have the same bit values as this bitset. |
| Name | Description |
|---|---|
bsl::reference | Proxy providing a mutable reference to a single bit in a bitset. |