std::bitset (3) - Linux Manuals
std::bitset: std::bitset
NAME
Synopsis
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 be manipulated by standard logic operators and converted to and from strings and integers.
bitset meets the requirements of CopyConstructible and CopyAssignable.
Template parameters
N - the number of bits to allocate storage for
Member types
reference (class)
Member functions
constructor (public member function)
operator== (public member function)
operator!=
Element access
operator[] (public member function)
test (public member function)
all
any checks if all, any or none of the bits are set to true
none (public member function)
(C++11)
count (public member function)
Capacity
size (public member function)
Modifiers
operator&= performs binary AND, OR, XOR and NOT
operator|= (public member function)
operator^=
operator~
operator<<= performs binary shift left and shift right
operator>>= (public member function)
operator<<
operator>>
set (public member function)
reset (public member function)
flip (public member function)
Conversions
to_string (public member function)
to_ulong (public member function)
to_ullong returns an unsigned long long integer representation of the data
(C++11)
Non-member functions
operator& performs binary logic operations on bitsets
operator| (function template)
operator^
operator<< (function template)
operator>>
Helper classes
std::hash<std::bitset> hash support for std::bitset
(C++11)
Notes
If the size of the bitset is not known at compile time, std::vector<bool> or boost::dynamic_bitset may be used.