std::bitset::to_ulong

unsigned long to_ulong() const Converts the contents of the bitset to an unsigned long integer. The first bit of the bitset corresponds to the least significant digit of the number and the last bit corresponds to the most significant digit. Parameters (none). Return value the converted integer. Exceptions throws std::overflow_error if the value can not be represented in unsigned long. Example #include <iostream> #include <bitset> int main() { for (unsigne

std::bit_and&lt;void&gt;

Defined in header <functional> template<> class bit_and<void>; (since C++14) std::bit_and<> is a specialization of std::bit_and with parameter and return type deduced. Member types Member type Definition is_transparent /* unspecified */ Member functions operator() applies operator& to lhs and rhs (public member function) std::bit_and<>::operator() template< class T, class U> constexpr auto operator()( T&&

std::bit_not&lt;void&gt;

Defined in header <functional> template<> class bit_not<void>; (since C++14) std::bit_not<> is a specialization of std::bit_not with parameter and return type deduced. Member types Member type Definition is_transparent /* unspecified */ Member functions operator() applies operator~ to its argument (public member function) std::bit_not<>::operator() template< class T > constexpr auto operator()( T&& arg ) con

std::bitset::size

std::size_t size() const; (until C++11) constexpr std::size_t size(); (since C++11) (until C++14) constexpr std::size_t size() const; (since C++14) Returns the number of bits that the bitset can hold. Parameters (none). Return value number of bits that the bitset can hold, i.e. the template parameter N. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) See also count returns the number of bits set to true (public member fun

std::bitset::reset

bitset<N>& reset(); (1) bitset<N>& reset( size_t pos ); (2) Sets bits to false. 1) Sets all bits to false 2) Sets the bit at position pos to false. Parameters pos - the position of the bit to set Return value *this. Exceptions 1) (none) (until C++11) noexcept specification: noexcept (since C++11) 2) Throws std::out_of_range if pos does not correspond to a valid position within the bitset Example #include <iostream> #includ

std::bitset::reference

class reference; The std::bitset class includes std::bitset::reference as a publicly-accessible nested class. This class is used as a proxy object to allow users to interact with individual bits of a bitset, since standard C++ types (like references and pointers) are not built with enough precision to specify individual bits. The primary use of std::bitset::reference is to provide an l-value that can be returned from operator[]. Any reads or writes to a bitset that happen via a std::bit

std::bitset::to_string

template< class CharT, class Traits, class Alloc > std::basic_string<CharT,Traits,Allocator> to_string() const; (until C++11) template< class CharT = char, class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT> > std::basic_string<CharT,Traits,Allocator> to_string(CharT zero = CharT('0'), CharT one = CharT('1')) const; (since C++11) Converts the contents of the bitset to a string. Uses zero

std::bitset::to_ullong

unsigned long long to_ullong() const (since C++11) Converts the contents of the bitset to an unsigned long long integer. The first bit of the bitset corresponds to the least significant digit of the number and the last bit corresponds to the most significant digit. Parameters (none). Return value the converted integer. Exceptions std::overflow_error if the value can not be represented in unsigned long long. Example #include <iostream> #include <bitset> #include

std::bitset::set

bitset<N>& set(); (1) bitset<N>& set( size_t pos, bool value = true ); (2) Sets all bits to true or to specified value. 1) Sets all bits to true. 2) Sets the bit at position pos to the value value. Parameters pos - the position of the bit to set value - the value to set the bit to Return value *this. Exceptions 1) (none) (until C++11) noexcept specification: noexcept (since C++11) 2) Throws std::out_of_range if pos does not corr

std::bitset::test

bool test( size_t pos ) const; Returns the value of the bit at the position pos. Unlike operator[], performs a bounds check and throws std::out_of_range if pos does not correspond to a valid position in the bitset. Parameters pos - position of the bit to return Return value true if the requested bit is set, false otherwise. Exceptions std::out_of_range if pos does not correspond to a valid position within the bitset. Example #include <iostream> #include <b