Std::bitsetC + + Utilities library Std::bitset
Defined in Header <bitset> |
|
|
template< std::size_t N > Class Bitset; |
|
|
|
|
|
The class template Bitset represents a fixed-size sequence of N bits. Bitsets can is manipulated by standard logic operators and converted to and from strings.
Bitset meets the requirements of copyconstructible and copyassignable. Template Parameters
N |
- |
The number of bits to allocate storage for |
Member Types
Reference |
Proxy class representing a reference to a bit (Class) |
Member functions
(constructor) |
Constructs the Bitset (Public member function) |
operator==operator!= |
Compares the contents (Public member function) |
Element Access |
Operator[] |
Accesses specific bit (Public member function) |
Test |
Accesses specific bit (Public member function) |
Allanynone (C++11) |
Checks if all, any or none bits are set to True (Public member function) |
Count |
Returns the number of bits set to True (Public member function) |
Capacity |
Size |
Returns the size number of bits that the bitset can hold (Public member function) |
modifiers |
operator&=operator|=operator^=operator~ |
Performs binary and, or, XOR and not (Public member function) |
Operator<<=operator>>=operator<<operator>> |
Performs binary shift left and shift right (Public member function) |
Set |
Sets bits to true or given value (Public member function) |
Reset |
Sets bits to False (Public member function) |
Flip |
Toggles the values of bits (Public member function) |
Conversions |
To_string |
Returns a string representation of the data (Public member function) |
To_ulong |
Returns an unsigned long integer representation of the data (Public member function) |
To_ullong (C++11) |
Returns an unsigned long long integer representation of the data (Public member function) |
Non-member Functions
operator&operator|operator^ |
performs binary logic operations on Bitse TS&NBSP (function template) |
operator<<operator>> |
performs St Ream input and output of bitsets (function template) |