Namespaces
Variants
Views
Actions

std::bitset

From cppreference.com
Defined in header <bitset>
template< size_t N >
class bitset;

The class template bitset represents a fixed-size sequence of bits. Bitsets can be manipulated by usual logic operators, converted to and from strings and integers.

Contents

[edit] Member types

proxy class representing a reference to a bit
(class)

[edit] Member functions

constructs the bitset
(public member function) [edit]
compares the contents
(public member function) [edit]
Element access
accesses specific bit
(public member function) [edit]
accesses specific bit
(public member function) [edit]
(C++11)
 
 
checks if all, any or none bits are set to true
(public member function) [edit]
returns the number of bits set to true
(public member function) [edit]
Capacity
returns the size number of bits that the bitset can hold
(public member function) [edit]
Modifiers
performs binary AND, OR, XOR and NOT
(public member function) [edit]
performs binary shift left and shift right
(public member function) [edit]
sets bits to true or given value
(public member function) [edit]
sets bits to false
(public member function) [edit]
toggles the values of bits
(public member function) [edit]
Conversions
returns a string representation of the data
(public member function) [edit]
returns an unsigned long integer representation of the data
(public member function) [edit]
(C++11)
returns an unsigned long long integer representation of the data
(public member function) [edit]

[edit] Non-member functions

performs binary logic operations on bitsets
(function)
performs stream input and output of bitsets
(function)

[edit] Helper classes

hash support for std::bitset
(class template specialization) [edit]